mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 20:34:38 +00:00
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
This commit is contained in:
parent
cf96db2c1d
commit
6e801dc6c0
@ -1207,7 +1207,7 @@ namespace {
|
|||||||
SCEVHandle ComputeIterationCount(const Loop *L);
|
SCEVHandle ComputeIterationCount(const Loop *L);
|
||||||
|
|
||||||
/// ComputeLoadConstantCompareIterationCount - Given an exit condition of
|
/// 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,
|
SCEVHandle ComputeLoadConstantCompareIterationCount(LoadInst *LI,
|
||||||
Constant *RHS,
|
Constant *RHS,
|
||||||
const Loop *L,
|
const Loop *L,
|
||||||
@ -1418,13 +1418,12 @@ static APInt GetConstantFactor(SCEVHandle S) {
|
|||||||
if (!V.isMinValue())
|
if (!V.isMinValue())
|
||||||
return V;
|
return V;
|
||||||
else // Zero is a multiple of everything.
|
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(
|
return GetConstantFactor(T->getOperand()).trunc(
|
||||||
cast<IntegerType>(T->getType())->getBitWidth());
|
cast<IntegerType>(T->getType())->getBitWidth());
|
||||||
}
|
|
||||||
if (SCEVZeroExtendExpr *E = dyn_cast<SCEVZeroExtendExpr>(S))
|
if (SCEVZeroExtendExpr *E = dyn_cast<SCEVZeroExtendExpr>(S))
|
||||||
return GetConstantFactor(E->getOperand()).zext(
|
return GetConstantFactor(E->getOperand()).zext(
|
||||||
cast<IntegerType>(E->getType())->getBitWidth());
|
cast<IntegerType>(E->getType())->getBitWidth());
|
||||||
@ -1787,7 +1786,7 @@ GetAddressedElementFromGlobal(GlobalVariable *GV,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// ComputeLoadConstantCompareIterationCount - Given an exit condition of
|
/// 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::
|
SCEVHandle ScalarEvolutionsImpl::
|
||||||
ComputeLoadConstantCompareIterationCount(LoadInst *LI, Constant *RHS,
|
ComputeLoadConstantCompareIterationCount(LoadInst *LI, Constant *RHS,
|
||||||
const Loop *L,
|
const Loop *L,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user