[clang] [llvm] [Clang][SYCL] Define Intel IGCA preprocessor macro definitions for SYCL during device compilation (PR #227877)
Ian Li via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 5 12:02:38 PST 2026
================
@@ -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
More information about the cfe-commits
mailing list