@@ -29,7 +29,7 @@ define void @drop_scalar_nuw_nsw(ptr noalias nocapture readonly %input, ptr %out
2929; CHECK: [[VECTOR_BODY]]:
3030; CHECK-NEXT: [[TMP0:%.*]] = getelementptr float, ptr [[INPUT]], i64 -1
3131; CHECK-NEXT: [[WIDE_MASKED_LOAD:%.*]] = call <4 x float> @llvm.masked.load.v4f32.p0(ptr [[TMP0]], i32 4, <4 x i1> <i1 false, i1 true, i1 true, i1 true>, <4 x float> poison), !invariant.load [[META0:![0-9]+]]
32- ; CHECK-NEXT: [[PREDPHI:%.*]] = select <4 x i1> <i1 true , i1 false , i1 false , i1 false >, <4 x float> zeroinitializer , <4 x float> [[WIDE_MASKED_LOAD]]
32+ ; CHECK-NEXT: [[PREDPHI:%.*]] = select <4 x i1> <i1 false , i1 true , i1 true , i1 true >, <4 x float> [[WIDE_MASKED_LOAD]] , <4 x float> zeroinitializer
3333; CHECK-NEXT: store <4 x float> [[PREDPHI]], ptr [[OUTPUT]], align 4
3434; CHECK-NEXT: br label %[[MIDDLE_BLOCK:.*]]
3535; CHECK: [[MIDDLE_BLOCK]]:
@@ -71,7 +71,7 @@ define void @drop_scalar_gep_nusw(ptr noalias nocapture readonly %input, ptr %ou
7171; CHECK: [[VECTOR_BODY]]:
7272; CHECK-NEXT: [[TMP0:%.*]] = getelementptr float, ptr [[INPUT]], i64 -1
7373; CHECK-NEXT: [[WIDE_MASKED_LOAD:%.*]] = call <4 x float> @llvm.masked.load.v4f32.p0(ptr [[TMP0]], i32 4, <4 x i1> <i1 false, i1 true, i1 true, i1 true>, <4 x float> poison), !invariant.load [[META0]]
74- ; CHECK-NEXT: [[PREDPHI:%.*]] = select <4 x i1> <i1 true , i1 false , i1 false , i1 false >, <4 x float> zeroinitializer , <4 x float> [[WIDE_MASKED_LOAD]]
74+ ; CHECK-NEXT: [[PREDPHI:%.*]] = select <4 x i1> <i1 false , i1 true , i1 true , i1 true >, <4 x float> [[WIDE_MASKED_LOAD]] , <4 x float> zeroinitializer
7575; CHECK-NEXT: store <4 x float> [[PREDPHI]], ptr [[OUTPUT]], align 4
7676; CHECK-NEXT: br label %[[MIDDLE_BLOCK:.*]]
7777; CHECK: [[MIDDLE_BLOCK]]:
@@ -113,7 +113,7 @@ define void @drop_scalar_gep_nuw(ptr noalias nocapture readonly %input, ptr %out
113113; CHECK: [[VECTOR_BODY]]:
114114; CHECK-NEXT: [[TMP0:%.*]] = getelementptr float, ptr [[INPUT]], i64 -1
115115; CHECK-NEXT: [[WIDE_MASKED_LOAD:%.*]] = call <4 x float> @llvm.masked.load.v4f32.p0(ptr [[TMP0]], i32 4, <4 x i1> <i1 false, i1 true, i1 true, i1 true>, <4 x float> poison), !invariant.load [[META0]]
116- ; CHECK-NEXT: [[PREDPHI:%.*]] = select <4 x i1> <i1 true , i1 false , i1 false , i1 false >, <4 x float> zeroinitializer , <4 x float> [[WIDE_MASKED_LOAD]]
116+ ; CHECK-NEXT: [[PREDPHI:%.*]] = select <4 x i1> <i1 false , i1 true , i1 true , i1 true >, <4 x float> [[WIDE_MASKED_LOAD]] , <4 x float> zeroinitializer
117117; CHECK-NEXT: store <4 x float> [[PREDPHI]], ptr [[OUTPUT]], align 4
118118; CHECK-NEXT: br label %[[MIDDLE_BLOCK:.*]]
119119; CHECK: [[MIDDLE_BLOCK]]:
@@ -156,7 +156,7 @@ define void @drop_nonpred_scalar_nuw_nsw(ptr noalias nocapture readonly %input,
156156; CHECK: [[VECTOR_BODY]]:
157157; CHECK-NEXT: [[TMP0:%.*]] = getelementptr float, ptr [[INPUT]], i64 -1
158158; CHECK-NEXT: [[WIDE_MASKED_LOAD:%.*]] = call <4 x float> @llvm.masked.load.v4f32.p0(ptr [[TMP0]], i32 4, <4 x i1> <i1 false, i1 true, i1 true, i1 true>, <4 x float> poison), !invariant.load [[META0]]
159- ; CHECK-NEXT: [[PREDPHI:%.*]] = select <4 x i1> <i1 true , i1 false , i1 false , i1 false >, <4 x float> zeroinitializer , <4 x float> [[WIDE_MASKED_LOAD]]
159+ ; CHECK-NEXT: [[PREDPHI:%.*]] = select <4 x i1> <i1 false , i1 true , i1 true , i1 true >, <4 x float> [[WIDE_MASKED_LOAD]] , <4 x float> zeroinitializer
160160; CHECK-NEXT: store <4 x float> [[PREDPHI]], ptr [[OUTPUT]], align 4
161161; CHECK-NEXT: br label %[[MIDDLE_BLOCK:.*]]
162162; CHECK: [[MIDDLE_BLOCK]]:
@@ -198,7 +198,7 @@ define void @preserve_vector_nuw_nsw(ptr noalias nocapture readonly %input, ptr
198198; CHECK: [[VECTOR_BODY]]:
199199; CHECK-NEXT: [[TMP0:%.*]] = getelementptr inbounds float, ptr [[INPUT]], <4 x i64> <i64 -2, i64 0, i64 2, i64 4>
200200; CHECK-NEXT: [[WIDE_MASKED_GATHER:%.*]] = call <4 x float> @llvm.masked.gather.v4f32.v4p0(<4 x ptr> [[TMP0]], i32 4, <4 x i1> <i1 false, i1 true, i1 true, i1 true>, <4 x float> poison), !invariant.load [[META0]]
201- ; CHECK-NEXT: [[PREDPHI:%.*]] = select <4 x i1> <i1 true , i1 false , i1 false , i1 false >, <4 x float> zeroinitializer , <4 x float> [[WIDE_MASKED_GATHER]]
201+ ; CHECK-NEXT: [[PREDPHI:%.*]] = select <4 x i1> <i1 false , i1 true , i1 true , i1 true >, <4 x float> [[WIDE_MASKED_GATHER]] , <4 x float> zeroinitializer
202202; CHECK-NEXT: store <4 x float> [[PREDPHI]], ptr [[OUTPUT]], align 4
203203; CHECK-NEXT: br label %[[MIDDLE_BLOCK:.*]]
204204; CHECK: [[MIDDLE_BLOCK]]:
@@ -243,7 +243,7 @@ define void @drop_vector_nuw_nsw(ptr noalias nocapture readonly %input, ptr %out
243243; CHECK-NEXT: store <4 x ptr> [[TMP3]], ptr [[PTRS]], align 8
244244; CHECK-NEXT: [[TMP6:%.*]] = extractelement <4 x ptr> [[TMP3]], i32 0
245245; CHECK-NEXT: [[WIDE_MASKED_LOAD:%.*]] = call <4 x float> @llvm.masked.load.v4f32.p0(ptr [[TMP6]], i32 4, <4 x i1> <i1 false, i1 true, i1 true, i1 true>, <4 x float> poison), !invariant.load [[META0]]
246- ; CHECK-NEXT: [[PREDPHI:%.*]] = select <4 x i1> <i1 true , i1 false , i1 false , i1 false >, <4 x float> zeroinitializer , <4 x float> [[WIDE_MASKED_LOAD]]
246+ ; CHECK-NEXT: [[PREDPHI:%.*]] = select <4 x i1> <i1 false , i1 true , i1 true , i1 true >, <4 x float> [[WIDE_MASKED_LOAD]] , <4 x float> zeroinitializer
247247; CHECK-NEXT: store <4 x float> [[PREDPHI]], ptr [[OUTPUT]], align 4
248248; CHECK-NEXT: br label %[[MIDDLE_BLOCK:.*]]
249249; CHECK: [[MIDDLE_BLOCK]]:
@@ -302,7 +302,7 @@ define void @drop_nonvector_nuw_nsw_avx1(ptr noalias nocapture readonly %input,
302302; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x ptr> [[TMP16]], ptr [[TMP13]], i32 3
303303; CHECK-NEXT: store <4 x ptr> [[TMP17]], ptr [[TMP5]], align 8
304304; CHECK-NEXT: [[WIDE_MASKED_LOAD:%.*]] = call <4 x float> @llvm.masked.load.v4f32.p0(ptr [[TMP10]], i32 4, <4 x i1> <i1 false, i1 true, i1 true, i1 true>, <4 x float> poison), !invariant.load [[META0]]
305- ; CHECK-NEXT: [[PREDPHI:%.*]] = select <4 x i1> <i1 true , i1 false , i1 false , i1 false >, <4 x float> zeroinitializer , <4 x float> [[WIDE_MASKED_LOAD]]
305+ ; CHECK-NEXT: [[PREDPHI:%.*]] = select <4 x i1> <i1 false , i1 true , i1 true , i1 true >, <4 x float> [[WIDE_MASKED_LOAD]] , <4 x float> zeroinitializer
306306; CHECK-NEXT: [[TMP21:%.*]] = getelementptr inbounds float, ptr [[OUTPUT]], i64 0
307307; CHECK-NEXT: store <4 x float> [[PREDPHI]], ptr [[TMP21]], align 4
308308; CHECK-NEXT: br label %[[MIDDLE_BLOCK:.*]]
@@ -619,8 +619,7 @@ define void @pr70590_recipe_without_underlying_instr(i64 %n, ptr noalias %dst) {
619619; CHECK-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <4 x i64> [[BROADCAST_SPLATINSERT]], <4 x i64> poison, <4 x i32> zeroinitializer
620620; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
621621; CHECK: [[VECTOR_BODY]]:
622- ; CHECK-NEXT: [[TMP0:%.*]] = icmp eq <4 x i64> <i64 0, i64 1, i64 2, i64 3>, [[BROADCAST_SPLAT]]
623- ; CHECK-NEXT: [[TMP1:%.*]] = xor <4 x i1> [[TMP0]], splat (i1 true)
622+ ; CHECK-NEXT: [[TMP1:%.*]] = icmp ne <4 x i64> <i64 0, i64 1, i64 2, i64 3>, [[BROADCAST_SPLAT]]
624623; CHECK-NEXT: [[TMP2:%.*]] = extractelement <4 x i1> [[TMP1]], i32 0
625624; CHECK-NEXT: br i1 [[TMP2]], label %[[PRED_LOAD_IF:.*]], label %[[PRED_LOAD_CONTINUE:.*]]
626625; CHECK: [[PRED_LOAD_IF]]:
@@ -660,8 +659,8 @@ define void @pr70590_recipe_without_underlying_instr(i64 %n, ptr noalias %dst) {
660659; CHECK-NEXT: [[TMP28:%.*]] = insertelement <4 x i8> [[TMP22]], i8 [[TMP27]], i32 3
661660; CHECK-NEXT: br label %[[PRED_LOAD_CONTINUE6]]
662661; CHECK: [[PRED_LOAD_CONTINUE6]]:
663- ; CHECK-NEXT: [[WIDE_LOAD :%.*]] = phi <4 x i8> [ [[TMP22]], %[[PRED_LOAD_CONTINUE4]] ], [ [[TMP28]], %[[PRED_LOAD_IF5]] ]
664- ; CHECK-NEXT: [[PREDPHI:%.*]] = select <4 x i1> [[TMP0 ]], <4 x i8> zeroinitializer , <4 x i8> [[WIDE_LOAD]]
662+ ; CHECK-NEXT: [[TMP30 :%.*]] = phi <4 x i8> [ [[TMP22]], %[[PRED_LOAD_CONTINUE4]] ], [ [[TMP28]], %[[PRED_LOAD_IF5]] ]
663+ ; CHECK-NEXT: [[PREDPHI:%.*]] = select <4 x i1> [[TMP1 ]], <4 x i8> [[TMP30]] , <4 x i8> zeroinitializer
665664; CHECK-NEXT: store <4 x i8> [[PREDPHI]], ptr [[DST]], align 4
666665; CHECK-NEXT: br label %[[MIDDLE_BLOCK:.*]]
667666; CHECK: [[MIDDLE_BLOCK]]:
@@ -706,8 +705,7 @@ define void @recipe_without_underlying_instr_lanes_used(i64 %n, ptr noalias %dst
706705; CHECK-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <4 x i64> [[BROADCAST_SPLATINSERT]], <4 x i64> poison, <4 x i32> zeroinitializer
707706; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
708707; CHECK: [[VECTOR_BODY]]:
709- ; CHECK-NEXT: [[TMP0:%.*]] = icmp eq <4 x i64> <i64 0, i64 1, i64 2, i64 3>, [[BROADCAST_SPLAT]]
710- ; CHECK-NEXT: [[TMP1:%.*]] = xor <4 x i1> [[TMP0]], splat (i1 true)
708+ ; CHECK-NEXT: [[TMP1:%.*]] = icmp ne <4 x i64> <i64 0, i64 1, i64 2, i64 3>, [[BROADCAST_SPLAT]]
711709; CHECK-NEXT: [[TMP2:%.*]] = extractelement <4 x i1> [[TMP1]], i32 0
712710; CHECK-NEXT: br i1 [[TMP2]], label %[[PRED_LOAD_IF:.*]], label %[[PRED_LOAD_CONTINUE:.*]]
713711; CHECK: [[PRED_LOAD_IF]]:
@@ -747,9 +745,9 @@ define void @recipe_without_underlying_instr_lanes_used(i64 %n, ptr noalias %dst
747745; CHECK-NEXT: [[TMP28:%.*]] = insertelement <4 x i8> [[TMP22]], i8 [[TMP27]], i32 3
748746; CHECK-NEXT: br label %[[PRED_LOAD_CONTINUE6]]
749747; CHECK: [[PRED_LOAD_CONTINUE6]]:
750- ; CHECK-NEXT: [[WIDE_LOAD :%.*]] = phi <4 x i8> [ [[TMP22]], %[[PRED_LOAD_CONTINUE4]] ], [ [[TMP28]], %[[PRED_LOAD_IF5]] ]
751- ; CHECK-NEXT: [[PREDPHI:%.*]] = select <4 x i1> [[TMP0 ]], <4 x i8> zeroinitializer , <4 x i8> [[WIDE_LOAD]]
752- ; CHECK-NEXT: [[PREDPHI7:%.*]] = select <4 x i1> [[TMP0 ]], <4 x i64> zeroinitializer , <4 x i64> poison
748+ ; CHECK-NEXT: [[TMP26 :%.*]] = phi <4 x i8> [ [[TMP22]], %[[PRED_LOAD_CONTINUE4]] ], [ [[TMP28]], %[[PRED_LOAD_IF5]] ]
749+ ; CHECK-NEXT: [[PREDPHI:%.*]] = select <4 x i1> [[TMP1 ]], <4 x i8> [[TMP26]] , <4 x i8> zeroinitializer
750+ ; CHECK-NEXT: [[PREDPHI7:%.*]] = select <4 x i1> [[TMP1 ]], <4 x i64> poison , <4 x i64> zeroinitializer
753751; CHECK-NEXT: [[TMP12:%.*]] = extractelement <4 x i64> [[PREDPHI7]], i32 3
754752; CHECK-NEXT: store i64 [[TMP12]], ptr [[AUX]], align 8
755753; CHECK-NEXT: store <4 x i8> [[PREDPHI]], ptr [[DST]], align 4
0 commit comments