diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2007-11-20 08:44:50 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2007-11-20 08:44:50 +0000 |
commit | 74a26e375076e35ef02790c1c417689e1c6b1eba (patch) | |
tree | f9e0daa47a88931a3537324d7c5bf9879ebc1fe5 /llvm | |
parent | 5b18bd336802c6f72ac4db5cedcceea81d12e51a (diff) | |
download | bcm5719-llvm-74a26e375076e35ef02790c1c417689e1c6b1eba.tar.gz bcm5719-llvm-74a26e375076e35ef02790c1c417689e1c6b1eba.zip |
Small cleanup. Use APInt::getHighBitsSet method instead of shift left.
"setcc" -> "icmp op" in comments. No functionality change.
llvm-svn: 44249
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index e7bb9ab80c2..fed57f9d917 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -1207,7 +1207,7 @@ namespace { SCEVHandle ComputeIterationCount(const Loop *L); /// ComputeLoadConstantCompareIterationCount - Given an exit condition of - /// 'setcc load X, cst', try to see if we can compute the trip count. + /// 'icmp op load X, cst', try to see if we can compute the trip count. SCEVHandle ComputeLoadConstantCompareIterationCount(LoadInst *LI, Constant *RHS, const Loop *L, @@ -1418,13 +1418,12 @@ static APInt GetConstantFactor(SCEVHandle S) { if (!V.isMinValue()) return V; else // Zero is a multiple of everything. - return APInt(C->getBitWidth(), 1).shl(C->getBitWidth()-1); + return APInt::getHighBitsSet(C->getBitWidth(), 1); } - if (SCEVTruncateExpr *T = dyn_cast<SCEVTruncateExpr>(S)) { + if (SCEVTruncateExpr *T = dyn_cast<SCEVTruncateExpr>(S)) return GetConstantFactor(T->getOperand()).trunc( cast<IntegerType>(T->getType())->getBitWidth()); - } if (SCEVZeroExtendExpr *E = dyn_cast<SCEVZeroExtendExpr>(S)) return GetConstantFactor(E->getOperand()).zext( cast<IntegerType>(E->getType())->getBitWidth()); @@ -1787,7 +1786,7 @@ GetAddressedElementFromGlobal(GlobalVariable *GV, } /// ComputeLoadConstantCompareIterationCount - Given an exit condition of -/// 'setcc load X, cst', try to se if we can compute the trip count. +/// 'icmp op load X, cst', try to se if we can compute the trip count. SCEVHandle ScalarEvolutionsImpl:: ComputeLoadConstantCompareIterationCount(LoadInst *LI, Constant *RHS, const Loop *L, |