File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
llvm/test/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -398,3 +398,18 @@ define i64 @constant_multiplied_non_power_of_2_i64(i64 %0) {
398398 %4 = tail call i64 @llvm.vector.reduce.add.v6i64 (<6 x i64 > %3 )
399399 ret i64 %4
400400}
401+
402+ define i1 @constant_multiplied_non_power_of_2_i1 (i1 %0 ) {
403+ ; CHECK-LABEL: @constant_multiplied_non_power_of_2_i1(
404+ ; CHECK-NEXT: [[TMP6:%.*]] = insertelement <8 x i1> poison, i1 [[TMP0:%.*]], i64 0
405+ ; CHECK-NEXT: [[TMP3:%.*]] = shufflevector <8 x i1> [[TMP6]], <8 x i1> poison, <8 x i32> zeroinitializer
406+ ; CHECK-NEXT: [[TMP4:%.*]] = bitcast <8 x i1> [[TMP3]] to i8
407+ ; CHECK-NEXT: [[TMP5:%.*]] = call range(i8 0, 9) i8 @llvm.ctpop.i8(i8 [[TMP4]])
408+ ; CHECK-NEXT: [[TMP2:%.*]] = trunc i8 [[TMP5]] to i1
409+ ; CHECK-NEXT: ret i1 [[TMP2]]
410+ ;
411+ %2 = insertelement <8 x i1 > poison, i1 %0 , i32 0
412+ %3 = shufflevector <8 x i1 > %2 , <8 x i1 > poison, <8 x i32 > zeroinitializer
413+ %4 = tail call i1 @llvm.vector.reduce.add.v6i1 (<8 x i1 > %3 )
414+ ret i1 %4
415+ }
You can’t perform that action at this time.
0 commit comments