diff options
author | Florian Hahn <flo@fhahn.com> | 2019-10-02 20:40:13 +0000 |
---|---|---|
committer | Florian Hahn <flo@fhahn.com> | 2019-10-02 20:40:13 +0000 |
commit | a03d7b0f24b65d69721dbbbc871df0629efcf774 (patch) | |
tree | f7349704b43ac3c4ae572fbd36b84d0c5ea48981 /llvm/lib/Transforms | |
parent | 5a8b229c97d0586835f2a136798c9eeea391051a (diff) | |
download | bcm5719-llvm-a03d7b0f24b65d69721dbbbc871df0629efcf774.tar.gz bcm5719-llvm-a03d7b0f24b65d69721dbbbc871df0629efcf774.zip |
Recommit "[GlobalOpt] Pass DTU to removeUnreachableBlocks instead of recomputing."
The cause for the revert should be fixed by r373513 /
a80b6c15425f82521c624ff24c5c0a34cd534d54
This reverts commit 47dbcbd8ec6bf6c0b9cbe5811e81a37cc55e73ef.
llvm-svn: 373522
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/IPO/GlobalOpt.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp index 9c7fd5e1a81..feac1b60884 100644 --- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp +++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp @@ -2285,14 +2285,10 @@ OptimizeFunctions(Module &M, // So, remove unreachable blocks from the function, because a) there's // no point in analyzing them and b) GlobalOpt should otherwise grow // some more complicated logic to break these cycles. - // Removing unreachable blocks might invalidate the dominator so we - // recalculate it. if (!F->isDeclaration()) { - if (removeUnreachableBlocks(*F)) { - auto &DT = LookupDomTree(*F); - DT.recalculate(*F); - Changed = true; - } + auto &DT = LookupDomTree(*F); + DomTreeUpdater DTU(DT, DomTreeUpdater::UpdateStrategy::Lazy); + Changed |= removeUnreachableBlocks(*F, &DTU); } Changed |= processGlobal(*F, GetTLI, LookupDomTree); |