diff --git a/clang/lib/Headers/cmpccxaddintrin.h b/clang/lib/Headers/cmpccxaddintrin.h --- a/clang/lib/Headers/cmpccxaddintrin.h +++ b/clang/lib/Headers/cmpccxaddintrin.h @@ -7,9 +7,10 @@ * *===-----------------------------------------------------------------------=== */ -#ifndef __IMMINTRIN_H -#error "Never use directly; include instead." -#endif // __IMMINTRIN_H +#ifndef __X86GPRINTRIN_H +#error \ + "Never use directly; include instead." +#endif // __X86GPRINTRIN_H #ifndef __CMPCCXADDINTRIN_H #define __CMPCCXADDINTRIN_H diff --git a/clang/lib/Headers/immintrin.h b/clang/lib/Headers/immintrin.h --- a/clang/lib/Headers/immintrin.h +++ b/clang/lib/Headers/immintrin.h @@ -528,11 +528,6 @@ #include #endif -#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ - defined(__CMPCCXADD__) -#include -#endif - #if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ defined(__KL__) || defined(__WIDEKL__) #include diff --git a/clang/lib/Headers/x86gprintrin.h b/clang/lib/Headers/x86gprintrin.h --- a/clang/lib/Headers/x86gprintrin.h +++ b/clang/lib/Headers/x86gprintrin.h @@ -35,6 +35,11 @@ #include #endif +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__CMPCCXADD__) +#include +#endif + #if defined(__i386__) #define __SAVE_GPRBX "mov {%%ebx, %%eax |eax, ebx};" #define __RESTORE_GPRBX "mov {%%eax, %%ebx |ebx, eax};"