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
21 # CHECK: debugValueSubstitutions:
22 # CHECK-NEXT - { srcinst: 1, srcop: 0, dstinst: 2, dstop: 0, subreg: 4 }
23 ## Subreg 4 -> sub_16bit
28 $ax = MOV16rm killed $rax, 1, $noreg, 0, $noreg, debug-instr-number 1
29 ; CHECK: $eax = MOVZX32rm16 killed $rax, {{.*}} debug-instr-number 2
35 # CHECK-LABEL: name: test3
38 tracksRegLiveness: true
41 # CHECK: debugValueSubstitutions:
42 # CHECK-NEXT - { srcinst: 1, srcop: 0, dstinst: 2, dstop: 0, subreg: 4 }
43 ## Subreg 4 -> sub_16bit
46 successors: %bb.1(0x30000000), %bb.2(0x50000000)
49 TEST64rr $rdi, $rdi, implicit-def $eflags
50 JCC_1 %bb.1, 4, implicit $eflags
55 $ax = MOV16rm killed $rdi, 1, $noreg, 0, $noreg, implicit-def $eax, debug-instr-number 1
56 ; CHECK: $eax = MOVZX32rm16 killed $rdi, {{.*}} debug-instr-number 2
57 $ax = KILL $ax, implicit killed $eax
61 $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags
62 $ax = KILL $ax, implicit killed $eax