[InstCombine] Recognize `((x * y) s/ x) !=/== y` as an signed multiplication overflow...
authorRoman Lebedev <lebedev.ri@gmail.com>
Tue, 20 Apr 2021 18:18:26 +0000 (21:18 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Tue, 20 Apr 2021 18:29:43 +0000 (21:29 +0300)
commit13ec913bdf500e2354cc55bf29e2f5d99e0c709e
tree141c01651f296d66ea512bec4cb8b5813d05a721
parent632eb20ab4fb06f3e3dbce29a30e615031b04b0d
[InstCombine] Recognize `((x * y) s/ x) !=/== y` as an signed multiplication overflow check (PR48769)

We already had support for it's unsigned variant, so simply extend it
to also handle the signed variant.

Fixes https://bugs.llvm.org/show_bug.cgi?id=48769
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/lib/Transforms/InstCombine/InstCombineInternal.h
llvm/test/Transforms/InstCombine/signed-mul-lack-of-overflow-check-via-mul-sdiv.ll
llvm/test/Transforms/InstCombine/signed-mul-overflow-check-via-mul-sdiv.ll