summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-11-24 16:41:13 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-11-24 16:41:13 +0000
commit8e6f6a98b5a80465ed507513d823d8183462c4ce (patch)
tree49a136c5c131b62d0c16b3b5cd98cd8f9cfd5700 /llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
parent11bdb8bf336aec60b87b6288a09cf90a232dadbc (diff)
downloadbcm5719-llvm-8e6f6a98b5a80465ed507513d823d8183462c4ce.tar.gz
bcm5719-llvm-8e6f6a98b5a80465ed507513d823d8183462c4ce.zip
InstCombine: Don't create an unused instruction
We would create an instruction but not inserting it. Not inserting the unused instruction would lead us to verification failure. This fixes PR21653. llvm-svn: 222659
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
index d7847ca5ccd..3956869e2d3 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
@@ -300,8 +300,7 @@ Instruction *InstCombiner::visitMul(BinaryOperator &I) {
if (match(Op0, m_Shl(m_One(), m_Value(Y)))) {
BO = BinaryOperator::CreateShl(Op1, Y);
ShlNSW = cast<BinaryOperator>(Op0)->hasNoSignedWrap();
- }
- if (match(Op1, m_Shl(m_One(), m_Value(Y)))) {
+ } else if (match(Op1, m_Shl(m_One(), m_Value(Y)))) {
BO = BinaryOperator::CreateShl(Op0, Y);
ShlNSW = cast<BinaryOperator>(Op1)->hasNoSignedWrap();
}
OpenPOWER on IntegriCloud