summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2019-05-13 15:45:20 +0000
committerCraig Topper <craig.topper@intel.com>2019-05-13 15:45:20 +0000
commitc6a6c107428e85f218b4de6fe079c8d380f3a1ef (patch)
treecc25326d676b8f1cab87d89a41623f31a938fbd0 /llvm
parent9423ba8121836a0da8e75d1ad72441a5f3fcf327 (diff)
downloadbcm5719-llvm-c6a6c107428e85f218b4de6fe079c8d380f3a1ef.tar.gz
bcm5719-llvm-c6a6c107428e85f218b4de6fe079c8d380f3a1ef.zip
[X86] Add test case for mask register variant of PR41619 which should be fixed after r360552
llvm-svn: 360591
Diffstat (limited to 'llvm')
-rw-r--r--llvm/test/CodeGen/X86/pr41619.ll33
1 files changed, 32 insertions, 1 deletions
diff --git a/llvm/test/CodeGen/X86/pr41619.ll b/llvm/test/CodeGen/X86/pr41619.ll
index 7c71f2c1c29..13bfd910587 100644
--- a/llvm/test/CodeGen/X86/pr41619.ll
+++ b/llvm/test/CodeGen/X86/pr41619.ll
@@ -1,5 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc < %s -mtriple=x86_64-apple-macosx10.14.0 -mattr=avx2 | FileCheck %s
+; RUN: llc < %s -mtriple=x86_64-apple-macosx10.14.0 -mattr=avx2 | FileCheck %s --check-prefixes=CHECK,AVX
+; RUN: llc < %s -mtriple=x86_64-apple-macosx10.14.0 -mattr=avx512bw | FileCheck %s --check-prefixes=CHECK,AVX512
define void @foo(double %arg) {
; CHECK-LABEL: foo:
@@ -25,3 +26,33 @@ bb:
store double %tmp5, double* undef, align 16
ret void
}
+
+; This used to crash with mask registers on avx512bw targets.
+define i32 @bar(double %blah) nounwind {
+; AVX-LABEL: bar:
+; AVX: ## %bb.0:
+; AVX-NEXT: pushq %rbp
+; AVX-NEXT: movq %rsp, %rbp
+; AVX-NEXT: andq $-32, %rsp
+; AVX-NEXT: subq $32, %rsp
+; AVX-NEXT: vmovq %xmm0, %rax
+; AVX-NEXT: ## kill: def $eax killed $eax killed $rax
+; AVX-NEXT: movq %rbp, %rsp
+; AVX-NEXT: popq %rbp
+; AVX-NEXT: retq
+;
+; AVX512-LABEL: bar:
+; AVX512: ## %bb.0:
+; AVX512-NEXT: vmovq %xmm0, %rax
+; AVX512-NEXT: kmovd %eax, %k0
+; AVX512-NEXT: kmovq %k0, %rax
+; AVX512-NEXT: ## kill: def $eax killed $eax killed $rax
+; AVX512-NEXT: retq
+ %z = bitcast double %blah to i64
+ %y = trunc i64 %z to i32
+ %a = bitcast i32 %y to <32 x i1>
+ %b = shufflevector <32 x i1> %a, <32 x i1> undef, <64 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31, i32 32, i32 33, i32 34, i32 35, i32 36, i32 37, i32 38, i32 39, i32 40, i32 41, i32 42, i32 43, i32 44, i32 45, i32 46, i32 47, i32 48, i32 49, i32 50, i32 51, i32 52, i32 53, i32 54, i32 55, i32 56, i32 57, i32 58, i32 59, i32 60, i32 61, i32 62, i32 63>
+ %c = bitcast <64 x i1> %b to i64
+ %d = trunc i64 %c to i32
+ ret i32 %d
+}
OpenPOWER on IntegriCloud