File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -219,8 +219,11 @@ class LLVM_LIBRARY_VISIBILITY BaseSPIRTargetInfo : public TargetInfo {
219219 setAddressSpaceMap (
220220 /* DefaultIsGeneric=*/ Opts.SYCLIsDevice ||
221221 // The address mapping from HIP/CUDA language for device code is only
222- // defined for SPIR-V.
223- (getTriple ().isSPIRV () && Opts.CUDAIsDevice ));
222+ // defined for SPIR-V, and all Intel SPIR-V code should have the default
223+ // AS as generic.
224+ (getTriple ().isSPIRV () &&
225+ (Opts.CUDAIsDevice ||
226+ getTriple ().getVendor () == llvm::Triple::Intel)));
224227 }
225228
226229 void setSupportedOpenCLOpts () override {
Original file line number Diff line number Diff line change 1+ // RUN: %clang_cc1 -triple spirv64-intel %s -emit-llvm -o - | FileCheck -check-prefix=CHECK-WITH %s
2+ // RUN: %clang_cc1 -triple spirv32-intel %s -emit-llvm -o - | FileCheck -check-prefix=CHECK-WITH %s
3+ // RUN: %clang_cc1 -triple spir-intel %s -emit-llvm -o - | FileCheck -check-prefix=CHECK-WITHOUT %s
4+ // RUN: %clang_cc1 -triple spir64-intel %s -emit-llvm -o - | FileCheck -check-prefix=CHECK-WITHOUT %s
5+
6+ // CHECK-WITH: spir_func void @foo(ptr addrspace(4) noundef %param) #0 {
7+ // CHECK-WITHOUT: spir_func void @foo(ptr noundef %param) #0 {
8+ void foo (int * param ) {
9+ }
You can’t perform that action at this time.
0 commit comments