[PATCH] D129997: [Local] Allow creating callbr with duplicate successors
Nick Desaulniers via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 19 15:49:17 PDT 2022
nickdesaulniers added a comment.
Basically, before early-tailduplication we have:
bb.3.if.else.i.i:
; predecessors: %bb.2
successors: %bb.5(0x80000000); %bb.5(100.00%)
INLINEASM_BR &"" [sideeffect] [attdialect], $0:[imm], blockaddress(@ceph_con_v2_try_read, %ir-block.if.end.i)
B %bb.5
bb.5.if.end.i (address-taken, inlineasm-br-indirect-target):
; predecessors: %bb.3
successors: %bb.1(0x80000000); %bb.1(100.00%)
LIFETIME_END %stack.0.skip.i.i
B %bb.1
after:
bb.3.if.else.i.i:
; predecessors: %bb.2
successors: %bb.1(0x80000000); %bb.1(100.00%)
INLINEASM_BR &"" [sideeffect] [attdialect], $0:[imm], blockaddress(@ceph_con_v2_try_read, %ir-block.if.end.i)
LIFETIME_END %stack.0.skip.i.i
B %bb.1
bb.5.if.end.i (address-taken, inlineasm-br-indirect-target):
successors: %bb.1(0x80000000); %bb.1(100.00%)
LIFETIME_END %stack.0.skip.i.i
B %bb.1
`TailDuplicator::tailDuplicate`<llvm/lib/CodeGen/TailDuplicator.cpp> has code like:
866 // Remove PredBB's unconditional branch.
867 TII->removeBranch(*PredBB);
...
887 // Update the CFG.
888 PredBB->removeSuccessor(PredBB->succ_begin());
which is going to mess up the TailBB's predecessor list. (Notice: it's broken in the after example).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D129997/new/
https://reviews.llvm.org/D129997
More information about the llvm-commits
mailing list