aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/Reassociate.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-03-01 21:51:23 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-03-01 21:51:23 +0000
commit4da0451821732e20d132e612ba8852a1c6498fab (patch)
tree18bf1f32ddd0193f02f049a0ca672d011638efe8 /lib/Transforms/Scalar/Reassociate.cpp
parent37eeaa729bc70258166a675ee00bbe95e608d519 (diff)
Use isUnitValue() instead of getZExtValue() == 1 which will prevent an
assert if the ConstantInt's value is large. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34814 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/Reassociate.cpp')
-rw-r--r--lib/Transforms/Scalar/Reassociate.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp
index e1dbb9b0d1..aa851b290f 100644
--- a/lib/Transforms/Scalar/Reassociate.cpp
+++ b/lib/Transforms/Scalar/Reassociate.cpp
@@ -547,7 +547,7 @@ Value *Reassociate::OptimizeExpression(BinaryOperator *I,
if (CstVal->isNullValue()) { // ... * 0 -> 0
++NumAnnihil;
return CstVal;
- } else if (cast<ConstantInt>(CstVal)->getZExtValue() == 1) {
+ } else if (cast<ConstantInt>(CstVal)->isUnitValue()) {
Ops.pop_back(); // ... * 1 -> ...
}
break;