File: postra-sink-subregs.mir

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (33 lines) | stat: -rw-r--r-- 1,130 bytes parent folder | download | duplicates (19)
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
# RUN: llc -march=hexagon -run-pass postra-machine-sink,postrapseudos,if-converter -verify-machineinstrs -o - %s | FileCheck %s

# 1. Post-RA machine sinking moves the copy (1) to block %bb.1. The
#    subregisters $r2 and $r3 of $d1 are not removed from the live-ins.
# 2. Expand post-RA pseudos replaces the COPY with A2_tfrp which is
#    predicable.
# 3. If-conversion predicates block %bb.1. Since $d1 (made of $r2 and $r3)
#    is in the live-in list to %bb.1, it assumes that $d1 in (1) is live,
#    and adds an implicit use of $d1 to the predicated copy.
#    This results in an invalid machine code, since the implicit use
#    refers to an undefined register.

# Make sure that post-RA machine sinking removes subregisters from live-ins
# to block bb.1.

# CHECK: $d1 = A2_tfrpf $p0, $d0
# CHECK-NOT: implicit killed $d1

name: fred
tracksRegLiveness: true
body: |
  bb.0:
    liveins: $d0, $p0
    renamable $d1 = COPY $d0                ;; (1)
    J2_jumpt $p0, %bb.2, implicit-def $pc
  bb.1:
    liveins: $r2, $r3
    $r0 = A2_addi $r2, 1
  bb.2:
    liveins: $r0
    A2_nop
    J2_jumpr $r31, implicit-def $pc
...