mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-02 09:33:59 +00:00
Add -verify-indvars for imperfect SCEV trip count verification after indvars.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139169 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
79d56a66c3
commit
75ebc0ec20
@ -76,6 +76,13 @@ namespace llvm {
|
|||||||
cl::opt<bool> DisableIVRewrite(
|
cl::opt<bool> DisableIVRewrite(
|
||||||
"disable-iv-rewrite", cl::Hidden,
|
"disable-iv-rewrite", cl::Hidden,
|
||||||
cl::desc("Disable canonical induction variable rewriting"));
|
cl::desc("Disable canonical induction variable rewriting"));
|
||||||
|
|
||||||
|
// Trip count verification can be enabled by default under NDEBUG if we
|
||||||
|
// implement a strong expression equivalence checker in SCEV. Until then, we
|
||||||
|
// use the verify-indvars flag, which may assert in some cases.
|
||||||
|
cl::opt<bool> VerifyIndvars(
|
||||||
|
"verify-indvars", cl::Hidden,
|
||||||
|
cl::desc("Verify the ScalarEvolution result after running indvars"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Temporary flag for use with -disable-iv-rewrite to force a canonical IV for
|
// Temporary flag for use with -disable-iv-rewrite to force a canonical IV for
|
||||||
@ -1968,7 +1975,8 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
|
|||||||
// Verify that LFTR, and any other change have not interfered with SCEV's
|
// Verify that LFTR, and any other change have not interfered with SCEV's
|
||||||
// ability to compute trip count.
|
// ability to compute trip count.
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
if (DisableIVRewrite && !isa<SCEVCouldNotCompute>(BackedgeTakenCount)) {
|
if (DisableIVRewrite && VerifyIndvars &&
|
||||||
|
!isa<SCEVCouldNotCompute>(BackedgeTakenCount)) {
|
||||||
SE->forgetLoop(L);
|
SE->forgetLoop(L);
|
||||||
const SCEV *NewBECount = SE->getBackedgeTakenCount(L);
|
const SCEV *NewBECount = SE->getBackedgeTakenCount(L);
|
||||||
if (SE->getTypeSizeInBits(BackedgeTakenCount->getType()) <
|
if (SE->getTypeSizeInBits(BackedgeTakenCount->getType()) <
|
||||||
|
Loading…
x
Reference in New Issue
Block a user