summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorStepan Dyatkovskiy <stpworld@narod.ru>2012-05-05 07:09:40 +0000
committerStepan Dyatkovskiy <stpworld@narod.ru>2012-05-05 07:09:40 +0000
commitcb2a1a34e255a32ea4b68063ee61868dcca219a3 (patch)
tree53e982206e1466e187e093da808123e5264aa800 /llvm/lib/Transforms
parent66b7c5959368748a19531f734bebe73977b79d31 (diff)
downloadbcm5719-llvm-cb2a1a34e255a32ea4b68063ee61868dcca219a3.tar.gz
bcm5719-llvm-cb2a1a34e255a32ea4b68063ee61868dcca219a3.zip
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. llvm-svn: 156231
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
index 39279f43720..d07be2c8b38 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
@@ -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;
OpenPOWER on IntegriCloud