[clang] [Clang] Do not emit multi-gpu warning if they are all the same (PR #185490)
Joseph Huber via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 10 05:29:44 PDT 2026
================
@@ -735,11 +736,10 @@ AMDGPUToolChain::TranslateArgs(const DerivedArgList &Args, StringRef BoundArch,
<< llvm::toString(GPUsOrErr.takeError()) << "-mcpu";
} else {
auto &GPUs = *GPUsOrErr;
- if (GPUs.size() > 1) {
+ if (llvm::SmallSet<std::string, 1>(GPUs.begin(), GPUs.end()).size() > 1)
----------------
jhuber6 wrote:
Returned value is a `SmallVector<std::string>` because it's supposed to be in the same order that `offload-arch` returns. Could make that use a `SmallString<>` instead, but that's a bit more of a refactoring.
https://github.com/llvm/llvm-project/pull/185490
More information about the cfe-commits
mailing list