aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2007-11-20 08:44:50 +0000
committerNick Lewycky <nicholas@mxc.ca>2007-11-20 08:44:50 +0000
commit3a8a41f265f7e31d340a71e1ab35e30e534cc1cf (patch)
treea3e05d2977984ebbdf92746dbe636a90db89b0f6
parentef94749b4c1d8b754b63ab20f3c82c7593ba8243 (diff)
downloadexternal_llvm-3a8a41f265f7e31d340a71e1ab35e30e534cc1cf.zip
external_llvm-3a8a41f265f7e31d340a71e1ab35e30e534cc1cf.tar.gz
external_llvm-3a8a41f265f7e31d340a71e1ab35e30e534cc1cf.tar.bz2
Small cleanup. Use APInt::getHighBitsSet method instead of shift left.
"setcc" -> "icmp op" in comments. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44249 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Analysis/ScalarEvolution.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp
index e7bb9ab..fed57f9 100644
--- a/lib/Analysis/ScalarEvolution.cpp
+++ b/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,