r352173 - [X86] Remove mask and passthru arguments from vpconflict builtins. Use select in IR instead.

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 24 23:08:22 PST 2019


Author: ctopper
Date: Thu Jan 24 23:08:22 2019
New Revision: 352173

URL: http://llvm.org/viewvc/llvm-project?rev=352173&view=rev
Log:
[X86] Remove mask and passthru arguments from vpconflict builtins. Use select in IR instead.

Modified:
    cfe/trunk/include/clang/Basic/BuiltinsX86.def
    cfe/trunk/lib/Headers/avx512cdintrin.h
    cfe/trunk/lib/Headers/avx512vlcdintrin.h
    cfe/trunk/test/CodeGen/avx512cdintrin.c
    cfe/trunk/test/CodeGen/avx512vlcd-builtins.c

Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsX86.def?rev=352173&r1=352172&r2=352173&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Thu Jan 24 23:08:22 2019
@@ -1067,12 +1067,12 @@ TARGET_BUILTIN(__builtin_ia32_psubsw512,
 TARGET_BUILTIN(__builtin_ia32_psubusb512, "V64cV64cV64c", "ncV:512:", "avx512bw")
 TARGET_BUILTIN(__builtin_ia32_psubusw512, "V32sV32sV32s", "ncV:512:", "avx512bw")
 
-TARGET_BUILTIN(__builtin_ia32_vpconflictdi_128_mask, "V2LLiV2LLiV2LLiUc", "ncV:128:", "avx512cd,avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpconflictdi_256_mask, "V4LLiV4LLiV4LLiUc", "ncV:256:", "avx512cd,avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpconflictsi_128_mask, "V4iV4iV4iUc", "ncV:128:", "avx512cd,avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpconflictsi_256_mask, "V8iV8iV8iUc", "ncV:256:", "avx512cd,avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpconflictdi_512_mask, "V8LLiV8LLiV8LLiUc", "ncV:512:", "avx512cd")
-TARGET_BUILTIN(__builtin_ia32_vpconflictsi_512_mask, "V16iV16iV16iUs", "ncV:512:", "avx512cd")
+TARGET_BUILTIN(__builtin_ia32_vpconflictdi_128, "V2LLiV2LLi", "ncV:128:", "avx512cd,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_vpconflictdi_256, "V4LLiV4LLi", "ncV:256:", "avx512cd,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_vpconflictsi_128, "V4iV4i", "ncV:128:", "avx512cd,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_vpconflictsi_256, "V8iV8i", "ncV:256:", "avx512cd,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_vpconflictdi_512, "V8LLiV8LLi", "ncV:512:", "avx512cd")
+TARGET_BUILTIN(__builtin_ia32_vpconflictsi_512, "V16iV16i", "ncV:512:", "avx512cd")
 TARGET_BUILTIN(__builtin_ia32_vplzcntd_512, "V16iV16i", "ncV:512:", "avx512cd")
 TARGET_BUILTIN(__builtin_ia32_vplzcntq_512, "V8LLiV8LLi", "ncV:512:", "avx512cd")
 

Modified: cfe/trunk/lib/Headers/avx512cdintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512cdintrin.h?rev=352173&r1=352172&r2=352173&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512cdintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512cdintrin.h Thu Jan 24 23:08:22 2019
@@ -34,49 +34,45 @@
 static __inline__ __m512i __DEFAULT_FN_ATTRS
 _mm512_conflict_epi64 (__m512i __A)
 {
-  return (__m512i) __builtin_ia32_vpconflictdi_512_mask ((__v8di) __A,
-                 (__v8di) _mm512_setzero_si512 (),
-                 (__mmask8) -1);
+  return (__m512i) __builtin_ia32_vpconflictdi_512 ((__v8di) __A);
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
 _mm512_mask_conflict_epi64 (__m512i __W, __mmask8 __U, __m512i __A)
 {
-  return (__m512i) __builtin_ia32_vpconflictdi_512_mask ((__v8di) __A,
-               (__v8di) __W,
-               (__mmask8) __U);
+  return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
+                                             (__v8di)_mm512_conflict_epi64(__A),
+                                             (__v8di)__W);
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
 _mm512_maskz_conflict_epi64 (__mmask8 __U, __m512i __A)
 {
-  return (__m512i) __builtin_ia32_vpconflictdi_512_mask ((__v8di) __A,
-                 (__v8di) _mm512_setzero_si512 (),
-                 (__mmask8) __U);
+  return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
+                                             (__v8di)_mm512_conflict_epi64(__A),
+                                             (__v8di)_mm512_setzero_si512 ());
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
 _mm512_conflict_epi32 (__m512i __A)
 {
-  return (__m512i) __builtin_ia32_vpconflictsi_512_mask ((__v16si) __A,
-                 (__v16si) _mm512_setzero_si512 (),
-                 (__mmask16) -1);
+  return (__m512i) __builtin_ia32_vpconflictsi_512 ((__v16si) __A);
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
 _mm512_mask_conflict_epi32 (__m512i __W, __mmask16 __U, __m512i __A)
 {
-  return (__m512i) __builtin_ia32_vpconflictsi_512_mask ((__v16si) __A,
-               (__v16si) __W,
-               (__mmask16) __U);
+  return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
+                                            (__v16si)_mm512_conflict_epi32(__A),
+                                            (__v16si)__W);
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
 _mm512_maskz_conflict_epi32 (__mmask16 __U, __m512i __A)
 {
-  return (__m512i) __builtin_ia32_vpconflictsi_512_mask ((__v16si) __A,
-                 (__v16si) _mm512_setzero_si512 (),
-                 (__mmask16) __U);
+  return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
+                                            (__v16si)_mm512_conflict_epi32(__A),
+                                            (__v16si)_mm512_setzero_si512());
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS

Modified: cfe/trunk/lib/Headers/avx512vlcdintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512vlcdintrin.h?rev=352173&r1=352172&r2=352173&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512vlcdintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512vlcdintrin.h Thu Jan 24 23:08:22 2019
@@ -60,99 +60,89 @@ _mm256_broadcastmw_epi32 (__mmask16 __A)
 static __inline__ __m128i __DEFAULT_FN_ATTRS128
 _mm_conflict_epi64 (__m128i __A)
 {
-  return (__m128i) __builtin_ia32_vpconflictdi_128_mask ((__v2di) __A,
-               (__v2di) _mm_undefined_si128 (),
-               (__mmask8) -1);
+  return (__m128i) __builtin_ia32_vpconflictdi_128 ((__v2di) __A);
 }
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS128
 _mm_mask_conflict_epi64 (__m128i __W, __mmask8 __U, __m128i __A)
 {
-  return (__m128i) __builtin_ia32_vpconflictdi_128_mask ((__v2di) __A,
-               (__v2di) __W,
-               (__mmask8) __U);
+  return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
+                                             (__v2di)_mm_conflict_epi64(__A),
+                                             (__v2di)__W);
 }
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS128
 _mm_maskz_conflict_epi64 (__mmask8 __U, __m128i __A)
 {
-  return (__m128i) __builtin_ia32_vpconflictdi_128_mask ((__v2di) __A,
-               (__v2di)
-               _mm_setzero_si128 (),
-               (__mmask8) __U);
+  return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
+                                             (__v2di)_mm_conflict_epi64(__A),
+                                             (__v2di)_mm_setzero_si128());
 }
 
 static __inline__ __m256i __DEFAULT_FN_ATTRS256
 _mm256_conflict_epi64 (__m256i __A)
 {
-  return (__m256i) __builtin_ia32_vpconflictdi_256_mask ((__v4di) __A,
-               (__v4di)  _mm256_undefined_si256 (),
-               (__mmask8) -1);
+  return (__m256i) __builtin_ia32_vpconflictdi_256 ((__v4di) __A);
 }
 
 static __inline__ __m256i __DEFAULT_FN_ATTRS256
 _mm256_mask_conflict_epi64 (__m256i __W, __mmask8 __U, __m256i __A)
 {
-  return (__m256i) __builtin_ia32_vpconflictdi_256_mask ((__v4di) __A,
-               (__v4di) __W,
-               (__mmask8) __U);
+  return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
+                                             (__v4di)_mm256_conflict_epi64(__A),
+                                             (__v4di)__W);
 }
 
 static __inline__ __m256i __DEFAULT_FN_ATTRS256
 _mm256_maskz_conflict_epi64 (__mmask8 __U, __m256i __A)
 {
-  return (__m256i) __builtin_ia32_vpconflictdi_256_mask ((__v4di) __A,
-               (__v4di) _mm256_setzero_si256 (),
-               (__mmask8) __U);
+  return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
+                                             (__v4di)_mm256_conflict_epi64(__A),
+                                             (__v4di)_mm256_setzero_si256());
 }
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS128
 _mm_conflict_epi32 (__m128i __A)
 {
-  return (__m128i) __builtin_ia32_vpconflictsi_128_mask ((__v4si) __A,
-               (__v4si) _mm_undefined_si128 (),
-               (__mmask8) -1);
+  return (__m128i) __builtin_ia32_vpconflictsi_128 ((__v4si) __A);
 }
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS128
 _mm_mask_conflict_epi32 (__m128i __W, __mmask8 __U, __m128i __A)
 {
-  return (__m128i) __builtin_ia32_vpconflictsi_128_mask ((__v4si) __A,
-               (__v4si) __W,
-               (__mmask8) __U);
+  return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
+                                             (__v4si)_mm_conflict_epi32(__A),
+                                             (__v4si)__W);
 }
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS128
 _mm_maskz_conflict_epi32 (__mmask8 __U, __m128i __A)
 {
-  return (__m128i) __builtin_ia32_vpconflictsi_128_mask ((__v4si) __A,
-               (__v4si) _mm_setzero_si128 (),
-               (__mmask8) __U);
+  return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
+                                             (__v4si)_mm_conflict_epi32(__A),
+                                             (__v4si)_mm_setzero_si128());
 }
 
 static __inline__ __m256i __DEFAULT_FN_ATTRS256
 _mm256_conflict_epi32 (__m256i __A)
 {
-  return (__m256i) __builtin_ia32_vpconflictsi_256_mask ((__v8si) __A,
-               (__v8si) _mm256_undefined_si256 (),
-               (__mmask8) -1);
+  return (__m256i) __builtin_ia32_vpconflictsi_256 ((__v8si) __A);
 }
 
 static __inline__ __m256i __DEFAULT_FN_ATTRS256
 _mm256_mask_conflict_epi32 (__m256i __W, __mmask8 __U, __m256i __A)
 {
-  return (__m256i) __builtin_ia32_vpconflictsi_256_mask ((__v8si) __A,
-               (__v8si) __W,
-               (__mmask8) __U);
+  return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
+                                             (__v8si)_mm256_conflict_epi32(__A),
+                                             (__v8si)__W);
 }
 
 static __inline__ __m256i __DEFAULT_FN_ATTRS256
 _mm256_maskz_conflict_epi32 (__mmask8 __U, __m256i __A)
 {
-  return (__m256i) __builtin_ia32_vpconflictsi_256_mask ((__v8si) __A,
-               (__v8si)
-               _mm256_setzero_si256 (),
-               (__mmask8) __U);
+  return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
+                                             (__v8si)_mm256_conflict_epi32(__A),
+                                             (__v8si)_mm256_setzero_si256());
 }
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS128

