mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
Implement review feedback for the ConstantBool->ConstantInt merge. Chris
recommended that getBoolValue be replaced with getZExtValue and that get(bool) be replaced by get(const Type*, uint64_t). This implements those changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33110 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1722,7 +1722,7 @@ ComputeLoadConstantCompareIterationCount(LoadInst *LI, Constant *RHS,
|
||||
// Evaluate the condition for this iteration.
|
||||
Result = ConstantExpr::getICmp(predicate, Result, RHS);
|
||||
if (!isa<ConstantInt>(Result)) break; // Couldn't decide for sure
|
||||
if (cast<ConstantInt>(Result)->getBoolValue() == false) {
|
||||
if (cast<ConstantInt>(Result)->getZExtValue() == false) {
|
||||
#if 0
|
||||
cerr << "\n***\n*** Computed loop count " << *ItCst
|
||||
<< "\n*** From global " << *GV << "*** BB: " << *L->getHeader()
|
||||
@@ -1932,7 +1932,7 @@ ComputeIterationCountExhaustively(const Loop *L, Value *Cond, bool ExitWhen) {
|
||||
// Couldn't symbolically evaluate.
|
||||
if (!CondVal || CondVal->getType() != Type::Int1Ty) return UnknownValue;
|
||||
|
||||
if (CondVal->getBoolValue() == ExitWhen) {
|
||||
if (CondVal->getZExtValue() == ExitWhen) {
|
||||
ConstantEvolutionLoopExitValue[PN] = PHIVal;
|
||||
++NumBruteForceTripCountsComputed;
|
||||
return SCEVConstant::get(ConstantInt::get(Type::Int32Ty, IterationNum));
|
||||
@@ -2204,7 +2204,7 @@ SCEVHandle ScalarEvolutionsImpl::HowFarToZero(SCEV *V, const Loop *L) {
|
||||
if (ConstantInt *CB =
|
||||
dyn_cast<ConstantInt>(ConstantExpr::getICmp(ICmpInst::ICMP_ULT,
|
||||
R1->getValue(), R2->getValue()))) {
|
||||
if (CB->getBoolValue() == false)
|
||||
if (CB->getZExtValue() == false)
|
||||
std::swap(R1, R2); // R1 is the minimum root now.
|
||||
|
||||
// We can only use this value if the chrec ends up with an exact zero
|
||||
@@ -2429,7 +2429,7 @@ SCEVHandle SCEVAddRecExpr::getNumIterationsInRange(ConstantRange Range,
|
||||
if (ConstantInt *CB =
|
||||
dyn_cast<ConstantInt>(ConstantExpr::getICmp(ICmpInst::ICMP_ULT,
|
||||
R1->getValue(), R2->getValue()))) {
|
||||
if (CB->getBoolValue() == false)
|
||||
if (CB->getZExtValue() == false)
|
||||
std::swap(R1, R2); // R1 is the minimum root now.
|
||||
|
||||
// Make sure the root is not off by one. The returned iteration should
|
||||
|
||||
Reference in New Issue
Block a user