From: Reid Spencer Date: Thu, 1 Mar 2007 21:51:23 +0000 (+0000) Subject: Use isUnitValue() instead of getZExtValue() == 1 which will prevent an X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4da0451821732e20d132e612ba8852a1c6498fab;p=oota-llvm.git 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 --- diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp index e1dbb9b0d1b..aa851b290f4 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(CstVal)->getZExtValue() == 1) { + } else if (cast(CstVal)->isUnitValue()) { Ops.pop_back(); // ... * 1 -> ... } break;