[llvm] 81b3866 - [X86] Add test case for Issue #55138
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 27 13:16:39 PDT 2022
Author: Simon Pilgrim
Date: 2022-04-27T21:09:57+01:00
New Revision: 81b38668ff20e65b54fe02ee40cf6f2f82a842ea
URL: https://github.com/llvm/llvm-project/commit/81b38668ff20e65b54fe02ee40cf6f2f82a842ea
DIFF: https://github.com/llvm/llvm-project/commit/81b38668ff20e65b54fe02ee40cf6f2f82a842ea.diff
LOG: [X86] Add test case for Issue #55138
Added:
Modified:
llvm/test/CodeGen/X86/setcc.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/X86/setcc.ll b/llvm/test/CodeGen/X86/setcc.ll
index 03efa5515686b..f453caaf46042 100644
--- a/llvm/test/CodeGen/X86/setcc.ll
+++ b/llvm/test/CodeGen/X86/setcc.ll
@@ -292,4 +292,31 @@ define i16 @shift_and(i16 %a) {
ret i16 %conv
}
+define i32 @PR55138(i32 %x) {
+; X86-LABEL: PR55138:
+; X86: ## %bb.0:
+; X86-NEXT: movb {{[0-9]+}}(%esp), %al
+; X86-NEXT: andb $15, %al
+; X86-NEXT: movzbl %al, %ecx
+; X86-NEXT: movl $27030, %edx ## imm = 0x6996
+; X86-NEXT: xorl %eax, %eax
+; X86-NEXT: btl %ecx, %edx
+; X86-NEXT: setb %al
+; X86-NEXT: retl
+;
+; X64-LABEL: PR55138:
+; X64: ## %bb.0:
+; X64-NEXT: andb $15, %dil
+; X64-NEXT: movzbl %dil, %ecx
+; X64-NEXT: movl $27030, %edx ## imm = 0x6996
+; X64-NEXT: xorl %eax, %eax
+; X64-NEXT: btl %ecx, %edx
+; X64-NEXT: setb %al
+; X64-NEXT: retq
+ %urem = and i32 %x, 15
+ %shr = lshr i32 27030, %urem
+ %and = and i32 %shr, 1
+ ret i32 %and
+}
+
attributes #0 = { "target-cpu"="skylake-avx512" }
More information about the llvm-commits
mailing list