forked from OSchip/llvm-project
Recommit "[GlobalOpt] Pass DTU to removeUnreachableBlocks instead of recomputing."
The cause for the revert should be fixed by r373513 /a80b6c1542
This reverts commit47dbcbd8ec
. llvm-svn: 373522
This commit is contained in:
parent
5a8b229c97
commit
a03d7b0f24
|
@ -2285,14 +2285,10 @@ OptimizeFunctions(Module &M,
|
||||||
// So, remove unreachable blocks from the function, because a) there's
|
// So, remove unreachable blocks from the function, because a) there's
|
||||||
// no point in analyzing them and b) GlobalOpt should otherwise grow
|
// no point in analyzing them and b) GlobalOpt should otherwise grow
|
||||||
// some more complicated logic to break these cycles.
|
// some more complicated logic to break these cycles.
|
||||||
// Removing unreachable blocks might invalidate the dominator so we
|
|
||||||
// recalculate it.
|
|
||||||
if (!F->isDeclaration()) {
|
if (!F->isDeclaration()) {
|
||||||
if (removeUnreachableBlocks(*F)) {
|
auto &DT = LookupDomTree(*F);
|
||||||
auto &DT = LookupDomTree(*F);
|
DomTreeUpdater DTU(DT, DomTreeUpdater::UpdateStrategy::Lazy);
|
||||||
DT.recalculate(*F);
|
Changed |= removeUnreachableBlocks(*F, &DTU);
|
||||||
Changed = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Changed |= processGlobal(*F, GetTLI, LookupDomTree);
|
Changed |= processGlobal(*F, GetTLI, LookupDomTree);
|
||||||
|
|
Loading…
Reference in New Issue