[clang] Add SPIRV support to HIPAMD toolchain (PR #75357)

2024-01-03 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > How about using `--offload=` which can take a target triple? E.g. > > * `--offload=spirv64-amd` or something like that: pick HIPAMD tool chain. > > * `--offload=spirv64`: pick HIPSPV tool chain. > > > And also remove this >

[clang] Add SPIRV support to HIPAMD toolchain (PR #75357)

2024-01-03 Thread Henry Linjamäki via cfe-commits
linehill wrote: > > Perhaps we should consider prefixing it in some way (e.g. `hip-spirv` or > > `amd-spirv`) that leaves the door open for some special handling (enable a > > particular set of extensions only for amdgpu targeting SPIRV, try to deal > > with missing builtins etc.) /

[clang] Add SPIRV support to HIPAMD toolchain (PR #75357)

2023-12-14 Thread Yaxun Liu via cfe-commits
@@ -209,6 +210,13 @@ void AMDGCN::Linker::ConstructJob(Compilation , const JobAction , if (JA.getType() == types::TY_LLVM_BC) return constructLlvmLinkCommand(C, JA, Inputs, Output, Args); + if (Args.getLastArgValue(options::OPT_mcpu_EQ) == "generic") { +

[clang] Add SPIRV support to HIPAMD toolchain (PR #75357)

2023-12-14 Thread Yaxun Liu via cfe-commits
@@ -209,6 +210,13 @@ void AMDGCN::Linker::ConstructJob(Compilation , const JobAction , if (JA.getType() == types::TY_LLVM_BC) return constructLlvmLinkCommand(C, JA, Inputs, Output, Args); + if (Args.getLastArgValue(options::OPT_mcpu_EQ) == "generic") { +

[clang] Add SPIRV support to HIPAMD toolchain (PR #75357)

2023-12-14 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > > > > Is generic the best name here? I feel like that's going to be heavily > > > > overloaded. I'd much prefer a new architecture that just treats > > > > "SPIR-V" as a single architecture. E.g. `--offload-arch=spirv` or > > > > something. > > > > > > For HIPAMD

[clang] Add SPIRV support to HIPAMD toolchain (PR #75357)

2023-12-13 Thread Joseph Huber via cfe-commits
@@ -209,6 +210,13 @@ void AMDGCN::Linker::ConstructJob(Compilation , const JobAction , if (JA.getType() == types::TY_LLVM_BC) return constructLlvmLinkCommand(C, JA, Inputs, Output, Args); + if (Args.getLastArgValue(options::OPT_mcpu_EQ) == "generic") { +

[clang] Add SPIRV support to HIPAMD toolchain (PR #75357)

2023-12-13 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > Perhaps we should consider prefixing it in some way (e.g. `hip-spirv` or > `amd-spirv`) that leaves the door open for some special handling (enable a > particular set of extensions only for amdgpu targeting SPIRV, try to deal > with missing builtins etc.) / flexibility?

[clang] Add SPIRV support to HIPAMD toolchain (PR #75357)

2023-12-13 Thread Alex Voicu via cfe-commits
@@ -209,6 +210,13 @@ void AMDGCN::Linker::ConstructJob(Compilation , const JobAction , if (JA.getType() == types::TY_LLVM_BC) return constructLlvmLinkCommand(C, JA, Inputs, Output, Args); + if (Args.getLastArgValue(options::OPT_mcpu_EQ) == "generic") { +

[clang] Add SPIRV support to HIPAMD toolchain (PR #75357)

2023-12-13 Thread Alex Voicu via cfe-commits
AlexVlx wrote: > > > Is generic the best name here? I feel like that's going to be heavily > > > overloaded. I'd much prefer a new architecture that just treats "SPIR-V" > > > as a single architecture. E.g. `--offload-arch=spirv` or something. > > For HIPAMD toolchain,

[clang] Add SPIRV support to HIPAMD toolchain (PR #75357)

2023-12-13 Thread Joseph Huber via cfe-commits
jhuber6 wrote: I feel like we should treat `spirv` in the same way we handle stuff like `sm_90` in the `CudaArch` enum. (We should probably also rename that as it's used for generic offloading now). OpenMP infers the triple from the arch, so in the future when OpenMP can handle SPIR-V we can

[clang] Add SPIRV support to HIPAMD toolchain (PR #75357)

2023-12-13 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > > Is generic the best name here? I feel like that's going to be heavily > > overloaded. I'd much prefer a new architecture that just treats "SPIR-V" as > > a single architecture. E.g. `--offload-arch=spirv` or something. For HIPAMD toolchain, `--offload-arch=generic` and

[clang] Add SPIRV support to HIPAMD toolchain (PR #75357)

2023-12-13 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > Is generic the best name here? I feel like that's going to be heavily > overloaded. I'd much prefer a new architecture that just treats "SPIR-V" as a > single architecture. E.g. `--offload-arch=spirv` or something. https://github.com/llvm/llvm-project/pull/75357

[clang] Add SPIRV support to HIPAMD toolchain (PR #75357)

2023-12-13 Thread Joseph Huber via cfe-commits
jhuber6 wrote: Is generic the best name here? I feel like that's going to be heavily overloaded. https://github.com/llvm/llvm-project/pull/75357 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] Add SPIRV support to HIPAMD toolchain (PR #75357)

2023-12-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Yaxun (Sam) Liu (yxsamliu) Changes Make changes to clang driver and HIPAMD to allow compile HIP programs to SPIRV with HIPAMD toolchain. --- Full diff: https://github.com/llvm/llvm-project/pull/75357.diff 8 Files Affected: -

[clang] Add SPIRV support to HIPAMD toolchain (PR #75357)

2023-12-13 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/75357 Make changes to clang driver and HIPAMD to allow compile HIP programs to SPIRV with HIPAMD toolchain. >From 953685cdefdb12d5e477b107e88a1c3389eb2bb5 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Wed,