mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
[LoopIdiomRecognize] Transform backedge-taken count check into an assertion.
runOnCountable() allowed the caller to call on a loop without a predictable backedge-taken count. Change the code so that only loops with computable backdge-count can call this function, in order to catch abuses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237044 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0cdb698aae
commit
383c55870e
@ -611,7 +611,9 @@ bool NclPopcountRecognize::recognize() {
|
||||
|
||||
bool LoopIdiomRecognize::runOnCountableLoop() {
|
||||
const SCEV *BECount = SE->getBackedgeTakenCount(CurLoop);
|
||||
if (isa<SCEVCouldNotCompute>(BECount)) return false;
|
||||
assert(!isa<SCEVCouldNotCompute>(BECount) &&
|
||||
"runOnCountableLoop() called on a loop without a predictable"
|
||||
"backedge-taken count");
|
||||
|
||||
// If this loop executes exactly one time, then it should be peeled, not
|
||||
// optimized by this pass.
|
||||
|
Loading…
Reference in New Issue
Block a user