1 # RUN: llc -mtriple=x86_64-unknown-linux-gnu -run-pass x86-fixup-bw-insts %s -o - -experimental-debug-variable-locations | FileCheck %s
3 # This test is a copy of llvm/test/CodeGen/X86/fixup-bw-inst.mir, with a few
4 # test bodies removed. The pass promotes certain register operations to be
5 # wider operations (such as loads and sign extensions), which has an instruction
6 # encoding benefit. New instructions are created, and so should have a debug
7 # instruction number substitution; but in addition a qualifiying subregister,
8 # because the newly def'd register is a different size to the old one.
10 # Plain copies that get transformed are not tested for, as they should never
11 # be instrumented. At a high level, copies do not define a value; they move
15 # CHECK-LABEL: name: test1
18 tracksRegLiveness: true
22 # CHECK: debugValueSubstitutions:
23 # CHECK-NEXT - { srcinst: 1, srcop: 0, dstinst: 2, dstop: 0, subreg: 4 }
24 ## Subreg 4 -> sub_16bit
29 $ax = MOV16rm killed $rax, 1, $noreg, 0, $noreg, debug-instr-number 1
30 ; CHECK: $eax = MOVZX32rm16 killed $rax, {{.*}} debug-instr-number 2
36 # CHECK-LABEL: name: test3
39 tracksRegLiveness: true
43 # CHECK: debugValueSubstitutions:
44 # CHECK-NEXT - { srcinst: 1, srcop: 0, dstinst: 2, dstop: 0, subreg: 4 }
45 ## Subreg 4 -> sub_16bit
48 successors: %bb.1(0x30000000), %bb.2(0x50000000)
51 TEST64rr $rdi, $rdi, implicit-def $eflags
52 JCC_1 %bb.1, 4, implicit $eflags
57 $ax = MOV16rm killed $rdi, 1, $noreg, 0, $noreg, implicit-def $eax, debug-instr-number 1
58 ; CHECK: $eax = MOVZX32rm16 killed $rdi, {{.*}} debug-instr-number 2
59 $ax = KILL $ax, implicit killed $eax
63 $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags
64 $ax = KILL $ax, implicit killed $eax