brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 47860f8 Raw
68 lines · plain
1# RUN: llc -mtriple=x86_64-unknown-linux-gnu -run-pass x86-fixup-bw-insts %s -o - -experimental-debug-variable-locations | FileCheck  %s2#3# This test is a copy of llvm/test/CodeGen/X86/fixup-bw-inst.mir, with a few4# test bodies removed. The pass promotes certain register operations to be5# wider operations (such as loads and sign extensions), which has an instruction6# 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.9#10# Plain copies that get transformed are not tested for, as they should never11# be instrumented. At a high level, copies do not define a value; they move12# them.13 14---15# CHECK-LABEL: name: test116name:            test117alignment:       1618tracksRegLiveness: true19debugInstrRef: true20liveins:21  - { reg: '$rax' }22# CHECK:     debugValueSubstitutions:23# CHECK-NEXT - { srcinst: 1, srcop: 0, dstinst: 2, dstop: 0, subreg: 4 }24## Subreg 4 -> sub_16bit25body:             |26  bb.0:27    liveins: $rax28 29    $ax = MOV16rm killed $rax, 1, $noreg, 0, $noreg, debug-instr-number 130    ; CHECK: $eax = MOVZX32rm16 killed $rax, {{.*}} debug-instr-number 231 32    RET64 $ax33 34...35---36# CHECK-LABEL: name: test337name:            test338alignment:       1639tracksRegLiveness: true40debugInstrRef: true41liveins:42  - { reg: '$rdi' }43# CHECK:     debugValueSubstitutions:44# CHECK-NEXT - { srcinst: 1, srcop: 0, dstinst: 2, dstop: 0, subreg: 4 }45## Subreg 4 -> sub_16bit46body:             |47  bb.0:48    successors: %bb.1(0x30000000), %bb.2(0x50000000)49    liveins: $rdi50 51    TEST64rr $rdi, $rdi, implicit-def $eflags52    JCC_1 %bb.1, 4, implicit $eflags53 54  bb.2:55    liveins: $rdi56 57    $ax = MOV16rm killed $rdi, 1, $noreg, 0, $noreg, implicit-def $eax, debug-instr-number 158    ; CHECK: $eax = MOVZX32rm16 killed $rdi, {{.*}} debug-instr-number 259    $ax = KILL $ax, implicit killed $eax60    RET64 $ax61 62  bb.1:63    $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags64    $ax = KILL $ax, implicit killed $eax65    RET64 $ax66 67...68