File: twoaddr-to-threeaddr-sub.mir

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 1,998,492 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (43 lines) | stat: -rw-r--r-- 1,244 bytes parent folder | download | duplicates (7)
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
# RUN: llc -run-pass=twoaddressinstruction -mtriple=x86_64-- -o - %s -experimental-debug-variable-locations | FileCheck %s
#
# REQUIRES: x86-registered-target
#
# Test that a new instruction (LEA) is created when the two-addr add below is
# converted to three address; and that an appropriate substitution is created.
# Maybe at some point we'll normalise DBG_INSTR_REFs on output, but until then,
# lets not.
#
# CHECK:      debugValueSubstitutions:
# CHECK-NEXT:  - { srcinst: 1, srcop: 0, dstinst: 2, dstop: 0, subreg: 0 }
#
# CHECK:      LEA64_32r
# CHECK-SAME: debug-instr-number 2
#
# CHECK:      DBG_INSTR_REF dbg-instr-ref(1, 0)
---
name:            test1
alignment:       16
tracksRegLiveness: true
debugInstrRef: true
registers:
  - { id: 0, class: gr32 }
  - { id: 1, class: gr32 }
  - { id: 2, class: gr32 }
liveins:
  - { reg: '$edi', virtual-reg: '%0' }
frameInfo:
  maxAlignment:    1
machineFunctionInfo: {}
body:             |
  bb.0:
    liveins: $edi

    %0:gr32 = COPY killed $edi
    %1:gr32 = SHL32ri killed %0, 5, implicit-def dead $eflags
    %2:gr32 = ADD32ri_DB killed %1, 3, implicit-def dead $eflags, debug-instr-number 1
    DBG_INSTR_REF dbg-instr-ref(1, 0)
    $eax = COPY killed %2
    RET 0, killed $eax

...