This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add support for __builtin_cpu_init
ClosedPublic

Authored by craig.topper on Aug 4 2017, 12:35 PM.

Details

Summary

This adds builtin_cpu_init which will emit a call to cpu_indicator_init in libgcc or compiler-rt.

This is needed to support builtin_cpu_supports/builtin_cpu_is in an ifunc resolver.

Diff Detail

Event Timeline

craig.topper created this revision.Aug 4 2017, 12:35 PM
echristo accepted this revision.Aug 27 2017, 10:08 PM

One inline comment, but go ahead and commit after fixing that up.

lib/CodeGen/CGBuiltin.cpp
7292

I realize it makes sense to put this here because it doesn't require the setup, but let's go ahead and just put it in the switch statement below. I don't think avoiding the bit of setup/etc below is worth the inconsistency. :)

This revision is now accepted and ready to land.Aug 27 2017, 10:08 PM
This revision was automatically updated to reflect the committed changes.