File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
llvm/test/Transforms/InstSimplify Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -969,6 +969,28 @@ define <vscale x 2 x i1> @ignore_scalable_undef(<vscale x 2 x i1> %cond) {
969
969
ret <vscale x 2 x i1 > %s
970
970
}
971
971
972
+ define i32 @select_ctpop_zero (i32 %x ) {
973
+ ; CHECK-LABEL: @select_ctpop_zero(
974
+ ; CHECK-NEXT: [[T1:%.*]] = call i32 @llvm.ctpop.i32(i32 [[X:%.*]])
975
+ ; CHECK-NEXT: ret i32 [[T1]]
976
+ ;
977
+ %t0 = icmp eq i32 %x , 0
978
+ %t1 = call i32 @llvm.ctpop.i32 (i32 %x )
979
+ %sel = select i1 %t0 , i32 0 , i32 %t1
980
+ ret i32 %sel
981
+ }
982
+ declare i32 @llvm.ctpop.i32 (i32 )
983
+
984
+ define <2 x i32 > @vec_select_no_equivalence (<2 x i32 > %x , <2 x i32 > %y ) {
985
+ ; CHECK-LABEL: @vec_select_no_equivalence(
986
+ ; CHECK-NEXT: ret <2 x i32> zeroinitializer
987
+ ;
988
+ %x10 = shufflevector <2 x i32 > %x , <2 x i32 > undef , <2 x i32 > <i32 1 , i32 0 >
989
+ %cond = icmp eq <2 x i32 > %x , zeroinitializer
990
+ %s = select <2 x i1 > %cond , <2 x i32 > %x10 , <2 x i32 > zeroinitializer
991
+ ret <2 x i32 > %s
992
+ }
993
+
972
994
; TODO: these can be optimized more
973
995
974
996
define i32 @poison (i32 %x , i32 %y ) {
You can’t perform that action at this time.
0 commit comments