================
@@ -326,6 +333,16 @@ class LLVM_LIBRARY_VISIBILITY BaseSPIRVTargetInfo : public 
BaseSPIRTargetInfo {
 
   void getTargetDefines(const LangOptions &Opts,
                         MacroBuilder &Builder) const override;
+
+protected:
+  bool isSupportedOffloadArch(OffloadArch Arch) const override {
+    // Chipstar, vulkan, and amdhsa triples shouldn't accept a -target-cpu.
+    if (getTriple().getOS() != llvm::Triple::UnknownOS)
+      return false;
+
+    // Valid offload archs for SPIRV:
+    return Arch.isGeneric() || Arch.isIntel();
+  }
----------------
ianayl wrote:

Instead of making offload targets, i.e. SPIRV accept all parseable offload 
architectures, I chose to restrict to only the following offload archs. Please 
let me know if my logic here is wrong.

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

Reply via email to