File: twoaddr-to-threeaddr-sub.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 (42 lines) | stat: -rw-r--r-- 1,195 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
# 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 1, 0
---
name:            test1
alignment:       16
tracksRegLiveness: 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 1, 0
    $eax = COPY killed %2
    RET 0, killed $eax

...