diff options
author | David Majnemer <david.majnemer@gmail.com> | 2016-12-30 03:36:17 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2016-12-30 03:36:17 +0000 |
commit | 5ec5f278c95d59a1e47cd8d3d338c2a1c557ffde (patch) | |
tree | 9fc77697986bedec71a190cb3b6750ee1ef298dd /llvm/lib/Transforms/InstCombine | |
parent | e2770c0b8030ed5238da6cfd9f7309a44404b78a (diff) | |
download | bcm5719-llvm-5ec5f278c95d59a1e47cd8d3d338c2a1c557ffde.tar.gz bcm5719-llvm-5ec5f278c95d59a1e47cd8d3d338c2a1c557ffde.zip |
[InstCombine] Address post-commit feedback
llvm-svn: 290741
Diffstat (limited to 'llvm/lib/Transforms/InstCombine')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp index e9851c0fc96..3bbc70ab21c 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp @@ -1266,7 +1266,8 @@ Instruction *InstCombiner::visitAdd(BinaryOperator &I) { Constant *CI = ConstantExpr::getTrunc(RHSC, LHSConv->getOperand(0)->getType()); if (ConstantExpr::getZExt(CI, I.getType()) == RHSC && - WillNotOverflowSignedAdd(LHSConv->getOperand(0), CI, I)) { + computeOverflowForUnsignedAdd(LHSConv->getOperand(0), CI, &I) == + OverflowResult::NeverOverflows) { // Insert the new, smaller add. Value *NewAdd = Builder->CreateNUWAdd(LHSConv->getOperand(0), CI, "addconv"); diff --git a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp index 2f72e0ab6e9..ac64671725f 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp @@ -434,7 +434,8 @@ Instruction *InstCombiner::visitMul(BinaryOperator &I) { Constant *CI = ConstantExpr::getTrunc(Op1C, Op0Conv->getOperand(0)->getType()); if (ConstantExpr::getZExt(CI, I.getType()) == Op1C && - WillNotOverflowSignedMul(Op0Conv->getOperand(0), CI, I)) { + computeOverflowForUnsignedMul(Op0Conv->getOperand(0), CI, &I) == + OverflowResult::NeverOverflows) { // Insert the new, smaller mul. Value *NewMul = Builder->CreateNUWMul(Op0Conv->getOperand(0), CI, "mulconv"); |