From 6edf496ee17057e5269e014f738021ca36760723 Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper@gmail.com>
Date: Wed, 22 Jun 2016 06:36:21 +0000
Subject: [PATCH] [AVX512] Fix _mm_setzero_di to not require avx512vl since its
 used by the avx512dqintrin.h. Also update the avx512dq test to not enable
 avx512vl feature so we can ensure correct dependencies.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@273388 91177308-0d34-0410-b5e6-96231b3b80d8
---
 lib/Headers/avx512vlintrin.h     | 5 +++--
 test/CodeGen/avx512dq-builtins.c | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/Headers/avx512vlintrin.h b/lib/Headers/avx512vlintrin.h
index 29570501540..3e69083f02d 100644
--- a/lib/Headers/avx512vlintrin.h
+++ b/lib/Headers/avx512vlintrin.h
@@ -30,9 +30,10 @@
 
 #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512vl")))
 
-static  __inline __v2di __DEFAULT_FN_ATTRS
+/* Doesn't require avx512vl, used in avx512dqintrin.h */
+static  __inline __m128i __attribute__((__always_inline__, __nodebug__, __target__("avx512f")))
 _mm_setzero_di(void) {
-  return (__v2di){ 0, 0};
+  return (__m128i)(__v2di){ 0LL, 0LL};
 }
 
 /* Integer compare */
diff --git a/test/CodeGen/avx512dq-builtins.c b/test/CodeGen/avx512dq-builtins.c
index fe54e391577..78a39d71f59 100644
--- a/test/CodeGen/avx512dq-builtins.c
+++ b/test/CodeGen/avx512dq-builtins.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin -target-feature +avx512dq -target-feature +avx512vl -emit-llvm -o - -Werror | FileCheck %s
+// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin -target-feature +avx512dq -emit-llvm -o - -Werror | FileCheck %s
 
 // Don't include mm_malloc.h, it's system specific.
 #define __MM_MALLOC_H
-- 
GitLab