Avoid including intrin.h from MathExtras.h

This is repeatably worth 0.3s compile time on MathExtras.cpp. This is a
very popular header, and it basically pulls all Intel intrinsics into
every LLVM TU. Let's not do that.

llvm-svn: 335406
This commit is contained in:
Reid Kleckner 2018-06-23 01:19:49 +00:00
parent 4ef42a83f9
commit 5c25346912
1 changed files with 10 additions and 4 deletions

View File

@ -23,14 +23,20 @@
#include <limits>
#include <type_traits>
#ifdef _MSC_VER
#include <intrin.h>
#endif
#ifdef __ANDROID_NDK__
#include <android/api-level.h>
#endif
#ifdef _MSC_VER
// Declare these intrinsics manually rather including intrin.h. It's very
// expensive, and MathExtras.h is popular.
// #include <intrin.h>
extern "C" {
unsigned char _BitScanForward(unsigned long *_Index, unsigned long _Mask);
unsigned char _BitScanForward64(unsigned long *_Index, unsigned __int64 _Mask);
}
#endif
namespace llvm {
/// The behavior an operation has on an input of 0.
enum ZeroBehavior {