File: regalloc-last-chance-recoloring-failure.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (154 lines) | stat: -rw-r--r-- 8,890 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=riscv64 -mattr=+f,+m,+zfh,+zvfh \
; RUN:   -enable-subreg-liveness=false < %s | FileCheck %s
; RUN: llc -mtriple=riscv64 -mattr=+f,+m,+zfh,+zvfh < %s \
; RUN:   -enable-subreg-liveness=true| FileCheck %s --check-prefix=SUBREGLIVENESS

; This testcase failed to compile after
; c46aab01c002b7a04135b8b7f1f52d8c9ae23a58, which was reverted.

; FIXME: The failure does not reproduce with -stop-before=greedy
; output MIR with -start-before=greedy

define void @last_chance_recoloring_failure() {
; CHECK-LABEL: last_chance_recoloring_failure:
; CHECK:       # %bb.0: # %entry
; CHECK-NEXT:    addi sp, sp, -32
; CHECK-NEXT:    .cfi_def_cfa_offset 32
; CHECK-NEXT:    sd ra, 24(sp) # 8-byte Folded Spill
; CHECK-NEXT:    sd s0, 16(sp) # 8-byte Folded Spill
; CHECK-NEXT:    .cfi_offset ra, -8
; CHECK-NEXT:    .cfi_offset s0, -16
; CHECK-NEXT:    csrr a0, vlenb
; CHECK-NEXT:    slli a0, a0, 4
; CHECK-NEXT:    sub sp, sp, a0
; CHECK-NEXT:    .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x20, 0x22, 0x11, 0x10, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 32 + 16 * vlenb
; CHECK-NEXT:    li a0, 55
; CHECK-NEXT:    vsetvli a2, zero, e8, m2, ta, ma
; CHECK-NEXT:    vmclr.m v0
; CHECK-NEXT:    vsetvli zero, a0, e16, m4, ta, ma
; CHECK-NEXT:    vloxseg2ei32.v v16, (a1), v8
; CHECK-NEXT:    csrr a0, vlenb
; CHECK-NEXT:    slli a0, a0, 3
; CHECK-NEXT:    add a0, sp, a0
; CHECK-NEXT:    addi a0, a0, 16
; CHECK-NEXT:    csrr a1, vlenb
; CHECK-NEXT:    slli a1, a1, 2
; CHECK-NEXT:    vs4r.v v16, (a0) # Unknown-size Folded Spill
; CHECK-NEXT:    add a0, a0, a1
; CHECK-NEXT:    vs4r.v v20, (a0) # Unknown-size Folded Spill
; CHECK-NEXT:    li s0, 36
; CHECK-NEXT:    vsetvli zero, s0, e16, m4, ta, ma
; CHECK-NEXT:    vfwadd.vv v16, v8, v12, v0.t
; CHECK-NEXT:    addi a0, sp, 16
; CHECK-NEXT:    vs8r.v v16, (a0) # Unknown-size Folded Spill
; CHECK-NEXT:    call func
; CHECK-NEXT:    csrr a0, vlenb
; CHECK-NEXT:    slli a0, a0, 3
; CHECK-NEXT:    add a0, sp, a0
; CHECK-NEXT:    addi a0, a0, 16
; CHECK-NEXT:    csrr a1, vlenb
; CHECK-NEXT:    slli a1, a1, 2
; CHECK-NEXT:    vl4r.v v16, (a0) # Unknown-size Folded Reload
; CHECK-NEXT:    add a0, a0, a1
; CHECK-NEXT:    vl4r.v v20, (a0) # Unknown-size Folded Reload
; CHECK-NEXT:    addi a0, sp, 16
; CHECK-NEXT:    vl8r.v v24, (a0) # Unknown-size Folded Reload
; CHECK-NEXT:    vsetvli zero, s0, e16, m4, ta, ma
; CHECK-NEXT:    vfwsub.wv v8, v24, v16
; CHECK-NEXT:    vsetvli zero, zero, e32, m8, tu, mu
; CHECK-NEXT:    vfdiv.vv v8, v24, v8, v0.t
; CHECK-NEXT:    vse32.v v8, (a0)
; CHECK-NEXT:    csrr a0, vlenb
; CHECK-NEXT:    slli a0, a0, 4
; CHECK-NEXT:    add sp, sp, a0
; CHECK-NEXT:    .cfi_def_cfa sp, 32
; CHECK-NEXT:    ld ra, 24(sp) # 8-byte Folded Reload
; CHECK-NEXT:    ld s0, 16(sp) # 8-byte Folded Reload
; CHECK-NEXT:    .cfi_restore ra
; CHECK-NEXT:    .cfi_restore s0
; CHECK-NEXT:    addi sp, sp, 32
; CHECK-NEXT:    .cfi_def_cfa_offset 0
; CHECK-NEXT:    ret
;
; SUBREGLIVENESS-LABEL: last_chance_recoloring_failure:
; SUBREGLIVENESS:       # %bb.0: # %entry
; SUBREGLIVENESS-NEXT:    addi sp, sp, -32
; SUBREGLIVENESS-NEXT:    .cfi_def_cfa_offset 32
; SUBREGLIVENESS-NEXT:    sd ra, 24(sp) # 8-byte Folded Spill
; SUBREGLIVENESS-NEXT:    sd s0, 16(sp) # 8-byte Folded Spill
; SUBREGLIVENESS-NEXT:    .cfi_offset ra, -8
; SUBREGLIVENESS-NEXT:    .cfi_offset s0, -16
; SUBREGLIVENESS-NEXT:    csrr a0, vlenb
; SUBREGLIVENESS-NEXT:    slli a0, a0, 4
; SUBREGLIVENESS-NEXT:    sub sp, sp, a0
; SUBREGLIVENESS-NEXT:    .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x20, 0x22, 0x11, 0x10, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 32 + 16 * vlenb
; SUBREGLIVENESS-NEXT:    li a0, 55
; SUBREGLIVENESS-NEXT:    vsetvli a2, zero, e8, m2, ta, ma
; SUBREGLIVENESS-NEXT:    vmclr.m v0
; SUBREGLIVENESS-NEXT:    vsetvli zero, a0, e16, m4, ta, ma
; SUBREGLIVENESS-NEXT:    vloxseg2ei32.v v16, (a1), v8
; SUBREGLIVENESS-NEXT:    csrr a0, vlenb
; SUBREGLIVENESS-NEXT:    slli a0, a0, 3
; SUBREGLIVENESS-NEXT:    add a0, sp, a0
; SUBREGLIVENESS-NEXT:    addi a0, a0, 16
; SUBREGLIVENESS-NEXT:    csrr a1, vlenb
; SUBREGLIVENESS-NEXT:    slli a1, a1, 2
; SUBREGLIVENESS-NEXT:    vs4r.v v16, (a0) # Unknown-size Folded Spill
; SUBREGLIVENESS-NEXT:    add a0, a0, a1
; SUBREGLIVENESS-NEXT:    vs4r.v v20, (a0) # Unknown-size Folded Spill
; SUBREGLIVENESS-NEXT:    li s0, 36
; SUBREGLIVENESS-NEXT:    vsetvli zero, s0, e16, m4, ta, ma
; SUBREGLIVENESS-NEXT:    vfwadd.vv v16, v8, v12, v0.t
; SUBREGLIVENESS-NEXT:    addi a0, sp, 16
; SUBREGLIVENESS-NEXT:    vs8r.v v16, (a0) # Unknown-size Folded Spill
; SUBREGLIVENESS-NEXT:    call func
; SUBREGLIVENESS-NEXT:    csrr a0, vlenb
; SUBREGLIVENESS-NEXT:    slli a0, a0, 3
; SUBREGLIVENESS-NEXT:    add a0, sp, a0
; SUBREGLIVENESS-NEXT:    addi a0, a0, 16
; SUBREGLIVENESS-NEXT:    csrr a1, vlenb
; SUBREGLIVENESS-NEXT:    slli a1, a1, 2
; SUBREGLIVENESS-NEXT:    vl4r.v v16, (a0) # Unknown-size Folded Reload
; SUBREGLIVENESS-NEXT:    add a0, a0, a1
; SUBREGLIVENESS-NEXT:    vl4r.v v20, (a0) # Unknown-size Folded Reload
; SUBREGLIVENESS-NEXT:    addi a0, sp, 16
; SUBREGLIVENESS-NEXT:    vl8r.v v24, (a0) # Unknown-size Folded Reload
; SUBREGLIVENESS-NEXT:    vsetvli zero, s0, e16, m4, ta, ma
; SUBREGLIVENESS-NEXT:    vfwsub.wv v8, v24, v16
; SUBREGLIVENESS-NEXT:    vsetvli zero, zero, e32, m8, tu, mu
; SUBREGLIVENESS-NEXT:    vfdiv.vv v8, v24, v8, v0.t
; SUBREGLIVENESS-NEXT:    vse32.v v8, (a0)
; SUBREGLIVENESS-NEXT:    csrr a0, vlenb
; SUBREGLIVENESS-NEXT:    slli a0, a0, 4
; SUBREGLIVENESS-NEXT:    add sp, sp, a0
; SUBREGLIVENESS-NEXT:    .cfi_def_cfa sp, 32
; SUBREGLIVENESS-NEXT:    ld ra, 24(sp) # 8-byte Folded Reload
; SUBREGLIVENESS-NEXT:    ld s0, 16(sp) # 8-byte Folded Reload
; SUBREGLIVENESS-NEXT:    .cfi_restore ra
; SUBREGLIVENESS-NEXT:    .cfi_restore s0
; SUBREGLIVENESS-NEXT:    addi sp, sp, 32
; SUBREGLIVENESS-NEXT:    .cfi_def_cfa_offset 0
; SUBREGLIVENESS-NEXT:    ret
entry:
  %i = call target("riscv.vector.tuple", <vscale x 32 x i8>, 2) @llvm.riscv.vloxseg2.nxv16f16.nxv16i32.i64(target("riscv.vector.tuple", <vscale x 32 x i8>, 2) undef, ptr nonnull poison, <vscale x 16 x i32> poison, i64 55, i64 4)
  %i1 = tail call <vscale x 16 x half> @llvm.riscv.tuple.extract.v16f16.triscv.vector.tuple_nxv32i8_2t(target("riscv.vector.tuple", <vscale x 32 x i8>, 2) %i, i32 0)
  %i2 = call <vscale x 16 x float> @llvm.riscv.vfwadd.mask.nxv16f32.nxv16f16.nxv16f16.i64(<vscale x 16 x float> poison, <vscale x 16 x half> poison, <vscale x 16 x half> poison, <vscale x 16 x i1> zeroinitializer, i64 7, i64 36, i64 0)
  call void @func()
  %i3 = call <vscale x 16 x i16> @llvm.riscv.vrgather.vv.mask.nxv16i16.i64(<vscale x 16 x i16> poison, <vscale x 16 x i16> poison, <vscale x 16 x i16> poison, <vscale x 16 x i1> poison, i64 32, i64 0)
  %i4 = call <vscale x 16 x float> @llvm.riscv.vfwsub.w.nxv16f32.nxv16f16.i64(<vscale x 16 x float> poison, <vscale x 16 x float> %i2, <vscale x 16 x half> %i1, i64 7, i64 36)
  %i5 = call <vscale x 16 x i16> @llvm.riscv.vssubu.mask.nxv16i16.nxv16i16.i64(<vscale x 16 x i16> %i3, <vscale x 16 x i16> %i3, <vscale x 16 x i16> poison, <vscale x 16 x i1> poison, i64 32, i64 0)
  %i6 = call <vscale x 16 x float> @llvm.riscv.vfdiv.mask.nxv16f32.nxv16f32.i64(<vscale x 16 x float> %i4, <vscale x 16 x float> %i2, <vscale x 16 x float> poison, <vscale x 16 x i1> poison, i64 7, i64 36, i64 0)
  call void @llvm.riscv.vse.nxv16f32.i64(<vscale x 16 x float> %i6, ptr nonnull poison, i64 36)
  ret void
}

