diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-11-01 21:53:12 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-11-01 21:53:12 +0000 |
commit | 48d8a70d22eb166a917946d7ed69061e91e9cd12 (patch) | |
tree | f2fcf3f4f83aa2f1c69c706f01c7e774601077cb /lib/Analysis/ScalarEvolution.cpp | |
parent | d4bf3c2fd60975b30cd067b59f743a3ea45e45b5 (diff) |
Make ScalarEvolution actually use a ZeroExtend expression instead of
having SCZeroExtendExpr be equivalent to SCTruncate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31355 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ScalarEvolution.cpp')
-rw-r--r-- | lib/Analysis/ScalarEvolution.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 20e3859b63..d555a14089 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -229,7 +229,7 @@ static ManagedStatic<std::map<std::pair<SCEV*, const Type*>, SCEVZeroExtendExpr*> > SCEVZeroExtends; SCEVZeroExtendExpr::SCEVZeroExtendExpr(const SCEVHandle &op, const Type *ty) - : SCEV(scTruncate), Op(op), Ty(ty) { + : SCEV(scZeroExtend), Op(op), Ty(ty) { assert(Op->getType()->isInteger() && Ty->isInteger() && Ty->isUnsigned() && "Cannot zero extend non-integer value!"); @@ -1359,7 +1359,7 @@ SCEVHandle ScalarEvolutionsImpl::createNodeForCast(CastInst *CI) { return SCEVTruncateExpr::get(getSCEV(CI->getOperand(0)), CI->getType()->getUnsignedVersion()); if (SrcTy->isUnsigned() && - SrcTy->getPrimitiveSize() > DestTy->getPrimitiveSize()) + SrcTy->getPrimitiveSize() <= DestTy->getPrimitiveSize()) return SCEVZeroExtendExpr::get(getSCEV(CI->getOperand(0)), CI->getType()->getUnsignedVersion()); } |