================
@@ -4108,6 +4108,18 @@ Driver::getOffloadArchs(Compilation &C, const 
llvm::opt::DerivedArgList &Args,
   return Result;
 }
 
+llvm::SmallVector<BoundArch>
+Driver::getOffloadArchs(Compilation &C, const llvm::opt::DerivedArgList &Args,
+                        Action::OffloadKind Kind, const ToolChain &TC) const {
+  // Compute the architectures once per tool chain and offload kind, so native
+  // GPU detection runs and its diagnostics are emitted only once.
+  std::optional<llvm::SmallVector<BoundArch>> &Cached =
+      C.getCachedOffloadArchs(&TC, Kind);
+  if (!Cached)
+    Cached = computeOffloadArchs(C, Args, Kind, TC);
----------------
srividya-sundaram wrote:

Fixed.

https://github.com/llvm/llvm-project/pull/232148
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to