forked from OSchip/llvm-project
The pass manager is not able to schedule -loop-deletion -loop-index-split.
The loop-deletion pass does not preserve dom frontier, which is required by loop-index-split. When the PM checks dom frontier for loop-index-split, it has already verified that lcssa is availalble. However, new dom frontier forces new loop pass manager, which does not have lcssa yet. The PM should recheck availability of required analysis passes in such cases. llvm-svn: 54805
This commit is contained in:
parent
861bec78f8
commit
fdee7034b3
|
@ -463,20 +463,34 @@ void PMTopLevelManager::schedulePass(Pass *P) {
|
|||
|
||||
AnalysisUsage *AnUsage = findAnalysisUsage(P);
|
||||
|
||||
const AnalysisUsage::VectorType &RequiredSet = AnUsage->getRequiredSet();
|
||||
for (AnalysisUsage::VectorType::const_iterator I = RequiredSet.begin(),
|
||||
E = RequiredSet.end(); I != E; ++I) {
|
||||
|
||||
Pass *AnalysisPass = findAnalysisPass(*I);
|
||||
if (!AnalysisPass) {
|
||||
AnalysisPass = (*I)->createPass();
|
||||
// Schedule this analysis run first only if it is not a lower level
|
||||
// analysis pass. Lower level analsyis passes are run on the fly.
|
||||
if (P->getPotentialPassManagerType () >=
|
||||
AnalysisPass->getPotentialPassManagerType())
|
||||
schedulePass(AnalysisPass);
|
||||
else
|
||||
delete AnalysisPass;
|
||||
bool checkAnalysis = true;
|
||||
while (checkAnalysis) {
|
||||
checkAnalysis = false;
|
||||
|
||||
const AnalysisUsage::VectorType &RequiredSet = AnUsage->getRequiredSet();
|
||||
for (AnalysisUsage::VectorType::const_iterator I = RequiredSet.begin(),
|
||||
E = RequiredSet.end(); I != E; ++I) {
|
||||
|
||||
Pass *AnalysisPass = findAnalysisPass(*I);
|
||||
if (!AnalysisPass) {
|
||||
AnalysisPass = (*I)->createPass();
|
||||
if (P->getPotentialPassManagerType () ==
|
||||
AnalysisPass->getPotentialPassManagerType())
|
||||
// Schedule analysis pass that is managed by the same pass manager.
|
||||
schedulePass(AnalysisPass);
|
||||
else if (P->getPotentialPassManagerType () >
|
||||
AnalysisPass->getPotentialPassManagerType()) {
|
||||
// Schedule analysis pass that is managed by a new manager.
|
||||
schedulePass(AnalysisPass);
|
||||
// Recheck analysis passes to ensure that required analysises that
|
||||
// are already checked are still available.
|
||||
checkAnalysis = true;
|
||||
}
|
||||
else
|
||||
// Do not schedule this analysis. Lower level analsyis
|
||||
// passes are run on the fly.
|
||||
delete AnalysisPass;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
; RUN: llvm-as < %s | opt -loop-deletion -loop-index-split -disable-output
|
||||
; PR 2640
|
||||
define i32 @test1() {
|
||||
ret i32 0;
|
||||
}
|
Loading…
Reference in New Issue