summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-01-19 15:56:12 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-01-19 15:56:12 +0000
commit73f565e7546f63900738cd31a2f956444e7bb544 (patch)
treea4f4b7bd91cabded85ad8c881055fb7195f80d28 /lib
parentec91d52a77abfe3cf56413a11f47b3ee8e67e41e (diff)
downloadllvm-73f565e7546f63900738cd31a2f956444e7bb544.tar.gz
llvm-73f565e7546f63900738cd31a2f956444e7bb544.tar.bz2
llvm-73f565e7546f63900738cd31a2f956444e7bb544.tar.xz
Add a missing SCEV simplification sext(zext x) --> zext x.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123832 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/ScalarEvolution.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp
index b3df926119..ce04188490 100644
--- a/lib/Analysis/ScalarEvolution.cpp
+++ b/lib/Analysis/ScalarEvolution.cpp
@@ -994,6 +994,10 @@ const SCEV *ScalarEvolution::getSignExtendExpr(const SCEV *Op,
if (const SCEVSignExtendExpr *SS = dyn_cast<SCEVSignExtendExpr>(Op))
return getSignExtendExpr(SS->getOperand(), Ty);
+ // sext(zext(x)) --> zext(x)
+ if (const SCEVZeroExtendExpr *SZ = dyn_cast<SCEVZeroExtendExpr>(Op))
+ return getZeroExtendExpr(SZ->getOperand(), Ty);
+
// Before doing any expensive analysis, check to see if we've already
// computed a SCEV for this Op and Ty.
FoldingSetNodeID ID;