[PATCH] D83523: MachineSink: permit sinking into INLINEASM_BR indirect targets
James Y Knight via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 10 15:15:17 PDT 2020
jyknight added a comment.
It looks like the issue shown in this test-case appears in Two-Address instruction pass, not Machine Sink.
We go from:
bb.0 (%ir-block.1):
successors: %bb.2(0x80000000), %bb.1(0x00000000); %bb.2(100.00%), %bb.1(0.00%)
liveins: $rdi
%1:gr64 = COPY killed $rdi
%0:gr64 = nuw ADD64ri8 %1:gr64(tied-def 0), 24, implicit-def dead $eflags
INLINEASM_BR &"# $0 $1 $2" [sideeffect] [mayload] [maystore] [attdialect], $0:[mem:m], killed %1:gr64, 1, $noreg, 24, $noreg, $1:[imm], 1, $2:[imm], blockaddress(@klist_dec_and_del, %ir-block.4), $
3:[clobber], implicit-def dead early-clobber $df, $4:[clobber], implicit-def early-clobber $fpsw, $5:[clobber], implicit-def dead early-clobber $eflags
JMP_1 %bb.2
bb.1 (%ir-block.4, address-taken):
; predecessors: %bb.0
successors: %bb.2(0x80000000); %bb.2(100.00%)
MOV64mi32 killed %0:gr64, 1, $noreg, -24, $noreg, 0 :: (store 8 into %ir.6)
bb.2 (%ir-block.7):
; predecessors: %bb.0, %bb.1
RET 0, undef $eax
then replace the ADD64ri8 with a LEA64r -- but place it _after_ the INLINEASM_BR,
bb.0 (%ir-block.1):
successors: %bb.2(0x80000000), %bb.1(0x00000000); %bb.2(100.00%), %bb.1(0.00%)
liveins: $rdi
%1:gr64 = COPY killed $rdi
- %0:gr64 = nuw ADD64ri8 %1:gr64(tied-def 0), 24, implicit-def dead $eflags
- INLINEASM_BR &"# $0 $1 $2" [sideeffect] [mayload] [maystore] [attdialect], $0:[mem:m], killed %1:gr64, 1, $noreg, 24, $noreg, $1:[imm], 1, $2:[imm], blockaddress(@klist_dec_and_del, %ir-block.4), $3:[clobber], implicit-def dead early-clobber $df, $4:[clobber], implicit-def early-clobber $fpsw, $5:[clobber], implicit-def dead early-clobber $eflags
+ INLINEASM_BR &"# $0 $1 $2" [sideeffect] [mayload] [maystore] [attdialect], $0:[mem:m], %1:gr64, 1, $noreg, 24, $noreg, $1:[imm], 1, $2:[imm], blockaddress(@klist_dec_and_del, %ir-block.4), $3:[clobber], implicit-def dead early-clobber $df, $4:[clobber], implicit-def early-clobber $fpsw, $5:[clobber], implicit-def dead early-clobber $eflags
+ %0:gr64 = LEA64r killed %1:gr64, 1, $noreg, 24, $noreg
JMP_1 %bb.2
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D83523/new/
https://reviews.llvm.org/D83523
More information about the llvm-commits
mailing list