[clang] [clang][Driver][HIP] Add support for mixing AMDGCNSPIRV & concrete `offload-arch`s. (PR #113509)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 23 17:20:27 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 33363521ca24f912cc25530f6cecbca53acce8a3 4a18bbc256051f30805620f65a4db037ea2fe96c --extensions cpp -- clang/lib/Driver/Driver.cpp clang/lib/Driver/ToolChain.cpp clang/lib/Driver/ToolChains/HIPAMD.cpp clang/lib/Driver/ToolChains/HIPUtility.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 1590fbad5e..a24168306f 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -3473,9 +3473,10 @@ class OffloadingActionBuilder final {
llvm::StringMap<bool> Features;
// getHIPOffloadTargetTriple() is known to return valid value as it has
// been called successfully in the CreateOffloadingDeviceToolChains().
- auto T = (IdStr == "amdgcnspirv") ?
- llvm::Triple("spirv64-amd-amdhsa") :
- *getHIPOffloadTargetTriple(C.getDriver(), C.getInputArgs());
+ auto T =
+ (IdStr == "amdgcnspirv")
+ ? llvm::Triple("spirv64-amd-amdhsa")
+ : *getHIPOffloadTargetTriple(C.getDriver(), C.getInputArgs());
auto ArchStr = parseTargetID(T, IdStr, &Features);
if (!ArchStr) {
C.getDriver().Diag(clang::diag::err_drv_bad_target_id) << IdStr;
``````````
</details>
https://github.com/llvm/llvm-project/pull/113509
More information about the cfe-commits
mailing list