diff options
| author | Alina Sbirlea <asbirlea@google.com> | 2019-10-15 17:15:19 +0000 |
|---|---|---|
| committer | Alina Sbirlea <asbirlea@google.com> | 2019-10-15 17:15:19 +0000 |
| commit | 35c8af1850667b284829a329568ad90f9615e630 (patch) | |
| tree | 498285e7d7c707396c90ddf2b999bbeff9974b19 /llvm/lib/Transforms | |
| parent | 0b9981b180ef2f08d2a97cfda2fb6ca35ad5e93c (diff) | |
| download | bcm5719-llvm-35c8af1850667b284829a329568ad90f9615e630.tar.gz bcm5719-llvm-35c8af1850667b284829a329568ad90f9615e630.zip | |
[MemorySSA] Update DomTree before applying MSSA updates.
Update on the fix in rL374850.
llvm-svn: 374918
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp index fa9dbe240ba..e7621de82ff 100644 --- a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp +++ b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp @@ -2140,25 +2140,22 @@ static void unswitchNontrivialInvariants( // the branch in the split block. buildPartialUnswitchConditionalBranch(*SplitBB, Invariants, Direction, *ClonedPH, *LoopPH); + DTUpdates.push_back({DominatorTree::Insert, SplitBB, ClonedPH}); + if (MSSAU) { + DT.applyUpdates(DTUpdates); + DTUpdates.clear(); + // Perform MSSA cloning updates. for (auto &VMap : VMaps) MSSAU->updateForClonedLoop(LBRPO, ExitBlocks, *VMap, /*IgnoreIncomingWithNoClones=*/true); MSSAU->updateExitBlocksForClonedLoop(ExitBlocks, VMaps, DT); } - DTUpdates.push_back({DominatorTree::Insert, SplitBB, ClonedPH}); } // Apply the updates accumulated above to get an up-to-date dominator tree. DT.applyUpdates(DTUpdates); - if (!FullUnswitch && MSSAU) { - // Update MSSA for partial unswitch, after DT update. - SmallVector<CFGUpdate, 1> Updates; - Updates.push_back( - {cfg::UpdateKind::Insert, SplitBB, ClonedPHs.begin()->second}); - MSSAU->applyInsertUpdates(Updates, DT); - } // Now that we have an accurate dominator tree, first delete the dead cloned // blocks so that we can accurately build any cloned loops. It is important to |

