diff options
-rw-r--r-- | llvm/test/CodeGen/X86/vzero-excess.ll | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/vzero-excess.ll b/llvm/test/CodeGen/X86/vzero-excess.ll new file mode 100644 index 00000000000..4bc110dc6de --- /dev/null +++ b/llvm/test/CodeGen/X86/vzero-excess.ll @@ -0,0 +1,43 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py +; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s + +; FIXME: The vzeroupper added by the VZeroUpperInserter pass is unnecessary in these tests. + +define <8 x float> @zeroupper(<8 x float> %x) nounwind { +; CHECK-LABEL: zeroupper: +; CHECK: # BB#0: +; CHECK-NEXT: subq $56, %rsp +; CHECK-NEXT: vmovups %ymm0, (%rsp) # 32-byte Spill +; CHECK-NEXT: vzeroupper +; CHECK-NEXT: vzeroupper +; CHECK-NEXT: callq the_unknown +; CHECK-NEXT: vmovups (%rsp), %ymm0 # 32-byte Reload +; CHECK-NEXT: addq $56, %rsp +; CHECK-NEXT: retq +; + call void @llvm.x86.avx.vzeroupper() + call void @the_unknown() + ret <8 x float> %x +} + +define <8 x float> @zeroall(<8 x float> %x) nounwind { +; CHECK-LABEL: zeroall: +; CHECK: # BB#0: +; CHECK-NEXT: subq $56, %rsp +; CHECK-NEXT: vmovups %ymm0, (%rsp) # 32-byte Spill +; CHECK-NEXT: vzeroall +; CHECK-NEXT: vzeroupper +; CHECK-NEXT: callq the_unknown +; CHECK-NEXT: vmovups (%rsp), %ymm0 # 32-byte Reload +; CHECK-NEXT: addq $56, %rsp +; CHECK-NEXT: retq +; + call void @llvm.x86.avx.vzeroall() + call void @the_unknown() + ret <8 x float> %x +} + +declare void @llvm.x86.avx.vzeroupper() nounwind readnone +declare void @llvm.x86.avx.vzeroall() nounwind readnone +declare void @the_unknown() nounwind + |