diff options
author | Joseph Huber <jhuber6@vols.utk.edu> | 2023-06-14 16:58:11 -0500 |
---|---|---|
committer | Joseph Huber <jhuber6@vols.utk.edu> | 2023-06-15 07:06:44 -0500 |
commit | e96bec9cd8e14ee2174490c0ce09cedfcd6be79e (patch) | |
tree | 79c71adcdae6960ba5fd7521f4971337c39ef946 /clang/lib/Driver/Driver.cpp | |
parent | a09bec6459331e7f949c2ed3df6102de52d25f5d (diff) | |
download | llvm-e96bec9cd8e14ee2174490c0ce09cedfcd6be79e.zip llvm-e96bec9cd8e14ee2174490c0ce09cedfcd6be79e.tar.gz llvm-e96bec9cd8e14ee2174490c0ce09cedfcd6be79e.tar.bz2 |
[OpenMP] Correctly diagnose conflicting target identifierers for AMDGPU
There are static checks on the target identifiers allowed in a single
TU. Previously theses checks were only applied to HIP even though they
should be the same for OpenMP targeting AMDGPU. Simply enable these
checks for OpenMP.
Reviewed By: JonChesterfield, yaxunl
Differential Revision: https://reviews.llvm.org/D152965
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r-- | clang/lib/Driver/Driver.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 8f92606..9fc62be 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -4313,8 +4313,8 @@ static StringRef getCanonicalArchString(Compilation &C, /// incompatible pair if a conflict occurs. static std::optional<std::pair<llvm::StringRef, llvm::StringRef>> getConflictOffloadArchCombination(const llvm::DenseSet<StringRef> &Archs, - Action::OffloadKind Kind) { - if (Kind != Action::OFK_HIP) + llvm::Triple Triple) { + if (!Triple.isAMDGPU()) return std::nullopt; std::set<StringRef> ArchSet; @@ -4399,7 +4399,8 @@ Driver::getOffloadArchs(Compilation &C, const llvm::opt::DerivedArgList &Args, } } - if (auto ConflictingArchs = getConflictOffloadArchCombination(Archs, Kind)) { + if (auto ConflictingArchs = + getConflictOffloadArchCombination(Archs, TC->getTriple())) { C.getDriver().Diag(clang::diag::err_drv_bad_offload_arch_combo) << ConflictingArchs->first << ConflictingArchs->second; C.setContainsError(); |