Modified: cfe/trunk/test/CodeGen/avx512cdintrin.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512cdintrin.c?rev=352173&r1=352172&r2=352173&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx512cdintrin.c (original)
+++ cfe/trunk/test/CodeGen/avx512cdintrin.c Thu Jan 24 23:08:22 2019
@@ -5,32 +5,36 @@
 
 __m512i test_mm512_conflict_epi64(__m512i __A) {
   // CHECK-LABEL: @test_mm512_conflict_epi64
-  // CHECK: @llvm.x86.avx512.mask.conflict.q.512
+  // CHECK: @llvm.x86.avx512.conflict.q.512
   return _mm512_conflict_epi64(__A); 
 }
 __m512i test_mm512_mask_conflict_epi64(__m512i __W, __mmask8 __U, __m512i __A) {
   // CHECK-LABEL: @test_mm512_mask_conflict_epi64
-  // CHECK: @llvm.x86.avx512.mask.conflict.q.512
+  // CHECK: @llvm.x86.avx512.conflict.q.512
+  // CHECK: select <8 x i1> %{{.*}}, <8 x i64> %{{.*}}, <8 x i64> %{{.*}}
   return _mm512_mask_conflict_epi64(__W,__U,__A); 
 }
 __m512i test_mm512_maskz_conflict_epi64(__mmask8 __U, __m512i __A) {
   // CHECK-LABEL: @test_mm512_maskz_conflict_epi64
-  // CHECK: @llvm.x86.avx512.mask.conflict.q.512
+  // CHECK: @llvm.x86.avx512.conflict.q.512
+  // CHECK: select <8 x i1> %{{.*}}, <8 x i64> %{{.*}}, <8 x i64> %{{.*}}
   return _mm512_maskz_conflict_epi64(__U,__A); 
 }
 __m512i test_mm512_conflict_epi32(__m512i __A) {
   // CHECK-LABEL: @test_mm512_conflict_epi32
-  // CHECK: @llvm.x86.avx512.mask.conflict.d.512
+  // CHECK: @llvm.x86.avx512.conflict.d.512
   return _mm512_conflict_epi32(__A); 
 }
 __m512i test_mm512_mask_conflict_epi32(__m512i __W, __mmask16 __U, __m512i __A) {
   // CHECK-LABEL: @test_mm512_mask_conflict_epi32
-  // CHECK: @llvm.x86.avx512.mask.conflict.d.512
+  // CHECK: @llvm.x86.avx512.conflict.d.512
+  // CHECK: select <16 x i1> %{{.*}}, <16 x i32> %{{.*}}, <16 x i32> %{{.*}}
   return _mm512_mask_conflict_epi32(__W,__U,__A); 
 }
 __m512i test_mm512_maskz_conflict_epi32(__mmask16 __U, __m512i __A) {
   // CHECK-LABEL: @test_mm512_maskz_conflict_epi32
-  // CHECK: @llvm.x86.avx512.mask.conflict.d.512
+  // CHECK: @llvm.x86.avx512.conflict.d.512
+  // CHECK: select <16 x i1> %{{.*}}, <16 x i32> %{{.*}}, <16 x i32> %{{.*}}
   return _mm512_maskz_conflict_epi32(__U,__A); 
 }
 __m512i test_mm512_lzcnt_epi32(__m512i __A) {

Modified: cfe/trunk/test/CodeGen/avx512vlcd-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512vlcd-builtins.c?rev=352173&r1=352172&r2=352173&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx512vlcd-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx512vlcd-builtins.c Thu Jan 24 23:08:22 2019
@@ -57,73 +57,81 @@ __m256i test_mm256_broadcastmw_epi32(__m
 
 __m128i test_mm_conflict_epi64(__m128i __A) {
   // CHECK-LABEL: @test_mm_conflict_epi64
-  // CHECK: @llvm.x86.avx512.mask.conflict.q.128
+  // CHECK: @llvm.x86.avx512.conflict.q.128
   return _mm_conflict_epi64(__A); 
 }
 
 __m128i test_mm_mask_conflict_epi64(__m128i __W, __mmask8 __U, __m128i __A) {
   // CHECK-LABEL: @test_mm_mask_conflict_epi64
-  // CHECK: @llvm.x86.avx512.mask.conflict.q.128
+  // CHECK: @llvm.x86.avx512.conflict.q.128
+  // CHECK: select <2 x i1> %{{.*}}, <2 x i64> %{{.*}}, <2 x i64> %{{.*}}
   return _mm_mask_conflict_epi64(__W, __U, __A); 
 }
 
 __m128i test_mm_maskz_conflict_epi64(__mmask8 __U, __m128i __A) {
   // CHECK-LABEL: @test_mm_maskz_conflict_epi64
-  // CHECK: @llvm.x86.avx512.mask.conflict.q.128
+  // CHECK: @llvm.x86.avx512.conflict.q.128
+  // CHECK: select <2 x i1> %{{.*}}, <2 x i64> %{{.*}}, <2 x i64> %{{.*}}
   return _mm_maskz_conflict_epi64(__U, __A); 
 }
 
 __m256i test_mm256_conflict_epi64(__m256i __A) {
   // CHECK-LABEL: @test_mm256_conflict_epi64
-  // CHECK: @llvm.x86.avx512.mask.conflict.q.256
+  // CHECK: @llvm.x86.avx512.conflict.q.256
   return _mm256_conflict_epi64(__A); 
 }
 
 __m256i test_mm256_mask_conflict_epi64(__m256i __W, __mmask8 __U, __m256i __A) {
   // CHECK-LABEL: @test_mm256_mask_conflict_epi64
-  // CHECK: @llvm.x86.avx512.mask.conflict.q.256
+  // CHECK: @llvm.x86.avx512.conflict.q.256
+  // CHECK: select <4 x i1> %{{.*}}, <4 x i64> %{{.*}}, <4 x i64> %{{.*}}
   return _mm256_mask_conflict_epi64(__W, __U, __A); 
 }
 
 __m256i test_mm256_maskz_conflict_epi64(__mmask8 __U, __m256i __A) {
   // CHECK-LABEL: @test_mm256_maskz_conflict_epi64
-  // CHECK: @llvm.x86.avx512.mask.conflict.q.256
+  // CHECK: @llvm.x86.avx512.conflict.q.256
+  // CHECK: select <4 x i1> %{{.*}}, <4 x i64> %{{.*}}, <4 x i64> %{{.*}}
   return _mm256_maskz_conflict_epi64(__U, __A); 
 }
 
 __m128i test_mm_conflict_epi32(__m128i __A) {
   // CHECK-LABEL: @test_mm_conflict_epi32
-  // CHECK: @llvm.x86.avx512.mask.conflict.d.128
+  // CHECK: @llvm.x86.avx512.conflict.d.128
   return _mm_conflict_epi32(__A); 
 }
 
 __m128i test_mm_mask_conflict_epi32(__m128i __W, __mmask8 __U, __m128i __A) {
   // CHECK-LABEL: @test_mm_mask_conflict_epi32
-  // CHECK: @llvm.x86.avx512.mask.conflict.d.128
+  // CHECK: @llvm.x86.avx512.conflict.d.128
+  // CHECK: select <4 x i1> %{{.*}}, <4 x i32> %{{.*}}, <4 x i32> %{{.*}}
   return _mm_mask_conflict_epi32(__W, __U, __A); 
 }
 
 __m128i test_mm_maskz_conflict_epi32(__mmask8 __U, __m128i __A) {
   // CHECK-LABEL: @test_mm_maskz_conflict_epi32
-  // CHECK: @llvm.x86.avx512.mask.conflict.d.128
+  // CHECK: @llvm.x86.avx512.conflict.d.128
+  // CHECK: select <4 x i1> %{{.*}}, <4 x i32> %{{.*}}, <4 x i32> %{{.*}}
   return _mm_maskz_conflict_epi32(__U, __A); 
 }
 
 __m256i test_mm256_conflict_epi32(__m256i __A) {
   // CHECK-LABEL: @test_mm256_conflict_epi32
-  // CHECK: @llvm.x86.avx512.mask.conflict.d.256
+  // CHECK: @llvm.x86.avx512.conflict.d.256
   return _mm256_conflict_epi32(__A); 
 }
 
 __m256i test_mm256_mask_conflict_epi32(__m256i __W, __mmask8 __U, __m256i __A) {
   // CHECK-LABEL: @test_mm256_mask_conflict_epi32
-  // CHECK: @llvm.x86.avx512.mask.conflict.d.256
+  // CHECK: @llvm.x86.avx512.conflict.d.256
+  // CHECK: select <8 x i1> %{{.*}}, <8 x i32> %{{.*}}, <8 x i32> %{{.*}}
   return _mm256_mask_conflict_epi32(__W, __U, __A); 
 }
 
 __m256i test_mm256_maskz_conflict_epi32(__mmask8 __U, __m256i __A) {
   // CHECK-LABEL: @test_mm256_maskz_conflict_epi32
-  // CHECK: @llvm.x86.avx512.mask.conflict.d.256
+  // CHECK: @llvm.x86.avx512.conflict.d.256
+  // CHECK: select <8 x i1> %{{.*}}, <8 x i32> %{{.*}}, <8 x i32> %{{.*}}
   return _mm256_maskz_conflict_epi32(__U, __A); 
 }
 




More information about the cfe-commits mailing list