File: twoaddr-to-threeaddr-sub.mir

package info (click to toggle)
llvm-toolchain-16 1%3A16.0.6-15~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,634,792 kB
  • sloc: cpp: 6,179,261; ansic: 1,216,205; asm: 741,319; python: 196,614; objc: 75,325; f90: 49,640; lisp: 32,396; pascal: 12,286; sh: 9,394; perl: 7,442; ml: 5,494; awk: 3,523; makefile: 2,723; javascript: 1,206; xml: 886; fortran: 581; cs: 573
file content (43 lines) | stat: -rw-r--r-- 1,247 bytes parent folder | download | duplicates (2)
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 = ADD32ri8_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

...