[PATCH] D25337: [Modules] Add a command line option for enabling the modules feature exclusively for the Clang builtins.

Elad Cohen via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 19 06:07:33 PDT 2016


eladcohen added a comment.

In https://reviews.llvm.org/D25337#571845, @bruno wrote:

> > The long answer is that there is a history of problems regarding the intrinsic files:
> >  http://lists.llvm.org/pipermail/cfe-dev/2016-May/048837.html
> >  http://lists.llvm.org/pipermail/cfe-dev/2016-September/050943.html
> >  Mainly compatibility issues because MSVC makes all the intrinsics available all the time, while in clang this is not always the case (On Windows the different h files are not-included unless asked for explicitly since AVX512 was added which impacted compile-time).
>
> Thinking a bit more about this: did you ever consider a solution where "immintrin.h" (or any similar other) would use "#include_next" and "__has_include_next" to point to a second level (user specified) immintrin.h, which then could use ifdefs to only include what's relevant?


I don't think we really want the users to have to maintain an updated user specific version of immintrin.h. Moreover, I think that at the end we actually do want clang to always include all the intrinsics same as MSVC.

>> A suggestion was made to try and mitigate this by reducing the compile time using modules (only for the x86 intrinsics). This patch aims at adding this option. The new compile flag is just a milestone - if all goes well, we can turn this on by default (Then we won't actually need to use a specific compile flag, and we could always include all the intrinsic h files without their long compile time).
> 
> The speedup sounds nice, but it seems awkward IMO to have such specific behavior for x86 intrinsics only.

The feature itself is not x86 specific. It can be used for all the clang builtins. As for enabling it by default, I did have only x86 in mind but it can be done for all targets as well. (will probably require checking that all the other intrinsic headers are modular and that the modulemap is up to date).


https://reviews.llvm.org/D25337





More information about the cfe-commits mailing list