================
@@ -313,6 +314,12 @@ class LLVM_LIBRARY_VISIBILITY BaseSPIRVTargetInfo : public 
BaseSPIRTargetInfo {
     return Feature == "spirv";
   }
 
+  // The LLVM SPIR-V backend defines no processors and accepts only "generic";
+  // The -target-cpu value used in BaseSPIRTargetInfo is only used by the
+  // frontend, and the backend / createTargetMachine should not use this
+  // -target-cpu value to (attempt to) construct an LLVM TargetMachine.
+  StringRef getBackendCPU() const override { return StringRef(); }
----------------
ianayl wrote:

It turns out `-target-cpu` values are also used to create the `TargetMachine` 
used to emit LLVM/assembly; Since the [LLVM SPIRV target only accepts a 
`generic` CPU 
currently](https://github.com/ianayl/llvm-project/blob/sycl/IGCA/arch-preprocessor-defs/llvm/lib/Target/SPIRV/SPIRV.td#L24),
 I opted to make `-target-cpu` not reach `createTargetMachine` instead, but 
please let me know if this is the wrong move here.

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