[llvm] 3968844 - [X86] Add test showing failure to fold freeze(insert_subvector(x,y,c)) -> insert_subvector(freeze(x),freeze(y),c)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 3 05:27:30 PDT 2022
Author: Simon Pilgrim
Date: 2022-09-03T13:27:08+01:00
New Revision: 3968844bffabb318df631860f58153d300a011cb
URL: https://github.com/llvm/llvm-project/commit/3968844bffabb318df631860f58153d300a011cb
DIFF: https://github.com/llvm/llvm-project/commit/3968844bffabb318df631860f58153d300a011cb.diff
LOG: [X86] Add test showing failure to fold freeze(insert_subvector(x,y,c)) -> insert_subvector(freeze(x),freeze(y),c)
If at least one of x and y are known never poison.
Added:
llvm/test/CodeGen/X86/freeze-vector.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/X86/freeze-vector.ll b/llvm/test/CodeGen/X86/freeze-vector.ll
new file mode 100644
index 0000000000000..0275d25cebcd5
--- /dev/null
+++ b/llvm/test/CodeGen/X86/freeze-vector.ll
@@ -0,0 +1,16 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=i686-- -mattr=+avx | FileCheck %s
+; RUN: llc < %s -mtriple=x86_64-- -mattr=+avx2 | FileCheck %s
+
+define <4 x i32> @freeze_insert_subvector(<8 x i32> %a0) nounwind {
+; CHECK-LABEL: freeze_insert_subvector:
+; CHECK: # %bb.0:
+; CHECK-NEXT: vmovaps %xmm0, %xmm0
+; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm0
+; CHECK-NEXT: vzeroupper
+; CHECK-NEXT: ret{{[l|q]}}
+ %x = shufflevector <8 x i32> %a0, <8 x i32> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 10, i32 11>
+ %y = freeze <8 x i32> %x
+ %z = shufflevector <8 x i32> %y, <8 x i32> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
+ ret <4 x i32> %z
+}
More information about the llvm-commits
mailing list