projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4086906
)
Fix a copy+paste bug that Duncan spotted. For several
author
Dan Gohman
<gohman@apple.com>
Thu, 11 Sep 2008 18:53:02 +0000
(18:53 +0000)
committer
Dan Gohman
<gohman@apple.com>
Thu, 11 Sep 2008 18:53:02 +0000
(18:53 +0000)
cases it was still getting lucky and detecting overflow
but it was clearly incorrect.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56113
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Transforms/Scalar/InstructionCombining.cpp
patch
|
blob
|
history
diff --git
a/lib/Transforms/Scalar/InstructionCombining.cpp
b/lib/Transforms/Scalar/InstructionCombining.cpp
index 46ac762b0a78349d3e9e6d71e91e5a3d4fabf655..5a9d1de2e35bdbb8c2e5e1cf306632d9409fe8a1 100644
(file)
--- a/
lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/
lib/Transforms/Scalar/InstructionCombining.cpp
@@
-4699,7
+4699,7
@@
static bool AddWithOverflow(ConstantInt *&Result, ConstantInt *In1,
/// overflowed for this type.
static bool SubWithOverflow(ConstantInt *&Result, ConstantInt *In1,
ConstantInt *In2, bool IsSigned = false) {
- Result = cast<ConstantInt>(
Add
(In1, In2));
+ Result = cast<ConstantInt>(
Subtract
(In1, In2));
if (IsSigned)
if (In2->getValue().isNegative())