summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
index c0fd14b2644..838ef3a1c6a 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
@@ -1062,9 +1062,7 @@ Instruction *InstCombiner::narrowAddIfNoOverflow(BinaryOperator &I) {
}
// Both operands have narrow versions. Last step: the math must not overflow
// in the narrow width.
- bool WillNotOverflow = IsSext ? willNotOverflowSignedAdd(X, Y, I)
- : willNotOverflowUnsignedAdd(X, Y, I);
- if (!WillNotOverflow)
+ if (!willNotOverflowAdd(X, Y, I, IsSext))
return nullptr;
// add (ext X), (ext Y) --> ext (add X, Y)
OpenPOWER on IntegriCloud