In GCC there is one useful option -dp (or -dP for more verbose output)
to annotate assembler with instruction patterns, that was used when
assembler was generated. For example:
Now I may look into config/i386/i386.md, and look for mentioned
*pushdi2_rex64, movdi_1_rex64, floatdidf2_sse_interunit and other
patterns and study how they work.
How to make the same annotation for clang output assembler code?
test:
.Leh_func_begin1:
pushq %rbp # ??? what insn in X86InstrInfo.td?
.Llabel1:
movq %rsp, %rbp # ??? what insn in X86InstrInfo.td?
.Llabel2:
movq %rdi, -16(%rbp) # ??? what insn in X86InstrInfo.td?
movq -16(%rbp), %rax # ??? what insn in X86InstrInfo.td?
cvtsi2sdq %rax, %xmm0 # ??? what insn in X86InstrInfo.td?
movsd %xmm0, -8(%rbp) # ??? what insn in X86InstrInfo.td?
movsd -8(%rbp), %xmm0 # ??? what insn in X86InstrInfo.td?
popq %rbp # ??? what insn in X86InstrInfo.td?
ret
In GCC there is one useful option -dp (or -dP for more verbose output)
to annotate assembler with instruction patterns, that was used when
assembler was generated. For example:
The internal "-mllvm -show-mc-inst" option is probably as close as you can get.