[PATCH] D55027: [CallSiteSplitting] Report edge deletion to DomTreeUpdater
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 29 07:30:00 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL347872: [CallSiteSplitting] Report edge deletion to DomTreeUpdater (authored by josepht, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D55027?vs=175766&id=175870#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55027/new/
https://reviews.llvm.org/D55027
Files:
llvm/trunk/lib/Transforms/Scalar/CallSiteSplitting.cpp
llvm/trunk/test/Transforms/CallSiteSplitting/musttail.ll
Index: llvm/trunk/test/Transforms/CallSiteSplitting/musttail.ll
===================================================================
--- llvm/trunk/test/Transforms/CallSiteSplitting/musttail.ll
+++ llvm/trunk/test/Transforms/CallSiteSplitting/musttail.ll
@@ -73,3 +73,32 @@
define void @void_callee(i8* %a, i8* %b) noinline {
ret void
}
+
+; Include a test with a larger CFG that exercises the DomTreeUpdater
+; machinery a bit more.
+;CHECK-LABEL: @larger_cfg_caller
+;CHECK-LABEL: Top.split:
+;CHECK: %r1 = musttail call i8* @callee(i8* null, i8* %b)
+;CHECK: ret i8* %r1
+;CHECK-LABEL: TBB.split
+;CHECK: %r2 = musttail call i8* @callee(i8* nonnull %a, i8* null)
+;CHECK: ret i8* %r2
+define i8* @larger_cfg_caller(i8* %a, i8* %b) {
+Top:
+ %cond1 = icmp eq i8* %a, null
+ br i1 %cond1, label %Tail, label %ExtraTest
+ExtraTest:
+ %a0 = load i8, i8* %a
+ %cond2 = icmp eq i8 %a0, 0
+ br i1 %cond2, label %TBB_pred, label %End
+TBB_pred:
+ br label %TBB
+TBB:
+ %cond3 = icmp eq i8* %b, null
+ br i1 %cond3, label %Tail, label %End
+Tail:
+ %r = musttail call i8* @callee(i8* %a, i8* %b)
+ ret i8* %r
+End:
+ ret i8* null
+}
Index: llvm/trunk/lib/Transforms/Scalar/CallSiteSplitting.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Scalar/CallSiteSplitting.cpp
+++ llvm/trunk/lib/Transforms/Scalar/CallSiteSplitting.cpp
@@ -365,8 +365,10 @@
// 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);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55027.175870.patch
Type: text/x-patch
Size: 1870 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181129/f301ed29/attachment.bin>
More information about the llvm-commits
mailing list