[HIPSPV][3/4] Enable SPIR-V emission for HIPThis patch enables SPIR-V binary emission for HIP device code via theHIPSPV tool chain.‘--offload’ option, which is envisioned in [1], is added for sp
[HIPSPV][3/4] Enable SPIR-V emission for HIPThis patch enables SPIR-V binary emission for HIP device code via theHIPSPV tool chain.‘--offload’ option, which is envisioned in [1], is added for specifyingoffload targets. This option is used to override default device target(amdgcn-amd-amdhsa) for HIP compilation for emitting device code asSPIR-V binary. The option is handled in getHIPOffloadTargetTriple().getOffloadingDeviceToolChain() function (based on the design in theSYCL repository) is added to select HIPSPVToolChain when HIP offloadtarget is ‘spirv64’.The HIPActionBuilder is modified to produce LLVM IR at the backendphase. HIPSPV tool chain expects to receive HIP device code as LLVMIR so it can run external LLVM passes over them. HIPSPV TC is alsoresponsible for emitting the SPIR-V binary.A Cuda GPU architecture ‘generic’ is added. The name is picked fromthe LLVM SPIR-V Backend. In the HIPSPV code path the architecturename is inserted to the bundle entry ID as target ID. Target ID isexpected to be always present so a component in the target tripleis not mistaken as target ID.Tests are added for checking the HIPSPV tool chain.[1]: https://lists.llvm.org/pipermail/cfe-dev/2020-December/067362.htmlPatch by: Henry LinjamäkiReviewed by: Yaxun Liu, Artem Belevich, Alexey BaderDifferential Revision: https://reviews.llvm.org/D110622
show more ...