diff options
author | Nico Weber <nicolasweber@gmx.de> | 2016-05-16 18:14:07 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2016-05-16 18:14:07 +0000 |
commit | ce2e20c483ad6ed39c9a8e5a6804a0f9e5986ae5 (patch) | |
tree | e4b63de49708a64ea071faf924e6cdb5c193180e /lib/Headers/x86intrin.h | |
parent | e57f2755bb3466c51d674b5e71c5a231a2533a38 (diff) |
[ms] Reintroduce feature guards in intrinsic headers in Microsoft mode
Visual Studio's C++ standard library headers include intrin.h, so the intrinsic
headers get included a lot more often in Microsoft mode than elsewhere. The
AVX512 intrinsics are a lot of code (0.7 MB, causing 30% compile time overhead
for small programs including e.g. <string> and 6% compile time overhead for
larger projects like e.g. v8). Since multiversioning can't be relied on in
Microsoft mode (cl.exe doesn't support it), having faster compiles seems like
the much better tradeoff until we have a better intrinsic story going forward
(which we'll need for e.g. PR19898).
Actually using intrinsics on Windows already requires the right /arch:
settings, so this patch should have no big behavior change.
See also thread "The intrinsics headers (especially avx512) are too big. What
to do about it?" on cfe-dev.
http://reviews.llvm.org/D20291
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269675 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Headers/x86intrin.h')
-rw-r--r-- | lib/Headers/x86intrin.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/Headers/x86intrin.h b/lib/Headers/x86intrin.h index 4d8077e382..6f3c8c4f3f 100644 --- a/lib/Headers/x86intrin.h +++ b/lib/Headers/x86intrin.h @@ -28,29 +28,53 @@ #include <immintrin.h> +#if !defined(_MSC_VER) || __has_feature(modules) || defined(__3dNOW__) #include <mm3dnow.h> +#endif +#if !defined(_MSC_VER) || __has_feature(modules) || defined(__BMI__) #include <bmiintrin.h> +#endif +#if !defined(_MSC_VER) || __has_feature(modules) || defined(__BMI2__) #include <bmi2intrin.h> +#endif +#if !defined(_MSC_VER) || __has_feature(modules) || defined(__LZCNT__) #include <lzcntintrin.h> +#endif +#if !defined(_MSC_VER) || __has_feature(modules) || defined(__POPCNT__) #include <popcntintrin.h> +#endif +#if !defined(_MSC_VER) || __has_feature(modules) || defined(__RDSEED__) #include <rdseedintrin.h> +#endif +#if !defined(_MSC_VER) || __has_feature(modules) || defined(__PRFCHW__) #include <prfchwintrin.h> +#endif +#if !defined(_MSC_VER) || __has_feature(modules) || defined(__SSE4A__) #include <ammintrin.h> +#endif +#if !defined(_MSC_VER) || __has_feature(modules) || defined(__FMA4__) #include <fma4intrin.h> +#endif +#if !defined(_MSC_VER) || __has_feature(modules) || defined(__XOP__) #include <xopintrin.h> +#endif +#if !defined(_MSC_VER) || __has_feature(modules) || defined(__TBM__) #include <tbmintrin.h> +#endif +#if !defined(_MSC_VER) || __has_feature(modules) || defined(__F16C__) #include <f16cintrin.h> +#endif /* FIXME: LWP */ |