diff options
| author | Reid Spencer <rspencer@reidspencer.com> | 2007-03-01 21:51:23 +0000 |
|---|---|---|
| committer | Reid Spencer <rspencer@reidspencer.com> | 2007-03-01 21:51:23 +0000 |
| commit | 17797076ef8ba1ceabae32692896badffba65022 (patch) | |
| tree | 6ac87d800267b3fc9e35d544df562c58bbe0e50b /llvm/lib/Transforms/Scalar/Reassociate.cpp | |
| parent | 9c61acc45064bac1fad666021202deef54dddcb5 (diff) | |
| download | bcm5719-llvm-17797076ef8ba1ceabae32692896badffba65022.tar.gz bcm5719-llvm-17797076ef8ba1ceabae32692896badffba65022.zip | |
Use isUnitValue() instead of getZExtValue() == 1 which will prevent an
assert if the ConstantInt's value is large.
llvm-svn: 34814
Diffstat (limited to 'llvm/lib/Transforms/Scalar/Reassociate.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/Reassociate.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/Reassociate.cpp b/llvm/lib/Transforms/Scalar/Reassociate.cpp index e1dbb9b0d1b..aa851b290f4 100644 --- a/llvm/lib/Transforms/Scalar/Reassociate.cpp +++ b/llvm/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; |

