[PATCH 12/79] Deprecate SPV_INTEL_non_constant_addrspace_printf extension (#1818)
authorViktoria Maximova <viktoria.maksimova@intel.com>
Sat, 21 Jan 2023 20:45:36 +0000 (21:45 +0100)
committerAndreas Beckmann <anbe@debian.org>
Thu, 14 Mar 2024 19:01:08 +0000 (20:01 +0100)
This change continues #1749.
We are removing SPV_INTEL_non_constant_addrspace_printf extension in
favor of SPV_EXT_relaxed_printf_string_address_space, which are
basically the same.

Signed-off-by: Maksimova, Viktoria <viktoria.maksimova@intel.com>
Gbp-Pq: Name 0012-Deprecate-SPV_INTEL_non_constant_addrspace_printf-ex.patch

include/LLVMSPIRVExtensions.inc
lib/SPIRV/SPIRVWriter.cpp
lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h
lib/SPIRV/libSPIRV/spirv_internal.hpp
test/extensions/EXT/SPV_EXT_relaxed_printf_string_address_space/non-constant-printf.ll [deleted file]
test/transcoding/SPV_EXT_relaxed_printf_string_address_space/non-constant-printf.ll [new file with mode: 0644]
test/transcoding/SPV_INTEL_non_constant_addrspace_printf/non-constant-printf.ll [deleted file]

index a6cf69b12bd5c057bf7488343b8c23e92610b0b7..bbb2c2010fa541527c1ba4cba2c0fc94c62b05b0 100644 (file)
@@ -51,7 +51,6 @@ EXT(SPV_INTEL_bfloat16_conversion)
 EXT(SPV_INTEL_joint_matrix)
 EXT(SPV_INTEL_hw_thread_queries)
 EXT(SPV_INTEL_global_variable_decorations)
-EXT(SPV_INTEL_non_constant_addrspace_printf)
 EXT(SPV_INTEL_complex_float_mul_div)
 EXT(SPV_INTEL_split_barrier)
 EXT(SPV_INTEL_tensor_float32_conversion)
index fcab77cd1c583ccd79f770259d028e4086c471f2..13d2a314693b2b50ff084954de3bdd9b28e639cd 100644 (file)
@@ -4025,26 +4025,18 @@ SPIRVValue *LLVMToSPIRVBase::transDirectCallInst(CallInst *CI,
       auto *FormatStrPtr = cast<PointerType>(CI->getArgOperand(0)->getType());
       if (FormatStrPtr->getAddressSpace() !=
           SPIR::TypeAttributeEnum::ATTR_CONST) {
-        if (BM->isAllowedToUseExtension(
+        if (!BM->isAllowedToUseExtension(
                 ExtensionID::SPV_EXT_relaxed_printf_string_address_space)) {
-          BM->addExtension(
-              ExtensionID::SPV_EXT_relaxed_printf_string_address_space);
-        } else if (BM->isAllowedToUseExtension(
-                       ExtensionID::SPV_INTEL_non_constant_addrspace_printf)) {
-          BM->addExtension(
-              ExtensionID::SPV_INTEL_non_constant_addrspace_printf);
-          BM->addCapability(
-              internal::CapabilityNonConstantAddrspacePrintfINTEL);
-        } else {
           std::string ErrorStr =
-              "Either SPV_EXT_relaxed_printf_string_address_space or "
-              "SPV_INTEL_non_constant_addrspace_printf extension should be "
-              "allowed to translate this module, because this LLVM module "
-              "contains the printf function with format string, whose address "
-              "space is not equal to 2 (constant).";
+              "Either SPV_EXT_relaxed_printf_string_address_space extension "
+              "should be allowed to translate this module, because this LLVM "
+              "module contains the printf function with format string, whose "
+              "address space is not equal to 2 (constant).";
           getErrorLog().checkError(false, SPIRVEC_RequiresExtension, CI,
                                    ErrorStr);
         }
+        BM->addExtension(
+            ExtensionID::SPV_EXT_relaxed_printf_string_address_space);
       }
     }
 
index d73fdee7b68636ad2b7d467b48293a6df71e78fb..0d94b0fa7c21b1eca6339bfcdcdf605ce48cea89 100644 (file)
@@ -614,8 +614,6 @@ template <> inline void SPIRVMap<Capability, std::string>::init() {
   add(internal::CapabilityHWThreadQueryINTEL, "HWThreadQueryINTEL");
   add(internal::CapabilityGlobalVariableDecorationsINTEL,
       "GlobalVariableDecorationsINTEL");
-  add(internal::CapabilityNonConstantAddrspacePrintfINTEL,
-      "NonConstantAddrspacePrintfINTEL");
   add(internal::CapabilityComplexFloatMulDivINTEL, "ComplexFloatMulDivINTEL");
   add(internal::CapabilityTensorFloat32ConversionINTEL,
       "TensorFloat32ConversionINTEL");
index 3938ac4cc2eebc2ff09e872acdf636a96b730939..a39633e33928ebfe0f1d9e2db7235e28525d6ddb 100644 (file)
@@ -78,7 +78,6 @@ enum InternalCapability {
   ICapabilityHWThreadQueryINTEL = 6134,
   ICapFPArithmeticFenceINTEL = 6144,
   ICapGlobalVariableDecorationsINTEL = 6146,
-  ICapabilityNonConstantAddrspacePrintfINTEL = 6411,
   ICapabilityComplexFloatMulDivINTEL = 6414,
   ICapabilityTensorFloat32ConversionINTEL = 6425,
   ICapabilityMaskedGatherScatterINTEL = 6427
@@ -121,8 +120,6 @@ _SPIRV_OP(Capability, HWThreadQueryINTEL)
 _SPIRV_OP(BuiltIn, SubDeviceIDINTEL)
 _SPIRV_OP(BuiltIn, GlobalHWThreadIDINTEL)
 
-_SPIRV_OP(Capability, NonConstantAddrspacePrintfINTEL)
-
 _SPIRV_OP(Capability, ComplexFloatMulDivINTEL)
 _SPIRV_OP(Op, ComplexFMulINTEL)
 _SPIRV_OP(Op, ComplexFDivINTEL)
diff --git a/test/extensions/EXT/SPV_EXT_relaxed_printf_string_address_space/non-constant-printf.ll b/test/extensions/EXT/SPV_EXT_relaxed_printf_string_address_space/non-constant-printf.ll
deleted file mode 100644 (file)
index d621949..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: not llvm-spirv %t.bc -o %t.spv 2>&1 | FileCheck %s --check-prefix=CHECK-WO-EXT
-
-; RUN: llvm-spirv -spirv-text %t.bc -o %t.spt --spirv-ext=+SPV_EXT_relaxed_printf_string_address_space,+SPV_INTEL_non_constant_addrspace_printf
-; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV
-
-; RUN: llvm-spirv -to-binary %t.spt -o %t.spv
-; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.rev.bc
-; RUN: llvm-dis %t.rev.bc -o %t.rev.ll
-; RUN: FileCheck < %t.rev.ll %s --check-prefix=CHECK-LLVM
-
-; CHECK-WO-EXT: RequiresExtension: Feature requires the following SPIR-V extension:
-; CHECK-WO-EXT: Either SPV_EXT_relaxed_printf_string_address_space or SPV_INTEL_non_constant_addrspace_printf extension should be allowed to translate this module, because this LLVM module contains the printf function with format string, whose address space is not equal to 2 (constant).
-
-; CHECK-SPIRV-NOT: Capability NonConstantAddrspacePrintfINTEL
-; CHECK-SPIRV-NOT: Extension "SPV_INTEL_non_constant_addrspace_printf"
-; CHECK-SPIRV: Extension "SPV_EXT_relaxed_printf_string_address_space"
-; CHECK-SPIRV: ExtInstImport [[#ExtInstSetId:]] "OpenCL.std"
-; CHECK-SPIRV: TypeInt [[#TypeInt8Id:]] 8 0
-; CHECK-SPIRV: TypeInt [[#TypeInt32Id:]] 32 0
-; CHECK-SPIRV: TypePointer [[#FunctionStorClassPtrTy:]] 7 [[#TypeInt8Id]]
-; CHECK-SPIRV: TypePointer [[#WGStorClassPtrTy:]] 5 [[#TypeInt8Id]]
-; CHECK-SPIRV: TypePointer [[#CrossWFStorClassPtrTy:]] 4 [[#TypeInt8Id]]
-; CHECK-SPIRV: TypePointer [[#GenericStorCalssPtrTy:]] 8 [[#TypeInt8Id]]
-; CHECK-SPIRV: InBoundsPtrAccessChain [[#FunctionStorClassPtrTy]] [[#GEP1:]]
-; CHECK-SPIRV: ExtInst [[#TypeInt32Id]] [[#]] [[#ExtInstSetId:]] printf [[#GEP1]]
-; CHECK-SPIRV: InBoundsPtrAccessChain [[#WGStorClassPtrTy]] [[#GEP2:]]
-; CHECK-SPIRV: ExtInst [[#TypeInt32Id]] [[#]] [[#ExtInstSetId:]] printf [[#GEP2]]
-; CHECK-SPIRV: InBoundsPtrAccessChain [[#CrossWFStorClassPtrTy:]] [[#GEP3:]]
-; CHECK-SPIRV: ExtInst [[#TypeInt32Id]] [[#]] [[#ExtInstSetId:]] printf [[#GEP3]]
-; CHECK-SPIRV: InBoundsPtrAccessChain [[#GenericStorCalssPtrTy:]] [[#GEP4:]]
-; CHECK-SPIRV: ExtInst [[#TypeInt32Id]] [[#]] [[#ExtInstSetId:]] printf [[#GEP4]]
-
-; CHECK-LLVM: call spir_func i32 @_Z18__spirv_ocl_printfPc(ptr {{.*}}
-; CHECK-LLVM: call spir_func i32 @_Z18__spirv_ocl_printfPU3AS1c(ptr addrspace(1) {{.*}}
-; CHECK-LLVM: call spir_func i32 @_Z18__spirv_ocl_printfPU3AS3c(ptr addrspace(3) {{.*}}
-; CHECK-LLVM: call spir_func i32 @_Z18__spirv_ocl_printfPU3AS4c(ptr addrspace(4) {{.*}}
-
-; ModuleID = 'non-constant-printf'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024"
-target triple = "spir-unknown-unknown"
-
-@0 = internal unnamed_addr addrspace(0) constant [6 x i8] c"Test\0A\00", align 1
-@1 = internal unnamed_addr addrspace(1) constant [6 x i8] c"Test\0A\00", align 1
-@2 = internal unnamed_addr addrspace(3) constant [6 x i8] c"Test\0A\00", align 1
-@3 = internal unnamed_addr addrspace(4) constant [6 x i8] c"Test\0A\00", align 1
-
-; Function Attrs: nounwind
-define spir_kernel void @test() #0 !kernel_arg_addr_space !3 !kernel_arg_access_qual !3 !kernel_arg_type !3 !kernel_arg_type_qual !3 !kernel_arg_base_type !3 {
-  %1 = getelementptr inbounds [6 x i8], [6 x i8]* @0, i32 0, i32 0
-  %2 = call spir_func i32 @_Z18__spirv_ocl_printfPc(i8* %1) #0
-  %3 = getelementptr inbounds [6 x i8], [6 x i8] addrspace(1)* @1, i32 0, i32 0
-  %4 = call spir_func i32 @_Z18__spirv_ocl_printfPU3AS1c(i8 addrspace(1)* %3) #0
-  %5 = getelementptr inbounds [6 x i8], [6 x i8] addrspace(3)* @2, i32 0, i32 0
-  %6 = call spir_func i32 @_Z18__spirv_ocl_printfPU3AS3c(i8 addrspace(3)* %5) #0
-  %7 = getelementptr inbounds [6 x i8], [6 x i8] addrspace(4)* @3, i32 0, i32 0
-  %8 = call spir_func i32 @_Z18__spirv_ocl_printfPU3AS4c(i8 addrspace(4)* %7) #0
-  ret void
-}
-
-; Function Attrs: nounwind
-declare spir_func i32 @_Z18__spirv_ocl_printfPc(i8*) #0
-
-; Function Attrs: nounwind
-declare spir_func i32 @_Z18__spirv_ocl_printfPU3AS1c(i8 addrspace(1)*) #0
-
-; Function Attrs: nounwind
-declare spir_func i32 @_Z18__spirv_ocl_printfPU3AS3c(i8 addrspace(3)*) #0
-
-; Function Attrs: nounwind
-declare spir_func i32 @_Z18__spirv_ocl_printfPU3AS4c(i8 addrspace(4)*) #0
-
-attributes #0 = { nounwind }
-
-!spirv.MemoryModel = !{!0}
-!opencl.enable.FP_CONTRACT = !{}
-!spirv.Source = !{!1}
-!opencl.spir.version = !{!2}
-!opencl.ocl.version = !{!2}
-!opencl.used.extensions = !{!3}
-!opencl.used.optional.core.features = !{!3}
-!spirv.Generator = !{!4}
-
-!0 = !{i32 1, i32 2}
-!1 = !{i32 3, i32 200000}
-!2 = !{i32 2, i32 0}
-!3 = !{}
-!4 = !{i16 7, i16 0}
diff --git a/test/transcoding/SPV_EXT_relaxed_printf_string_address_space/non-constant-printf.ll b/test/transcoding/SPV_EXT_relaxed_printf_string_address_space/non-constant-printf.ll
new file mode 100644 (file)
index 0000000..c790770
--- /dev/null
@@ -0,0 +1,86 @@
+; RUN: llvm-as %s -o %t.bc
+; RUN: not llvm-spirv %t.bc -o %t.spv 2>&1 | FileCheck %s --check-prefix=CHECK-WO-EXT
+
+; RUN: llvm-spirv -spirv-text %t.bc -o %t.spt --spirv-ext=+SPV_EXT_relaxed_printf_string_address_space
+; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV
+
+; RUN: llvm-spirv -to-binary %t.spt -o %t.spv
+; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.rev.bc
+; RUN: llvm-dis %t.rev.bc -o %t.rev.ll
+; RUN: FileCheck < %t.rev.ll %s --check-prefix=CHECK-LLVM
+
+; CHECK-WO-EXT: RequiresExtension: Feature requires the following SPIR-V extension:
+; CHECK-WO-EXT: SPV_EXT_relaxed_printf_string_address_space extension should be allowed to translate this module, because this LLVM module contains the printf function with format string, whose address space is not equal to 2 (constant).
+
+; CHECK-SPIRV: Extension "SPV_EXT_relaxed_printf_string_address_space"
+; CHECK-SPIRV: ExtInstImport [[#ExtInstSetId:]] "OpenCL.std"
+; CHECK-SPIRV: TypeInt [[#TypeInt8Id:]] 8 0
+; CHECK-SPIRV: TypeInt [[#TypeInt32Id:]] 32 0
+; CHECK-SPIRV: TypePointer [[#FunctionStorClassPtrTy:]] 7 [[#TypeInt8Id]]
+; CHECK-SPIRV: TypePointer [[#WGStorClassPtrTy:]] 5 [[#TypeInt8Id]]
+; CHECK-SPIRV: TypePointer [[#CrossWFStorClassPtrTy:]] 4 [[#TypeInt8Id]]
+; CHECK-SPIRV: TypePointer [[#GenericStorCalssPtrTy:]] 8 [[#TypeInt8Id]]
+; CHECK-SPIRV: InBoundsPtrAccessChain [[#FunctionStorClassPtrTy]] [[#GEP1:]]
+; CHECK-SPIRV: ExtInst [[#TypeInt32Id]] [[#]] [[#ExtInstSetId:]] printf [[#GEP1]]
+; CHECK-SPIRV: InBoundsPtrAccessChain [[#WGStorClassPtrTy]] [[#GEP2:]]
+; CHECK-SPIRV: ExtInst [[#TypeInt32Id]] [[#]] [[#ExtInstSetId:]] printf [[#GEP2]]
+; CHECK-SPIRV: InBoundsPtrAccessChain [[#CrossWFStorClassPtrTy:]] [[#GEP3:]]
+; CHECK-SPIRV: ExtInst [[#TypeInt32Id]] [[#]] [[#ExtInstSetId:]] printf [[#GEP3]]
+; CHECK-SPIRV: InBoundsPtrAccessChain [[#GenericStorCalssPtrTy:]] [[#GEP4:]]
+; CHECK-SPIRV: ExtInst [[#TypeInt32Id]] [[#]] [[#ExtInstSetId:]] printf [[#GEP4]]
+
+; CHECK-LLVM: call spir_func i32 @_Z18__spirv_ocl_printfPc(ptr {{.*}}
+; CHECK-LLVM: call spir_func i32 @_Z18__spirv_ocl_printfPU3AS1c(ptr addrspace(1) {{.*}}
+; CHECK-LLVM: call spir_func i32 @_Z18__spirv_ocl_printfPU3AS3c(ptr addrspace(3) {{.*}}
+; CHECK-LLVM: call spir_func i32 @_Z18__spirv_ocl_printfPU3AS4c(ptr addrspace(4) {{.*}}
+
+; ModuleID = 'non-constant-printf'
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024"
+target triple = "spir-unknown-unknown"
+
+@0 = internal unnamed_addr addrspace(0) constant [6 x i8] c"Test\0A\00", align 1
+@1 = internal unnamed_addr addrspace(1) constant [6 x i8] c"Test\0A\00", align 1
+@2 = internal unnamed_addr addrspace(3) constant [6 x i8] c"Test\0A\00", align 1
+@3 = internal unnamed_addr addrspace(4) constant [6 x i8] c"Test\0A\00", align 1
+
+; Function Attrs: nounwind
+define spir_kernel void @test() #0 !kernel_arg_addr_space !3 !kernel_arg_access_qual !3 !kernel_arg_type !3 !kernel_arg_type_qual !3 !kernel_arg_base_type !3 {
+  %1 = getelementptr inbounds [6 x i8], [6 x i8]* @0, i32 0, i32 0
+  %2 = call spir_func i32 @_Z18__spirv_ocl_printfPc(i8* %1) #0
+  %3 = getelementptr inbounds [6 x i8], [6 x i8] addrspace(1)* @1, i32 0, i32 0
+  %4 = call spir_func i32 @_Z18__spirv_ocl_printfPU3AS1c(i8 addrspace(1)* %3) #0
+  %5 = getelementptr inbounds [6 x i8], [6 x i8] addrspace(3)* @2, i32 0, i32 0
+  %6 = call spir_func i32 @_Z18__spirv_ocl_printfPU3AS3c(i8 addrspace(3)* %5) #0
+  %7 = getelementptr inbounds [6 x i8], [6 x i8] addrspace(4)* @3, i32 0, i32 0
+  %8 = call spir_func i32 @_Z18__spirv_ocl_printfPU3AS4c(i8 addrspace(4)* %7) #0
+  ret void
+}
+
+; Function Attrs: nounwind
+declare spir_func i32 @_Z18__spirv_ocl_printfPc(i8*) #0
+
+; Function Attrs: nounwind
+declare spir_func i32 @_Z18__spirv_ocl_printfPU3AS1c(i8 addrspace(1)*) #0
+
+; Function Attrs: nounwind
+declare spir_func i32 @_Z18__spirv_ocl_printfPU3AS3c(i8 addrspace(3)*) #0
+
+; Function Attrs: nounwind
+declare spir_func i32 @_Z18__spirv_ocl_printfPU3AS4c(i8 addrspace(4)*) #0
+
+attributes #0 = { nounwind }
+
+!spirv.MemoryModel = !{!0}
+!opencl.enable.FP_CONTRACT = !{}
+!spirv.Source = !{!1}
+!opencl.spir.version = !{!2}
+!opencl.ocl.version = !{!2}
+!opencl.used.extensions = !{!3}
+!opencl.used.optional.core.features = !{!3}
+!spirv.Generator = !{!4}
+
+!0 = !{i32 1, i32 2}
+!1 = !{i32 3, i32 200000}
+!2 = !{i32 2, i32 0}
+!3 = !{}
+!4 = !{i16 7, i16 0}
diff --git a/test/transcoding/SPV_INTEL_non_constant_addrspace_printf/non-constant-printf.ll b/test/transcoding/SPV_INTEL_non_constant_addrspace_printf/non-constant-printf.ll
deleted file mode 100644 (file)
index 84c420e..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: not llvm-spirv %t.bc -o %t.spv 2>&1 | FileCheck %s --check-prefix=CHECK-WO-EXT
-
-; RUN: llvm-spirv -spirv-text %t.bc -o %t.spt --spirv-ext=+SPV_INTEL_non_constant_addrspace_printf
-; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV
-
-; RUN: llvm-spirv -to-binary %t.spt -o %t.spv
-; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
-; RUN: llvm-dis %t.rev.bc -o %t.rev.ll
-; RUN: FileCheck < %t.rev.ll %s --check-prefix=CHECK-LLVM
-
-; CHECK-WO-EXT: RequiresExtension: Feature requires the following SPIR-V extension:
-; CHECK-WO-EXT: Either SPV_EXT_relaxed_printf_string_address_space or SPV_INTEL_non_constant_addrspace_printf extension should be allowed to translate this module, because this LLVM module contains the printf function with format string, whose address space is not equal to 2 (constant).
-
-; CHECK-SPIRV: Capability NonConstantAddrspacePrintfINTEL
-; CHECK-SPIRV: Extension "SPV_INTEL_non_constant_addrspace_printf"
-; CHECK-SPIRV: ExtInstImport [[#ExtInstSetId:]] "OpenCL.std"
-; CHECK-SPIRV: TypeInt [[#TypeInt8Id:]] 8 0
-; CHECK-SPIRV: TypeInt [[#TypeInt32Id:]] 32 0
-; CHECK-SPIRV: TypePointer [[#FunctionStorClassPtrTy:]] 7 [[#TypeInt8Id]]
-; CHECK-SPIRV: TypePointer [[#WGStorClassPtrTy:]] 5 [[#TypeInt8Id]]
-; CHECK-SPIRV: TypePointer [[#CrossWFStorClassPtrTy:]] 4 [[#TypeInt8Id]]
-; CHECK-SPIRV: TypePointer [[#GenericStorCalssPtrTy:]] 8 [[#TypeInt8Id]]
-; CHECK-SPIRV: InBoundsPtrAccessChain [[#FunctionStorClassPtrTy]] [[#GEP1:]]
-; CHECK-SPIRV: ExtInst [[#TypeInt32Id]] [[#]] [[#ExtInstSetId:]] printf [[#GEP1]]
-; CHECK-SPIRV: InBoundsPtrAccessChain [[#WGStorClassPtrTy]] [[#GEP2:]]
-; CHECK-SPIRV: ExtInst [[#TypeInt32Id]] [[#]] [[#ExtInstSetId:]] printf [[#GEP2]]
-; CHECK-SPIRV: InBoundsPtrAccessChain [[#CrossWFStorClassPtrTy:]] [[#GEP3:]]
-; CHECK-SPIRV: ExtInst [[#TypeInt32Id]] [[#]] [[#ExtInstSetId:]] printf [[#GEP3]]
-; CHECK-SPIRV: InBoundsPtrAccessChain [[#GenericStorCalssPtrTy:]] [[#GEP4:]]
-; CHECK-SPIRV: ExtInst [[#TypeInt32Id]] [[#]] [[#ExtInstSetId:]] printf [[#GEP4]]
-
-; CHECK-LLVM: call spir_func i32 @_Z18__spirv_ocl_printfPc(i8* {{.*}}
-; CHECK-LLVM: call spir_func i32 @_Z18__spirv_ocl_printfPU3AS1c(i8 addrspace(1)* {{.*}}
-; CHECK-LLVM: call spir_func i32 @_Z18__spirv_ocl_printfPU3AS3c(i8 addrspace(3)* {{.*}}
-; CHECK-LLVM: call spir_func i32 @_Z18__spirv_ocl_printfPU3AS4c(i8 addrspace(4)* {{.*}}
-
-; ModuleID = 'non-constant-printf'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024"
-target triple = "spir-unknown-unknown"
-
-@0 = internal unnamed_addr addrspace(0) constant [6 x i8] c"Test\0A\00", align 1
-@1 = internal unnamed_addr addrspace(1) constant [6 x i8] c"Test\0A\00", align 1
-@2 = internal unnamed_addr addrspace(3) constant [6 x i8] c"Test\0A\00", align 1
-@3 = internal unnamed_addr addrspace(4) constant [6 x i8] c"Test\0A\00", align 1
-
-; Function Attrs: nounwind
-define spir_kernel void @test() #0 !kernel_arg_addr_space !3 !kernel_arg_access_qual !3 !kernel_arg_type !3 !kernel_arg_type_qual !3 !kernel_arg_base_type !3 {
-  %1 = getelementptr inbounds [6 x i8], [6 x i8]* @0, i32 0, i32 0
-  %2 = call spir_func i32 @_Z18__spirv_ocl_printfPc(i8* %1) #0
-  %3 = getelementptr inbounds [6 x i8], [6 x i8] addrspace(1)* @1, i32 0, i32 0
-  %4 = call spir_func i32 @_Z18__spirv_ocl_printfPU3AS1c(i8 addrspace(1)* %3) #0
-  %5 = getelementptr inbounds [6 x i8], [6 x i8] addrspace(3)* @2, i32 0, i32 0
-  %6 = call spir_func i32 @_Z18__spirv_ocl_printfPU3AS3c(i8 addrspace(3)* %5) #0
-  %7 = getelementptr inbounds [6 x i8], [6 x i8] addrspace(4)* @3, i32 0, i32 0
-  %8 = call spir_func i32 @_Z18__spirv_ocl_printfPU3AS4c(i8 addrspace(4)* %7) #0
-  ret void
-}
-
-; Function Attrs: nounwind
-declare spir_func i32 @_Z18__spirv_ocl_printfPc(i8*) #0
-
-; Function Attrs: nounwind
-declare spir_func i32 @_Z18__spirv_ocl_printfPU3AS1c(i8 addrspace(1)*) #0
-
-; Function Attrs: nounwind
-declare spir_func i32 @_Z18__spirv_ocl_printfPU3AS3c(i8 addrspace(3)*) #0
-
-; Function Attrs: nounwind
-declare spir_func i32 @_Z18__spirv_ocl_printfPU3AS4c(i8 addrspace(4)*) #0
-
-attributes #0 = { nounwind }
-
-!spirv.MemoryModel = !{!0}
-!opencl.enable.FP_CONTRACT = !{}
-!spirv.Source = !{!1}
-!opencl.spir.version = !{!2}
-!opencl.ocl.version = !{!2}
-!opencl.used.extensions = !{!3}
-!opencl.used.optional.core.features = !{!3}
-!spirv.Generator = !{!4}
-
-!0 = !{i32 1, i32 2}
-!1 = !{i32 3, i32 200000}
-!2 = !{i32 2, i32 0}
-!3 = !{}
-!4 = !{i16 7, i16 0}