forked from OSchip/llvm-project
[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:
parent
01f0d162d6
commit
7c8b8063b6
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue