r332830 - [X86] Remove some preprocessor feature checks from intrinsic headers

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Sun May 20 23:07:49 PDT 2018


Author: ctopper
Date: Sun May 20 23:07:49 2018
New Revision: 332830

URL: http://llvm.org/viewvc/llvm-project?rev=332830&view=rev
Log:
[X86] Remove some preprocessor feature checks from intrinsic headers

Summary:
These look to be a couple things that weren't removed when we switched to target attribute.

The popcnt makes including just smmintrin.h also include popcntintrin.h. The popcnt file itself already contains target attrributes.

The prefetch ones are just wrappers around __builtin_prefetch which we have graceful fallbacks for in the backend if the exact instruction isn't available. So there's no reason to hide them. And it makes them available in functions that have the write target attribute but not a -march command line flag.

Reviewers: echristo, RKSimon, spatel, DavidKreitzer

Reviewed By: echristo

Subscribers: cfe-commits

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

Modified:
    cfe/trunk/lib/Headers/prfchwintrin.h
    cfe/trunk/lib/Headers/smmintrin.h

Modified: cfe/trunk/lib/Headers/prfchwintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/prfchwintrin.h?rev=332830&r1=332829&r2=332830&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/prfchwintrin.h (original)
+++ cfe/trunk/lib/Headers/prfchwintrin.h Sun May 20 23:07:49 2018
@@ -28,7 +28,6 @@
 #ifndef __PRFCHWINTRIN_H
 #define __PRFCHWINTRIN_H
 
-#if defined(__PRFCHW__) || defined(__3dNOW__)
 /// Loads a memory sequence containing the specified memory address into
 ///    all data cache levels. The cache-coherency state is set to exclusive.
 ///    Data can be read from and written to the cache line without additional
@@ -66,6 +65,5 @@ _m_prefetchw(void *__P)
 {
   __builtin_prefetch (__P, 1, 3 /* _MM_HINT_T0 */);
 }
-#endif
 
 #endif /* __PRFCHWINTRIN_H */

Modified: cfe/trunk/lib/Headers/smmintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/smmintrin.h?rev=332830&r1=332829&r2=332830&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/smmintrin.h (original)
+++ cfe/trunk/lib/Headers/smmintrin.h Sun May 20 23:07:49 2018
@@ -2458,8 +2458,6 @@ _mm_crc32_u64(unsigned long long __C, un
 
 #undef __DEFAULT_FN_ATTRS
 
-#ifdef __POPCNT__
 #include <popcntintrin.h>
-#endif
 
 #endif /* __SMMINTRIN_H */




More information about the cfe-commits mailing list