[clang] [llvm] [Clang][SYCL] Define Intel IGCA preprocessor macro definitions for SYCL during device compilation (PR #227877)

Tom Honermann via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 8 12:32:06 PST 2026


================
@@ -0,0 +1,30 @@
+// SPIRV offload arch names accepted via -target-cpu should not be forwarded
+// to LLVM backend: The SPIRV backend only defines a "generic" processor, and
+// any other name forwarded results in a "not a recognized processor"
+// diagnostic. -target-cpu values are only used in the frontend for SPIRV.
+//
+// RUN: %clang_cc1 -triple spirv64-unknown-unknown -target-cpu igca_20ca -emit-llvm -o - %s 2>&1 \
+// RUN:   | FileCheck %s --check-prefix=IGCA
+// RUN: %clang_cc1 -triple spirv64-unknown-unknown -target-cpu xe-pvc -emit-llvm -o - %s 2>&1 \
+// RUN:   | FileCheck %s --check-prefix=XE
+// RUN: %clang_cc1 -triple spirv64-unknown-unknown -emit-llvm -o - %s 2>&1 \
+// RUN:   | FileCheck %s --check-prefix=NONE
+// RUN: %clang_cc1 -triple spirv32-unknown-unknown -target-cpu igca_20ca -emit-llvm -o - %s 2>&1 \
+// RUN:   | FileCheck %s --check-prefix=IGCA
+// RUN: %clang_cc1 -triple spirv32-unknown-unknown -target-cpu xe-pvc -emit-llvm -o - %s 2>&1 \
+// RUN:   | FileCheck %s --check-prefix=XE
+// RUN: %clang_cc1 -triple spirv32-unknown-unknown -emit-llvm -o - %s 2>&1 \
+// RUN:   | FileCheck %s --check-prefix=NONE
+
+int f(int x) { return x + 1; }
+
+// IGCA-NOT: not a recognized processor
+// IGCA: "target-cpu"="igca_20ca"
+// IGCA-NOT: not a recognized processor
+
+// XE-NOT: not a recognized processor
+// XE: "target-cpu"="xe-pvc"
+// XE-NOT: not a recognized processor
----------------
tahonermann wrote:

This `NOT` is redundant; the previous one would have already failed if this text was present.

https://github.com/llvm/llvm-project/pull/227877


More information about the cfe-commits mailing list