Skip to content

Commit 5cc0d17

Browse files
joe-imgpradt2
authored andcommitted
[CodeGen] Clear InitUndef pass new register cache between pass runs (llvm#90967)
Multiple invocations of the pass could interfere with eachother, preventing some undefs being initialised. I found it very difficult to create a unit test for this due to it being dependent on particular allocations of a previous function. However, the bug can be observed here: https://godbolt.org/z/7xnMo41Gv with the creation of the illegal instruction `vnsrl.wi v9, v8, 0`
1 parent e15fdf9 commit 5cc0d17

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

llvm/test/CodeGen/RISCV/rvv/fixed-vectors-buildvec-of-binop.ll

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -565,18 +565,17 @@ define <8 x i32> @add_constant_rhs_8xi32_partial(<8 x i32> %vin, i32 %a, i32 %b,
565565
; CHECK-NEXT: vmv.s.x v12, a1
566566
; CHECK-NEXT: vslideup.vi v8, v10, 4
567567
; CHECK-NEXT: vmv.s.x v10, a2
568+
; CHECK-NEXT: vsetivli zero, 7, e32, m2, tu, ma
569+
; CHECK-NEXT: vslideup.vi v8, v10, 6
568570
; CHECK-NEXT: lui a0, %hi(.LCPI19_0)
569571
; CHECK-NEXT: addi a0, a0, %lo(.LCPI19_0)
570572
; CHECK-NEXT: vsetivli zero, 6, e32, m2, tu, ma
571573
; CHECK-NEXT: vslideup.vi v8, v12, 5
572574
; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
573-
; CHECK-NEXT: vle32.v v12, (a0)
574-
; CHECK-NEXT: vsetivli zero, 7, e32, m2, tu, ma
575-
; CHECK-NEXT: vslideup.vi v8, v10, 6
576-
; CHECK-NEXT: vmv.s.x v10, a3
577-
; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
578-
; CHECK-NEXT: vslideup.vi v8, v10, 7
579-
; CHECK-NEXT: vadd.vv v8, v8, v12
575+
; CHECK-NEXT: vle32.v v10, (a0)
576+
; CHECK-NEXT: vmv.s.x v12, a3
577+
; CHECK-NEXT: vslideup.vi v8, v12, 7
578+
; CHECK-NEXT: vadd.vv v8, v8, v10
580579
; CHECK-NEXT: ret
581580
%vadd = add <8 x i32> %vin, <i32 1, i32 2, i32 3, i32 5, i32 undef, i32 undef, i32 undef, i32 undef>
582581
%e0 = add i32 %a, 23

0 commit comments

Comments
 (0)