declare void @func()
declare target("riscv.vector.tuple", <vscale x 32 x i8>, 2) @llvm.riscv.vloxseg2.nxv16f16.nxv16i32.i64(target("riscv.vector.tuple", <vscale x 32 x i8>, 2), ptr nocapture, <vscale x 16 x i32>, i64, i64)
declare <vscale x 16 x half> @llvm.riscv.tuple.extract.v16f16.triscv.vector.tuple_nxv32i8_2t(target("riscv.vector.tuple", <vscale x 32 x i8>, 2), i32)
declare <vscale x 16 x float> @llvm.riscv.vfwadd.mask.nxv16f32.nxv16f16.nxv16f16.i64(<vscale x 16 x float>, <vscale x 16 x half>, <vscale x 16 x half>, <vscale x 16 x i1>, i64, i64, i64 immarg)
declare <vscale x 16 x i16> @llvm.riscv.vrgather.vv.mask.nxv16i16.i64(<vscale x 16 x i16>, <vscale x 16 x i16>, <vscale x 16 x i16>, <vscale x 16 x i1>, i64, i64 immarg)
declare <vscale x 16 x float> @llvm.riscv.vfwsub.w.nxv16f32.nxv16f16.i64(<vscale x 16 x float>, <vscale x 16 x float>, <vscale x 16 x half>, i64, i64)
declare <vscale x 16 x i16> @llvm.riscv.vssubu.mask.nxv16i16.nxv16i16.i64(<vscale x 16 x i16>, <vscale x 16 x i16>, <vscale x 16 x i16>, <vscale x 16 x i1>, i64, i64 immarg)
declare <vscale x 16 x float> @llvm.riscv.vfdiv.mask.nxv16f32.nxv16f32.i64(<vscale x 16 x float>, <vscale x 16 x float>, <vscale x 16 x float>, <vscale x 16 x i1>, i64, i64, i64 immarg)
declare void @llvm.riscv.vse.nxv16f32.i64(<vscale x 16 x float>, ptr nocapture, i64) #3