This is an archive of the discontinued LLVM Phabricator instance.

[libc] Install GPU headers to `gpu-none-llvm/` subfolder
ClosedPublic

Authored by jhuber6 on Mar 27 2023, 8:05 AM.

Details

Summary

The GPU support for the libc generates all its own headers. Since
these headers use the same names as the system headers we need to make
sure that they are separate. Currently, we either use the system headers
on the GPU or the GPU headers on the system. This patch makes them
explicitly separate. A follow-up patch will then make clang look in
this folder by default.

Diff Detail

Event Timeline

jhuber6 created this revision.Mar 27 2023, 8:05 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMar 27 2023, 8:05 AM
jhuber6 requested review of this revision.Mar 27 2023, 8:05 AM
lntue accepted this revision.Mar 27 2023, 8:52 AM
This revision is now accepted and ready to land.Mar 27 2023, 8:52 AM

I prefer a name which is more in line with the triple formats listed here: https://clang.llvm.org/docs/CrossCompilation.html#target-triple

  1. gpu-none-llvm
  2. gpu-amd-none-llvm or gpu-nvidia-none-llvm

I prefer a name which is more in line with the triple formats listed here: https://clang.llvm.org/docs/CrossCompilation.html#target-triple

  1. gpu-none-llvm
  2. gpu-amd-none-llvm or gpu-nvidia-none-llvm

These should be common between the gpu architecture, any target specific stuff should be hidden behind the __NVPTX__ and __AMDGPU__ macros. I'm in favor of gpu-llvm or llvm-gpu however. Since it makes it clear that these are GPU specific headers, separate from the system headers, and they were provided by and used in the LLVM toolchain.

These should be common between the gpu architecture, any target specific stuff should be hidden behind the __NVPTX__ and __AMDGPU__ macros. I'm in favor of gpu-llvm or llvm-gpu however. Since it makes it clear that these are GPU specific headers, separate from the system headers, and they were provided by and used in the LLVM toolchain.

I think gpu-llvm is almost ideal: It is for the GPU target and contains LLVM related/specific bits. Since target triples normally contains three components, I am tempted to say this should be gpu-none-llvm. The none kind of also indicates it is vendor agnostic.

I think gpu-llvm is almost ideal: It is for the GPU target and contains LLVM related/specific bits. Since target triples normally contains three components, I am tempted to say this should be gpu-none-llvm. The none kind of also indicates it is vendor agnostic.

Works for me.

I think gpu-llvm is almost ideal: It is for the GPU target and contains LLVM related/specific bits. Since target triples normally contains three components, I am tempted to say this should be gpu-none-llvm. The none kind of also indicates it is vendor agnostic.

Works for me.

OK with this change.

jhuber6 updated this revision to Diff 509086.Mar 28 2023, 11:39 AM

Changing to gpu-none-llvm.

sivachandra accepted this revision.Mar 28 2023, 11:44 AM

Update the commit message.

jhuber6 retitled this revision from [libc] Install GPU headers to `llvm-libc/` subfolder to [libc] Install GPU headers to `gpu-none-llvm/` subfolder.Mar 28 2023, 11:44 AM
This revision was automatically updated to reflect the committed changes.