We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5a8b229 commit a03d7b0Copy full SHA for a03d7b0
llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -2285,14 +2285,10 @@ OptimizeFunctions(Module &M,
2285
// So, remove unreachable blocks from the function, because a) there's
2286
// no point in analyzing them and b) GlobalOpt should otherwise grow
2287
// some more complicated logic to break these cycles.
2288
- // Removing unreachable blocks might invalidate the dominator so we
2289
- // recalculate it.
2290
if (!F->isDeclaration()) {
2291
- if (removeUnreachableBlocks(*F)) {
2292
- auto &DT = LookupDomTree(*F);
2293
- DT.recalculate(*F);
2294
- Changed = true;
2295
- }
+ auto &DT = LookupDomTree(*F);
+ DomTreeUpdater DTU(DT, DomTreeUpdater::UpdateStrategy::Lazy);
+ Changed |= removeUnreachableBlocks(*F, &DTU);
2296
}
2297
2298
Changed |= processGlobal(*F, GetTLI, LookupDomTree);
0 commit comments