mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 19:12:56 +02:00
[SCEV] Rename getMaxBECount and update comments. NFC
Post commit review comments at D38825. llvm-svn: 315920
This commit is contained in:
parent
b85949d044
commit
1811e7f3ce
@ -1746,9 +1746,10 @@ private:
|
|||||||
const SCEV *computeBECount(const SCEV *Delta, const SCEV *Stride,
|
const SCEV *computeBECount(const SCEV *Delta, const SCEV *Stride,
|
||||||
bool Equality);
|
bool Equality);
|
||||||
|
|
||||||
// Compute the maximum backedge count based on the range of values
|
/// Compute the maximum backedge count based on the range of values
|
||||||
// permitted by Start, End, and Stride.
|
/// permitted by Start, End, and Stride. This is for loops of the form
|
||||||
const SCEV *computeMaxBECount(const SCEV *Start, const SCEV *Stride,
|
/// {Start, +, Stride} LT End.
|
||||||
|
const SCEV *computeMaxBECountForLT(const SCEV *Start, const SCEV *Stride,
|
||||||
const SCEV *End, unsigned BitWidth,
|
const SCEV *End, unsigned BitWidth,
|
||||||
bool IsSigned);
|
bool IsSigned);
|
||||||
|
|
||||||
|
@ -9725,11 +9725,11 @@ const SCEV *ScalarEvolution::computeBECount(const SCEV *Delta, const SCEV *Step,
|
|||||||
return getUDivExpr(Delta, Step);
|
return getUDivExpr(Delta, Step);
|
||||||
}
|
}
|
||||||
|
|
||||||
const SCEV *ScalarEvolution::computeMaxBECount(const SCEV *Start,
|
const SCEV *ScalarEvolution::computeMaxBECountForLT(const SCEV *Start,
|
||||||
const SCEV *Stride,
|
const SCEV *Stride,
|
||||||
const SCEV *End,
|
const SCEV *End,
|
||||||
unsigned BitWidth,
|
unsigned BitWidth,
|
||||||
bool IsSigned) {
|
bool IsSigned) {
|
||||||
|
|
||||||
assert(!isKnownNonPositive(Stride) &&
|
assert(!isKnownNonPositive(Stride) &&
|
||||||
"Stride is expected strictly positive!");
|
"Stride is expected strictly positive!");
|
||||||
@ -9861,7 +9861,7 @@ ScalarEvolution::howManyLessThans(const SCEV *LHS, const SCEV *RHS,
|
|||||||
// bound of the loop (RHS), and the fact that IV does not overflow (which is
|
// bound of the loop (RHS), and the fact that IV does not overflow (which is
|
||||||
// checked above).
|
// checked above).
|
||||||
if (!isLoopInvariant(RHS, L)) {
|
if (!isLoopInvariant(RHS, L)) {
|
||||||
const SCEV *MaxBECount = computeMaxBECount(
|
const SCEV *MaxBECount = computeMaxBECountForLT(
|
||||||
Start, Stride, RHS, getTypeSizeInBits(LHS->getType()), IsSigned);
|
Start, Stride, RHS, getTypeSizeInBits(LHS->getType()), IsSigned);
|
||||||
return ExitLimit(getCouldNotCompute() /* ExactNotTaken */, MaxBECount,
|
return ExitLimit(getCouldNotCompute() /* ExactNotTaken */, MaxBECount,
|
||||||
false /*MaxOrZero*/, Predicates);
|
false /*MaxOrZero*/, Predicates);
|
||||||
@ -9898,8 +9898,8 @@ ScalarEvolution::howManyLessThans(const SCEV *LHS, const SCEV *RHS,
|
|||||||
MaxBECount = BECountIfBackedgeTaken;
|
MaxBECount = BECountIfBackedgeTaken;
|
||||||
MaxOrZero = true;
|
MaxOrZero = true;
|
||||||
} else {
|
} else {
|
||||||
MaxBECount = computeMaxBECount(Start, Stride, RHS,
|
MaxBECount = computeMaxBECountForLT(
|
||||||
getTypeSizeInBits(LHS->getType()), IsSigned);
|
Start, Stride, RHS, getTypeSizeInBits(LHS->getType()), IsSigned);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isa<SCEVCouldNotCompute>(MaxBECount) &&
|
if (isa<SCEVCouldNotCompute>(MaxBECount) &&
|
||||||
|
Loading…
Reference in New Issue
Block a user