diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-04-13 19:43:35 +0000 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-04-13 19:43:35 +0000 |
commit | 95e5f28337c9ac5784836d3ecf6ae024ae27b96c (patch) | |
tree | a05f178a7fd3bdd59cc7c99dc2f53b8bd0d0b62b /llvm/lib/Transforms | |
parent | 55b0d987fd5569201a0cf0356e48ff06314502bc (diff) | |
download | bcm5719-llvm-95e5f28337c9ac5784836d3ecf6ae024ae27b96c.tar.gz bcm5719-llvm-95e5f28337c9ac5784836d3ecf6ae024ae27b96c.zip |
[InstCombine] Remove redundant/bogus mul_with_overflow combines
As pointed out in D60518 folding mulo(%x, undef) to {undef, undef}
isn't correct. As a correct version of this already exists in
InstructionSimplify (https://github.com/llvm-mirror/llvm/blob/bd8056ef326e075cc500f3f0cfcd1193bc200594/lib/Analysis/InstructionSimplify.cpp#L4750-L4757) this is just
dead code though. Drop it together with the mul(%x, 0) -> {0, false}
fold that is also already handled by InstSimplify.
Differential Revision: https://reviews.llvm.org/D60649
llvm-svn: 358339
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index 2c7d70e4db4..c73a095804b 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -4011,14 +4011,6 @@ bool InstCombiner::OptimizeOverflowCheck(OverflowCheckFlavor OCF, Value *LHS, case OCF_UNSIGNED_MUL: case OCF_SIGNED_MUL: { - // X * undef -> undef - if (isa<UndefValue>(RHS)) - return SetResult(RHS, UndefValue::get(Builder.getInt1Ty()), false); - - // X * 0 -> {0, false} - if (match(RHS, m_Zero())) - return SetResult(RHS, Builder.getFalse(), false); - // X * 1 -> {X, false} if (match(RHS, m_One())) return SetResult(LHS, Builder.getFalse(), false); |