File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -376,9 +376,18 @@ class LLVM_LIBRARY_VISIBILITY SPIRV64TargetInfo : public BaseSPIRVTargetInfo {
376376 }
377377
378378 std::optional<LangAS> getConstantAddressSpace () const override {
379+ return ConstantAS;
380+ }
381+ void adjust (DiagnosticsEngine &Diags, LangOptions &Opts) override {
382+ BaseSPIRVTargetInfo::adjust (Diags, Opts);
379383 // opencl_constant will map to UniformConstant in SPIR-V
380- return LangAS::opencl_constant;
384+ if (Opts.OpenCL )
385+ ConstantAS = LangAS::opencl_constant;
381386 }
387+
388+ private:
389+ // opencl_global will map to CrossWorkgroup in SPIR-V
390+ LangAS ConstantAS = LangAS::opencl_global;
382391};
383392
384393class LLVM_LIBRARY_VISIBILITY SPIRV64AMDGCNTargetInfo final
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ extern int printf(char[]);
55
66#pragma omp declare target
77// CHECK: @global = addrspace(1) global i32 0, align 4
8- // CHECK: @.str = private unnamed_addr addrspace(2 ) constant [4 x i8] c"foo\00", align 1f
8+ // CHECK: @.str = private unnamed_addr addrspace(1 ) constant [4 x i8] c"foo\00", align 1
99int global = 0 ;
1010#pragma omp end declare target
1111int main () {
You can’t perform that action at this time.
0 commit comments