File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
llvm/test/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -169,8 +169,8 @@ define <2 x i32> @_parity_of_not_poison(<2 x i32> %x) {
169169
170170define <2 x i32 > @_parity_of_not_poison2 (<2 x i32 > %x ) {
171171; CHECK-LABEL: @_parity_of_not_poison2(
172- ; CHECK-NEXT: [[CNT :%.*]] = call range(i32 0, 33) <2 x i32> @llvm.ctpop.v2i32(<2 x i32> [[X:%.*]])
173- ; CHECK-NEXT: [[R:%.*]] = and <2 x i32> [[CNT ]], <i32 1, i32 poison>
172+ ; CHECK-NEXT: [[TMP1 :%.*]] = call range(i32 0, 33) <2 x i32> @llvm.ctpop.v2i32(<2 x i32> [[X:%.*]])
173+ ; CHECK-NEXT: [[R:%.*]] = and <2 x i32> [[TMP1 ]], <i32 1, i32 poison>
174174; CHECK-NEXT: ret <2 x i32> [[R]]
175175;
176176 %neg = xor <2 x i32 > %x , <i32 -1 ,i32 -1 >
@@ -485,3 +485,12 @@ define i32 @select_ctpop_zero(i32 %x) {
485485 %res = select i1 %cmp , i32 0 , i32 %ctpop
486486 ret i32 %res
487487}
488+
489+ define i32 @ctpop_non_zero (i32 range(i32 1 , 255 ) %x ) {
490+ ; CHECK-LABEL: @ctpop_non_zero(
491+ ; CHECK-NEXT: [[CTPOP:%.*]] = call range(i32 0, 9) i32 @llvm.ctpop.i32(i32 [[X:%.*]])
492+ ; CHECK-NEXT: ret i32 [[CTPOP]]
493+ ;
494+ %ctpop = call i32 @llvm.ctpop.i32 (i32 %x )
495+ ret i32 %ctpop
496+ }
You can’t perform that action at this time.
0 commit comments