summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp
diff options
context:
space:
mode:
authorJoseph Tremoulet <jotrem@microsoft.com>2018-11-29 15:27:04 +0000
committerJoseph Tremoulet <jotrem@microsoft.com>2018-11-29 15:27:04 +0000
commit926ee459c40dc6e22945439d278f6e4ec553a640 (patch)
treeaab020e58eb514d8bee0319cdbf60d52d2751175 /llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp
parentde02e4b1cc68695d0af167fec4aa55cd74b0c90e (diff)
downloadbcm5719-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.cpp4
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);
OpenPOWER on IntegriCloud