From: Shengchen Kan Date: Tue, 10 Mar 2020 07:57:45 +0000 (+0800) Subject: [X86] Support intrinsic _mm_cldemote X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ab69cd0779c529519eb7d26e0fa1b8dfb505f838;p=platform%2Fupstream%2Fllvm.git [X86] Support intrinsic _mm_cldemote Reviewers: LuoYuanke, craig.topper, RKSimon, pengfei Reviewed By: craig.topper Subscribers: cfe-commits, llvm-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D75896 --- diff --git a/clang/lib/Headers/cldemoteintrin.h b/clang/lib/Headers/cldemoteintrin.h index 2413e7d..cfb951c 100644 --- a/clang/lib/Headers/cldemoteintrin.h +++ b/clang/lib/Headers/cldemoteintrin.h @@ -18,11 +18,19 @@ #define __DEFAULT_FN_ATTRS \ __attribute__((__always_inline__, __nodebug__, __target__("cldemote"))) +/// Hint to hardware that the cache line that contains \p __P should be demoted +/// from the cache closest to the processor core to a level more distant from +/// the processor core. +/// +/// \headerfile +/// +/// This intrinsic corresponds to the CLDEMOTE instruction. static __inline__ void __DEFAULT_FN_ATTRS _cldemote(const void * __P) { __builtin_ia32_cldemote(__P); } +#define _mm_cldemote(p) _cldemote(p) #undef __DEFAULT_FN_ATTRS #endif diff --git a/clang/test/CodeGen/cldemote.c b/clang/test/CodeGen/cldemote.c index 8c7bdf5..f5f7ad9 100644 --- a/clang/test/CodeGen/cldemote.c +++ b/clang/test/CodeGen/cldemote.c @@ -7,4 +7,6 @@ void test_cldemote(const void *p) { //CHECK-LABEL: @test_cldemote //CHECK: call void @llvm.x86.cldemote(i8* %{{.*}}) _cldemote(p); + //CHECK: call void @llvm.x86.cldemote(i8* %{{.*}}) + _mm_cldemote(p); }