This is an archive of the discontinued LLVM Phabricator instance.

Add header guards for header files that should not be included on the PS4 platform
ClosedPublic

Authored by dyung on Apr 30 2020, 11:53 AM.

Details

Summary

For the PS4 platform, we want to exclude certain headers from being included because we do not support the features they provide. To achieve this, we do not include any header files by default, and rely on the cpu target features to selectively enable supported header files. Compilers targeting the PS4 define SCE and individual features will be set automatically by the compiler's -target-cpu option (btver2 for the PS4).

The test change is needed because with this change, the test was failing because our SCE define was excluding everything, and there is no corresponding -target-cpu specified by the test to turn individual features back on. When no -target-cpu is selected, a generic cpu is assumed by the compiler with no additional feature support enabled. The fix I am adding is explicitly running each command with both 32/64bit generic triples.

Diff Detail

Event Timeline

dyung created this revision.Apr 30 2020, 11:53 AM
craig.topper added inline comments.Apr 30 2020, 1:36 PM
clang/test/Headers/x86intrin-2.c
3

I'm not sure why we need a version with and without -flax-vector-conversions=none. "none" is the strictest setting I think. So if we pass with that why do we need to check without it?

dyung added inline comments.Apr 30 2020, 2:38 PM
clang/test/Headers/x86intrin-2.c
3

I'm not sure, I didn't add that test, I only took the existing RUN lines and duplicated each to run with an i386/x86-64 generic triple.

craig.topper accepted this revision.Apr 30 2020, 3:38 PM
craig.topper added inline comments.
clang/test/Headers/x86intrin-2.c
3

Looks like its been like that since the commit that added it. Let's leave it alone.

7

We don't need the x86-registered-target if we're not running IR passes do we?

This revision is now accepted and ready to land.Apr 30 2020, 3:38 PM
dyung updated this revision to Diff 261385.Apr 30 2020, 4:14 PM

Removed REQUIRES line in test since it is not needed

dyung marked 2 inline comments as done.Apr 30 2020, 4:14 PM
dyung added inline comments.
clang/test/Headers/x86intrin-2.c
7

You're right, it isn't needed. I've removed it in the new revision that I'll submit. Thanks!

This revision was automatically updated to reflect the committed changes.
dyung marked an inline comment as done.