]> granicus.if.org Git - clang/commitdiff
[X86][AVX512] _mm512_stream_load_si512 should take a void const* argument (PR33977)
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 5 Sep 2017 10:06:41 +0000 (10:06 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 5 Sep 2017 10:06:41 +0000 (10:06 +0000)
Based off the Intel Intrinsics guide, we should expect a void const* argument.

Prevents 'passing 'const void *' to parameter of type 'void *' discards qualifiers' warnings.

Differential Revision: https://reviews.llvm.org/D37449

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312523 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Headers/avx512fintrin.h
test/CodeGen/avx512f-builtins.c

index 4ce694531100c4958c5ca19f197df92b76e54a34..2b4497a1ce41abed0c5c38f5772fb2c628f61d1b 100644 (file)
@@ -9040,7 +9040,7 @@ _mm512_stream_si512 (__m512i * __P, __m512i __A)
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
-_mm512_stream_load_si512 (void *__P)
+_mm512_stream_load_si512 (void const *__P)
 {
   typedef __v8di __v8di_aligned __attribute__((aligned(64)));
   return (__m512i) __builtin_nontemporal_load((const __v8di_aligned *)__P);
index c3356461a348ea362c0af3dec4ed64c1eadfec0c..317539ab2ec32271014728a04457e0b32104e36b 100644 (file)
@@ -6258,6 +6258,12 @@ __m512i test_mm512_stream_load_si512(void *__P) {
   return _mm512_stream_load_si512(__P); 
 }
 
+__m512i test_mm512_stream_load_si512_const(void const *__P) {
+  // CHECK-LABEL: @test_mm512_stream_load_si512_const
+  // CHECK: load <8 x i64>, <8 x i64>* %{{.*}}, align 64, !nontemporal
+  return _mm512_stream_load_si512(__P); 
+}
+
 void test_mm512_stream_pd(double *__P, __m512d __A) {
   // CHECK-LABEL: @test_mm512_stream_pd
   // CHECK: store <8 x double> %{{.*}}, <8 x double>* %{{.*}}, align 64, !nontemporal