Skip to content

Commit 47dbcbd

Browse files
committed
Revert [GlobalOpt] Pass DTU to removeUnreachableBlocks instead of recomputing.
This breaks http://lab.llvm.org:8011/builders/sanitizer-windows/builds/52310 This reverts r373430 (git commit 70f7003) llvm-svn: 373432
1 parent cbefc36 commit 47dbcbd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

llvm/lib/Transforms/IPO/GlobalOpt.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2285,10 +2285,14 @@ OptimizeFunctions(Module &M,
22852285
// So, remove unreachable blocks from the function, because a) there's
22862286
// no point in analyzing them and b) GlobalOpt should otherwise grow
22872287
// some more complicated logic to break these cycles.
2288+
// Removing unreachable blocks might invalidate the dominator so we
2289+
// recalculate it.
22882290
if (!F->isDeclaration()) {
2289-
auto &DT = LookupDomTree(*F);
2290-
DomTreeUpdater DTU(DT, DomTreeUpdater::UpdateStrategy::Lazy);
2291-
Changed |= removeUnreachableBlocks(*F, nullptr, &DTU);
2291+
if (removeUnreachableBlocks(*F)) {
2292+
auto &DT = LookupDomTree(*F);
2293+
DT.recalculate(*F);
2294+
Changed = true;
2295+
}
22922296
}
22932297

22942298
Changed |= processGlobal(*F, GetTLI, LookupDomTree);

0 commit comments

Comments
 (0)