[llvm] 29817a9 - [X86] Add test coverage for #74101
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 8 07:11:21 PDT 2024
Author: Simon Pilgrim
Date: 2024-08-08T15:10:57+01:00
New Revision: 29817a96262aa96f3e0be632d91ab810e75f728d
URL: https://github.com/llvm/llvm-project/commit/29817a96262aa96f3e0be632d91ab810e75f728d
DIFF: https://github.com/llvm/llvm-project/commit/29817a96262aa96f3e0be632d91ab810e75f728d.diff
LOG: [X86] Add test coverage for #74101
Added:
Modified:
llvm/test/CodeGen/X86/combine-sub.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/X86/combine-sub.ll b/llvm/test/CodeGen/X86/combine-sub.ll
index 9d5934c345f8a..3123efc306360 100644
--- a/llvm/test/CodeGen/X86/combine-sub.ll
+++ b/llvm/test/CodeGen/X86/combine-sub.ll
@@ -452,3 +452,16 @@ define void @PR52032_4(ptr %p, ptr %q) {
store <4 x i32> %i9, ptr %p2, align 4
ret void
}
+
+; FIXME: Failure to fold add(xor(bsr(x),-32),33) -> add(or(bsr(x),-32),33) -> add(bsr(x),1)
+define i32 @PR74101(i32 %a0) {
+; CHECK-LABEL: PR74101:
+; CHECK: # %bb.0:
+; CHECK-NEXT: bsrl %edi, %eax
+; CHECK-NEXT: xorl $-32, %eax
+; CHECK-NEXT: addl $33, %eax
+; CHECK-NEXT: retq
+ %lz = call i32 @llvm.ctlz.i32(i32 %a0, i1 true)
+ %add = sub nuw nsw i32 32, %lz
+ ret i32 %add
+}
More information about the llvm-commits
mailing list