mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 20:23:59 +00:00
Small fix in InstCombineCasts.cpp. Restored "alloca + bitcast" reducing for case when alloca's size is calculated within the "add/sub/... nsw".
Also added fix to 2011-06-13-nsw-alloca.ll test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156231 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -34,7 +34,7 @@ static Value *DecomposeSimpleLinearExpr(Value *Val, unsigned &Scale,
|
||||
if (BinaryOperator *I = dyn_cast<BinaryOperator>(Val)) {
|
||||
// Cannot look past anything that might overflow.
|
||||
OverflowingBinaryOperator *OBI = dyn_cast<OverflowingBinaryOperator>(Val);
|
||||
if (OBI && !OBI->hasNoUnsignedWrap()) {
|
||||
if (OBI && !OBI->hasNoUnsignedWrap() && !OBI->hasNoSignedWrap()) {
|
||||
Scale = 1;
|
||||
Offset = 0;
|
||||
return Val;
|
||||
|
Reference in New Issue
Block a user