[llvm] b25b6d4 - [NFC][Codegen][X86] Add test for freeze with other uses of maybe-poison operand
Roman Lebedev via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 22 12:23:41 PST 2022
Author: Roman Lebedev
Date: 2022-12-22T23:23:19+03:00
New Revision: b25b6d4922cd1ae9c041ecf139b62d302ad3bb91
URL: https://github.com/llvm/llvm-project/commit/b25b6d4922cd1ae9c041ecf139b62d302ad3bb91
DIFF: https://github.com/llvm/llvm-project/commit/b25b6d4922cd1ae9c041ecf139b62d302ad3bb91.diff
LOG: [NFC][Codegen][X86] Add test for freeze with other uses of maybe-poison operand
Added:
Modified:
llvm/test/CodeGen/X86/freeze-binary.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/X86/freeze-binary.ll b/llvm/test/CodeGen/X86/freeze-binary.ll
index 1807fc72eb359..0f3e2fbe662b8 100644
--- a/llvm/test/CodeGen/X86/freeze-binary.ll
+++ b/llvm/test/CodeGen/X86/freeze-binary.ll
@@ -20,6 +20,51 @@ define i32 @freeze_and(i32 %a0) nounwind {
ret i32 %z
}
+define i32 @freeze_and_extra_use(i32 %a0, ptr %escape) nounwind {
+; X86-LABEL: freeze_and_extra_use:
+; X86: # %bb.0:
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: movl %eax, (%ecx)
+; X86-NEXT: andl $15, %eax
+; X86-NEXT: andl $7, %eax
+; X86-NEXT: retl
+;
+; X64-LABEL: freeze_and_extra_use:
+; X64: # %bb.0:
+; X64-NEXT: movl %edi, %eax
+; X64-NEXT: movl %edi, (%rsi)
+; X64-NEXT: andl $15, %eax
+; X64-NEXT: andl $7, %eax
+; X64-NEXT: retq
+ store i32 %a0, ptr %escape
+ %x = and i32 %a0, 15
+ %y = freeze i32 %x
+ %z = and i32 %y, 7
+ ret i32 %z
+}
+define i32 @freeze_and_extra_use2(i32 %a0, ptr %escape) nounwind {
+; X86-LABEL: freeze_and_extra_use2:
+; X86: # %bb.0:
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: movl %ecx, %eax
+; X86-NEXT: andl $15, %eax
+; X86-NEXT: andl %ecx, %eax
+; X86-NEXT: retl
+;
+; X64-LABEL: freeze_and_extra_use2:
+; X64: # %bb.0:
+; X64-NEXT: movl %edi, %eax
+; X64-NEXT: andl $15, %eax
+; X64-NEXT: andl %edi, %eax
+; X64-NEXT: retq
+ %x = and i32 %a0, 15
+ %y = freeze i32 %x
+ %z = and i32 %y, 7
+ %w = and i32 %y, %a0
+ ret i32 %w
+}
+
define <2 x i64> @freeze_and_vec(<2 x i64> %a0) nounwind {
; X86-LABEL: freeze_and_vec:
; X86: # %bb.0:
More information about the llvm-commits
mailing list