Skip to content

Commit 33a24b7

Browse files
committed
[X86] Add test coverage for #95284
1 parent 1cbafb3 commit 33a24b7

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

llvm/test/CodeGen/X86/avg.ll

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2197,3 +2197,21 @@ define <8 x i16> @PR52131_not_zext_with_constant(<8 x i32> %a) {
21972197
%i3 = trunc <8 x i32> %i2 to <8 x i16>
21982198
ret <8 x i16> %i3
21992199
}
2200+
2201+
define i64 @PR95284(i32 %a0) {
2202+
; CHECK-LABEL: PR95284:
2203+
; CHECK: # %bb.0:
2204+
; CHECK-NEXT: movl %edi, %ecx
2205+
; CHECK-NEXT: decq %rcx
2206+
; CHECK-NEXT: shrq %rcx
2207+
; CHECK-NEXT: incq %rcx
2208+
; CHECK-NEXT: movabsq $9223372036854775806, %rax # imm = 0x7FFFFFFFFFFFFFFE
2209+
; CHECK-NEXT: andq %rcx, %rax
2210+
; CHECK-NEXT: retq
2211+
%ext = zext nneg i32 %a0 to i64
2212+
%dec = add i64 %ext, -1
2213+
%srl = lshr i64 %dec, 1
2214+
%inc = add nuw nsw i64 %srl, 1
2215+
%res = and i64 %inc, 9223372036854775806
2216+
ret i64 %res
2217+
}

0 commit comments

Comments
 (0)