diff --git a/llvm/test/CodeGen/X86/freeze-vector.ll b/llvm/test/CodeGen/X86/freeze-vector.ll new file mode 100644 index 000000000000..0275d25cebcd --- /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> + %y = freeze <8 x i32> %x + %z = shufflevector <8 x i32> %y, <8 x i32> poison, <4 x i32> + ret <4 x i32> %z +}