File: twoaddr-to-threeaddr-sub.mir

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,696 kB
  • sloc: cpp: 7,438,781; ansic: 1,393,871; asm: 1,012,926; python: 241,771; f90: 86,635; objc: 75,411; lisp: 42,144; pascal: 17,286; sh: 8,596; ml: 5,082; perl: 4,730; makefile: 3,591; awk: 3,523; javascript: 2,251; xml: 892; fortran: 672
file content (43 lines) | stat: -rw-r--r-- 1,244 bytes parent folder | download | duplicates (10)
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

...