File: x86-fixup-bw-inst-subreb.mir

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (65 lines) | stat: -rw-r--r-- 2,073 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# RUN: llc -mtriple=x86_64-unknown-linux-gnu -run-pass x86-fixup-bw-insts %s -o - -experimental-debug-variable-locations | FileCheck  %s
#
# This test is a copy of llvm/test/CodeGen/X86/fixup-bw-inst.mir, with a few
# test bodies removed. The pass promotes certain register operations to be
# wider operations (such as loads and sign extensions), which has an instruction
# encoding benefit. New instructions are created, and so should have a debug 
# instruction number substitution; but in addition a qualifiying subregister,
# because the newly def'd register is a different size to the old one.
#
# Plain copies that get transformed are not tested for, as they should never
# be instrumented. At a high level, copies do not define a value; they move
# them.

---
# CHECK-LABEL: name: test1
name:            test1
alignment:       16
tracksRegLiveness: true
liveins:
  - { reg: '$rax' }
# CHECK:     debugValueSubstitutions:
# CHECK-NEXT - { srcinst: 1, srcop: 0, dstinst: 2, dstop: 0, subreg: 4 }
## Subreg 4 -> sub_16bit
body:             |
  bb.0:
    liveins: $rax

    $ax = MOV16rm killed $rax, 1, $noreg, 0, $noreg, debug-instr-number 1
    ; CHECK: $eax = MOVZX32rm16 killed $rax, {{.*}} debug-instr-number 2

    RET64 $ax

...
---
# CHECK-LABEL: name: test3
name:            test3
alignment:       16
tracksRegLiveness: true
liveins:
  - { reg: '$rdi' }
# CHECK:     debugValueSubstitutions:
# CHECK-NEXT - { srcinst: 1, srcop: 0, dstinst: 2, dstop: 0, subreg: 4 }
## Subreg 4 -> sub_16bit
body:             |
  bb.0:
    successors: %bb.1(0x30000000), %bb.2(0x50000000)
    liveins: $rdi

    TEST64rr $rdi, $rdi, implicit-def $eflags
    JCC_1 %bb.1, 4, implicit $eflags

  bb.2:
    liveins: $rdi

    $ax = MOV16rm killed $rdi, 1, $noreg, 0, $noreg, implicit-def $eax, debug-instr-number 1
    ; CHECK: $eax = MOVZX32rm16 killed $rdi, {{.*}} debug-instr-number 2
    $ax = KILL $ax, implicit killed $eax
    RET64 $ax

  bb.1:
    $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags
    $ax = KILL $ax, implicit killed $eax
    RET64 $ax

...