diff options
author | Joseph Tremoulet <jotrem@microsoft.com> | 2018-11-29 15:27:04 +0000 |
---|---|---|
committer | Joseph Tremoulet <jotrem@microsoft.com> | 2018-11-29 15:27:04 +0000 |
commit | 926ee459c40dc6e22945439d278f6e4ec553a640 (patch) | |
tree | aab020e58eb514d8bee0319cdbf60d52d2751175 /llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp | |
parent | de02e4b1cc68695d0af167fec4aa55cd74b0c90e (diff) | |
download | bcm5719-llvm-926ee459c40dc6e22945439d278f6e4ec553a640.tar.gz bcm5719-llvm-926ee459c40dc6e22945439d278f6e4ec553a640.zip |
[CallSiteSplitting] Report edge deletion to DomTreeUpdater
Summary:
When splitting musttail calls, the split blocks' original terminators
get removed; inform the DTU when this happens.
Also add a testcase that fails an assertion in the DTU without this fix.
Reviewers: fhahn, junbuml
Reviewed By: fhahn
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D55027
llvm-svn: 347872
Diffstat (limited to 'llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp b/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp index 2be41605c98..a806d6faed6 100644 --- a/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp +++ b/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp @@ -365,8 +365,10 @@ static void splitCallSite( // attempting removal. SmallVector<BasicBlock *, 2> Splits(predecessors((TailBB))); assert(Splits.size() == 2 && "Expected exactly 2 splits!"); - for (unsigned i = 0; i < Splits.size(); i++) + for (unsigned i = 0; i < Splits.size(); i++) { Splits[i]->getTerminator()->eraseFromParent(); + DTU.deleteEdge(Splits[i], TailBB); + } // Erase the tail block once done with musttail patching DTU.deleteBB(TailBB); |