[llvm-branch-commits] [cfe-branch] r314569 - Merging r313392:

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Sep 29 16:52:26 PDT 2017


Author: tstellar
Date: Fri Sep 29 16:52:26 2017
New Revision: 314569

URL: http://llvm.org/viewvc/llvm-project?rev=314569&view=rev
Log:
Merging r313392:

------------------------------------------------------------------------
r313392 | ctopper | 2017-09-15 13:27:59 -0700 (Fri, 15 Sep 2017) | 7 lines

[X86] Disable _mm512_maskz_set1_epi64 intrinsic on 32-bit targets to prevent a backend isel failure.

The __builtin_ia32_pbroadcastq512_mem_mask we were previously trying to use in 32-bit mode is not implemented in the x86 backend and causes isel to fail in release builds. In debug builds it fails even earlier during legalization with an llvm_unreachable.

While there add the missing test case for this intrinsic for this for 64-bit mode.

This fixes PR34631. D37668 should be able to recover this for 32-bit mode soon. But I wanted to fix the crash ahead of that.
------------------------------------------------------------------------

Modified:
    cfe/branches/release_50/include/clang/Basic/BuiltinsX86.def
    cfe/branches/release_50/lib/Headers/avx512fintrin.h
    cfe/branches/release_50/test/CodeGen/avx512f-builtins.c

Modified: cfe/branches/release_50/include/clang/Basic/BuiltinsX86.def
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_50/include/clang/Basic/BuiltinsX86.def?rev=314569&r1=314568&r2=314569&view=diff
==============================================================================
--- cfe/branches/release_50/include/clang/Basic/BuiltinsX86.def (original)
+++ cfe/branches/release_50/include/clang/Basic/BuiltinsX86.def Fri Sep 29 16:52:26 2017
@@ -976,7 +976,6 @@ TARGET_BUILTIN(__builtin_ia32_pmuludq512
 TARGET_BUILTIN(__builtin_ia32_ptestmd512, "UsV16iV16iUs", "", "avx512f")
 TARGET_BUILTIN(__builtin_ia32_ptestmq512, "UcV8LLiV8LLiUc", "", "avx512f")
 TARGET_BUILTIN(__builtin_ia32_pbroadcastd512_gpr_mask, "V16iiV16iUs", "", "avx512f")
-TARGET_BUILTIN(__builtin_ia32_pbroadcastq512_mem_mask, "V8LLiLLiV8LLiUc", "", "avx512f")
 TARGET_BUILTIN(__builtin_ia32_loaddqusi512_mask, "V16iiC*V16iUs", "", "avx512f")
 TARGET_BUILTIN(__builtin_ia32_loaddqudi512_mask, "V8LLiLLiC*V8LLiUc", "", "avx512f")
 TARGET_BUILTIN(__builtin_ia32_loadups512_mask, "V16ffC*V16fUs", "", "avx512f")

Modified: cfe/branches/release_50/lib/Headers/avx512fintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_50/lib/Headers/avx512fintrin.h?rev=314569&r1=314568&r2=314569&view=diff
==============================================================================
--- cfe/branches/release_50/lib/Headers/avx512fintrin.h (original)
+++ cfe/branches/release_50/lib/Headers/avx512fintrin.h Fri Sep 29 16:52:26 2017
@@ -267,21 +267,16 @@ _mm512_maskz_set1_epi32(__mmask16 __M, i
                  __M);
 }
 
+#ifdef __x86_64__
 static __inline __m512i __DEFAULT_FN_ATTRS
 _mm512_maskz_set1_epi64(__mmask8 __M, long long __A)
 {
-#ifdef __x86_64__
   return (__m512i) __builtin_ia32_pbroadcastq512_gpr_mask (__A,
                  (__v8di)
                  _mm512_setzero_si512 (),
                  __M);
-#else
-  return (__m512i) __builtin_ia32_pbroadcastq512_mem_mask (__A,
-                 (__v8di)
-                 _mm512_setzero_si512 (),
-                 __M);
-#endif
 }
+#endif
 
 static __inline __m512 __DEFAULT_FN_ATTRS
 _mm512_setzero_ps(void)

Modified: cfe/branches/release_50/test/CodeGen/avx512f-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_50/test/CodeGen/avx512f-builtins.c?rev=314569&r1=314568&r2=314569&view=diff
==============================================================================
--- cfe/branches/release_50/test/CodeGen/avx512f-builtins.c (original)
+++ cfe/branches/release_50/test/CodeGen/avx512f-builtins.c Fri Sep 29 16:52:26 2017
@@ -7929,6 +7929,13 @@ __m512i test_mm512_mask_set1_epi64 (__m5
     //CHECK: @llvm.x86.avx512.mask.pbroadcast.q.gpr.512
   return _mm512_mask_set1_epi64 (__O, __M, __A);
 }
+
+__m512i test_mm512_maskz_set1_epi64 (__mmask8 __M, long long __A)
+{
+    //CHECK-LABEL: @test_mm512_maskz_set1_epi64
+    //CHECK: @llvm.x86.avx512.mask.pbroadcast.q.gpr.512
+  return _mm512_maskz_set1_epi64 (__M, __A);
+}
 #endif
 
 __m512i test_mm512_set_epi64 (long long __A, long long __B, long long __C,




More information about the llvm-branch-commits mailing list