Digging a bit further with current gcc-10 branch...
Instrumenting a TLS address splitter in i386.md with some creative printfs:
(define_split [(match_operand 0 "tls_address_pattern")] "TARGET_TLS_DIRECT_SEG_REFS" [(match_dup 0)] { debug_rtx (curr_insn); debug_rtx (operands[0]); printf ("%s\n", GET_RTX_NAME (classify_insn (operands[0]))); operands[0] = ix86_rewrite_tls_address (operands[0]); debug_rtx (operands[0]); printf ("%s\n", GET_RTX_NAME (classify_insn (operands[0]))); })
we get:
(insn 54 51 109 9 (parallel [ (asm_operands/v ("btrl %1,%0") ("") 0 [ (mem/c:BLK (plus:DI (plus:DI (unspec:DI [ (const_int 0 [0]) ] UNSPEC_TP) (reg:DI 100)) (const_int 96 [0x60])) [21 MEM[(struct revectored_struct *)&vm86u + 96B]+0 S32 A32]) (reg:SI 101) ] [ (asm_input:BLK ("m") ../../../src/include/cpu.h:355) (asm_input:SI ("r") ../../../src/include/cpu.h:355) ] [] ../../../src/include/cpu.h:355) (clobber (reg:CC 17 flags)) ]) "../../../src/include/cpu.h":355:2 -1 (expr_list:REG_DEAD (reg:SI 101) (expr_list:REG_DEAD (reg:DI 100) (expr_list:REG_UNUSED (reg:CC 17 flags) (nil))))) (parallel [ (asm_operands/v ("btrl %1,%0") ("") 0 [ (mem/c:BLK (plus:DI (plus:DI (unspec:DI [ (const_int 0 [0]) ] UNSPEC_TP) (reg:DI 100)) (const_int 96 [0x60])) [21 MEM[(struct revectored_struct *)&vm86u + 96B]+0 S32 A32]) (reg:SI 101) ] [ (asm_input:BLK ("m") ../../../src/include/cpu.h:355) (asm_input:SI ("r") ../../../src/include/cpu.h:355) ] [] ../../../src/include/cpu.h:355) (clobber (reg:CC 17 flags)) ]) jump_insn (parallel [ (asm_operands/v ("btrl %1,%0") ("") 0 [ (mem/c:BLK (plus:DI (reg:DI 100) (const_int 96 [0x60])) [21 MEM[(struct revectored_struct *)&vm86u + 96B]+0 S32 A32 AS1]) (reg:SI 101) ] [ (asm_input:BLK ("m") ../../../src/include/cpu.h:355) (asm_input:SI ("r") ../../../src/include/cpu.h:355) ] [] ../../../src/include/cpu.h:355) (clobber (reg:CC 17 flags)) ]) jump_insn
Please note that classify_insn declares the pattern as JUMP_INSN due to:
if (GET_CODE (x) == ASM_OPERANDS && ASM_OPERANDS_LABEL_VEC (x)) return JUMP_INSN;
but no label is defined in asm operands.
Digging a bit further with current gcc-10 branch...
Instrumenting a TLS address splitter in i386.md with some creative printfs:
(define_split pattern" )] TLS_DIRECT_ SEG_REFS" tls_address (operands[0]);
[(match_operand 0 "tls_address_
"TARGET_
[(match_dup 0)]
{
debug_rtx (curr_insn);
debug_rtx (operands[0]);
printf ("%s\n", GET_RTX_NAME (classify_insn (operands[0])));
operands[0] = ix86_rewrite_
debug_rtx (operands[0]);
printf ("%s\n", GET_RTX_NAME (classify_insn (operands[0])));
})
we get:
(insn 54 51 109 9 (parallel [
(asm_ operands/ v ("btrl %1,%0") ("") 0 [
( mem/c:BLK (plus:DI (plus:DI (unspec:DI [
(const_ int 0 [0])
] UNSPEC_TP)
(reg: DI 100))
(const_ int 96 [0x60])) [21 MEM[(struct revectored_struct *)&vm86u + 96B]+0 S32 A32])
( reg:SI 101)
( asm_input: BLK ("m") ../../. ./src/include/ cpu.h:355)
( asm_input: SI ("r") ../../. ./src/include/ cpu.h:355) ./src/include/ cpu.h:355)
(clobber (reg:CC 17 flags)) ../src/ include/ cpu.h": 355:2 -1 list:REG_ DEAD (reg:SI 101)
(expr_ list:REG_ DEAD (reg:DI 100)
(expr_ list:REG_ UNUSED (reg:CC 17 flags)
(nil) ))))
(asm_operands/ v ("btrl %1,%0") ("") 0 [
(mem/ c:BLK (plus:DI (plus:DI (unspec:DI [
(const_ int 0 [0])
] UNSPEC_TP)
(reg:DI 100))
(const_ int 96 [0x60])) [21 MEM[(struct revectored_struct *)&vm86u + 96B]+0 S32 A32])
(reg: SI 101)
(asm_ input:BLK ("m") ../../. ./src/include/ cpu.h:355)
(asm_ input:SI ("r") ../../. ./src/include/ cpu.h:355) ./src/include/ cpu.h:355)
(asm_operands/ v ("btrl %1,%0") ("") 0 [
(mem/ c:BLK (plus:DI (reg:DI 100)
(const_ int 96 [0x60])) [21 MEM[(struct revectored_struct *)&vm86u + 96B]+0 S32 A32 AS1])
(reg: SI 101)
(asm_ input:BLK ("m") ../../. ./src/include/ cpu.h:355)
(asm_ input:SI ("r") ../../. ./src/include/ cpu.h:355) ./src/include/ cpu.h:355)
]
[
]
[] ../../.
]) "../../
(expr_
(parallel [
]
[
]
[] ../../.
(clobber (reg:CC 17 flags))
])
jump_insn
(parallel [
]
[
]
[] ../../.
(clobber (reg:CC 17 flags))
])
jump_insn
Please note that classify_insn declares the pattern as JUMP_INSN due to:
if (GET_CODE (x) == ASM_OPERANDS && ASM_OPERANDS_ LABEL_VEC (x))
return JUMP_INSN;
but no label is defined in asm operands.