mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 20:29:48 +00:00
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
This commit is contained in:
parent
37eeaa729b
commit
4da0451821
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user