You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[InstCombine] add scalable vector test for logical select; NFC
D124997 shows that the code is not ready to handle scalable vectors,
so add some more coverage for a potential crashing case.
(cherry picked from commit 7bad1d2)
Copy file name to clipboardExpand all lines: llvm/test/Transforms/InstCombine/logical-select.ll
+19Lines changed: 19 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -708,6 +708,25 @@ define <2 x i64> @bitcast_vec_cond(<16 x i1> %cond, <2 x i64> %c, <2 x i64> %d)
708
708
ret <2 x i64> %r
709
709
}
710
710
711
+
define <vscale x 2 x i64> @bitcast_vec_condi_scalable(<vscale x 16 x i1> %cond, <vscale x 2 x i64> %c, <vscale x 2 x i64> %d) {
712
+
; CHECK-LABEL: @bitcast_vec_condi_scalable(
713
+
; CHECK-NEXT: [[S:%.*]] = sext <vscale x 16 x i1> [[COND:%.*]] to <vscale x 16 x i8>
714
+
; CHECK-NEXT: [[T9:%.*]] = bitcast <vscale x 16 x i8> [[S]] to <vscale x 2 x i64>
715
+
; CHECK-NEXT: [[NOTT9:%.*]] = xor <vscale x 2 x i64> [[T9]], shufflevector (<vscale x 2 x i64> insertelement (<vscale x 2 x i64> poison, i64 -1, i32 0), <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer)
716
+
; CHECK-NEXT: [[T11:%.*]] = and <vscale x 2 x i64> [[NOTT9]], [[C:%.*]]
717
+
; CHECK-NEXT: [[T12:%.*]] = and <vscale x 2 x i64> [[T9]], [[D:%.*]]
718
+
; CHECK-NEXT: [[R:%.*]] = or <vscale x 2 x i64> [[T11]], [[T12]]
719
+
; CHECK-NEXT: ret <vscale x 2 x i64> [[R]]
720
+
;
721
+
%s = sext <vscale x 16 x i1> %condto <vscale x 16 x i8>
722
+
%t9 = bitcast <vscale x 16 x i8> %sto <vscale x 2 x i64>
723
+
%nott9 = xor <vscale x 2 x i64> %t9, shufflevector (<vscale x 2 x i64> insertelement (<vscale x 2 x i64> poison, i64 -1, i320), <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer)
724
+
%t11 = and <vscale x 2 x i64> %nott9, %c
725
+
%t12 = and <vscale x 2 x i64> %t9, %d
726
+
%r = or <vscale x 2 x i64> %t11, %t12
727
+
ret <vscale x 2 x i64> %r
728
+
}
729
+
711
730
; Negative test - bitcast of condition from wide source element type cannot be converted to select.
712
731
713
732
define <8 x i3> @bitcast_vec_cond_commute1(<3 x i1> %cond, <8 x i3> %pc, <8 x i3> %d) {
0 commit comments