[SimplifyCFG][AMDGPU] AMDGPUUnifyDivergentExitNodes: SimplifyCFG isn't ready to preserve PostDomTree

There is a number of transforms in SimplifyCFG that take DomTree out of
DomTreeUpdater, and do updates manually. Until they are fixed,
user passes are unable to claim that PDT is preserved.

Note that the default for SimplifyCFG is still not to preserve DomTree,
so this is still effectively NFC.
This commit is contained in:
Roman Lebedev 2021-01-02 21:58:48 +03:00
parent 01f0d162d6
commit 7c8b8063b6
No known key found for this signature in database
GPG Key ID: 083C3EBB4A1689E0
2 changed files with 8 additions and 3 deletions

View File

@ -89,7 +89,7 @@ void AMDGPUUnifyDivergentExitNodes::getAnalysisUsage(AnalysisUsage &AU) const{
if (RequireAndPreserveDomTree) {
AU.addPreserved<DominatorTreeWrapperPass>();
AU.addPreserved<PostDominatorTreeWrapperPass>();
// FIXME: preserve PostDominatorTreeWrapperPass
}
// No divergent values are changed, only blocks and branch edges.
@ -369,7 +369,8 @@ bool AMDGPUUnifyDivergentExitNodes::runOnFunction(Function &F) {
}
}
DomTreeUpdater DTU(DT, &PDT, DomTreeUpdater::UpdateStrategy::Eager);
// FIXME: add PDT here once simplifycfg is ready.
DomTreeUpdater DTU(DT, DomTreeUpdater::UpdateStrategy::Eager);
if (RequireAndPreserveDomTree)
DTU.applyUpdates(Updates);
Updates.clear();

View File

@ -263,7 +263,11 @@ public:
const DataLayout &DL,
SmallPtrSetImpl<BasicBlock *> *LoopHeaders,
const SimplifyCFGOptions &Opts)
: TTI(TTI), DTU(DTU), DL(DL), LoopHeaders(LoopHeaders), Options(Opts) {}
: TTI(TTI), DTU(DTU), DL(DL), LoopHeaders(LoopHeaders), Options(Opts) {
assert((!DTU || !DTU->hasPostDomTree()) &&
"SimplifyCFG is not yet capable of maintaining validity of a "
"PostDomTree, so don't ask for it.");
}
bool simplifyOnce(BasicBlock *BB);
bool simplifyOnceImpl(BasicBlock *BB);