Skip to content

Commit c469fa8

Browse files
vmaksimoMrSidims
authored andcommitted
Deprecate SPV_INTEL_non_constant_addrspace_printf extension (#1818)
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>
1 parent f329838 commit c469fa8

File tree

6 files changed

+10
-113
lines changed

6 files changed

+10
-113
lines changed

include/LLVMSPIRVExtensions.inc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ EXT(SPV_INTEL_bfloat16_conversion)
5151
EXT(SPV_INTEL_joint_matrix)
5252
EXT(SPV_INTEL_hw_thread_queries)
5353
EXT(SPV_INTEL_global_variable_decorations)
54-
EXT(SPV_INTEL_non_constant_addrspace_printf)
5554
EXT(SPV_INTEL_complex_float_mul_div)
5655
EXT(SPV_INTEL_split_barrier)
5756
EXT(SPV_INTEL_masked_gather_scatter)

lib/SPIRV/SPIRVWriter.cpp

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3994,26 +3994,18 @@ SPIRVValue *LLVMToSPIRVBase::transDirectCallInst(CallInst *CI,
39943994
auto *FormatStrPtr = cast<PointerType>(CI->getArgOperand(0)->getType());
39953995
if (FormatStrPtr->getAddressSpace() !=
39963996
SPIR::TypeAttributeEnum::ATTR_CONST) {
3997-
if (BM->isAllowedToUseExtension(
3997+
if (!BM->isAllowedToUseExtension(
39983998
ExtensionID::SPV_EXT_relaxed_printf_string_address_space)) {
3999-
BM->addExtension(
4000-
ExtensionID::SPV_EXT_relaxed_printf_string_address_space);
4001-
} else if (BM->isAllowedToUseExtension(
4002-
ExtensionID::SPV_INTEL_non_constant_addrspace_printf)) {
4003-
BM->addExtension(
4004-
ExtensionID::SPV_INTEL_non_constant_addrspace_printf);
4005-
BM->addCapability(
4006-
internal::CapabilityNonConstantAddrspacePrintfINTEL);
4007-
} else {
40083999
std::string ErrorStr =
4009-
"Either SPV_EXT_relaxed_printf_string_address_space or "
4010-
"SPV_INTEL_non_constant_addrspace_printf extension should be "
4011-
"allowed to translate this module, because this LLVM module "
4012-
"contains the printf function with format string, whose address "
4013-
"space is not equal to 2 (constant).";
4000+
"Either SPV_EXT_relaxed_printf_string_address_space extension "
4001+
"should be allowed to translate this module, because this LLVM "
4002+
"module contains the printf function with format string, whose "
4003+
"address space is not equal to 2 (constant).";
40144004
getErrorLog().checkError(false, SPIRVEC_RequiresExtension, CI,
40154005
ErrorStr);
40164006
}
4007+
BM->addExtension(
4008+
ExtensionID::SPV_EXT_relaxed_printf_string_address_space);
40174009
}
40184010
}
40194011

lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,8 +614,6 @@ template <> inline void SPIRVMap<Capability, std::string>::init() {
614614
add(internal::CapabilityHWThreadQueryINTEL, "HWThreadQueryINTEL");
615615
add(internal::CapabilityGlobalVariableDecorationsINTEL,
616616
"GlobalVariableDecorationsINTEL");
617-
add(internal::CapabilityNonConstantAddrspacePrintfINTEL,
618-
"NonConstantAddrspacePrintfINTEL");
619617
add(internal::CapabilityComplexFloatMulDivINTEL, "ComplexFloatMulDivINTEL");
620618
add(internal::CapabilityMaskedGatherScatterINTEL, "MaskedGatherScatterINTEL");
621619
add(internal::CapabilityTensorFloat32ConversionINTEL,

lib/SPIRV/libSPIRV/spirv_internal.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ enum InternalCapability {
7878
ICapabilityHWThreadQueryINTEL = 6134,
7979
ICapFPArithmeticFenceINTEL = 6144,
8080
ICapGlobalVariableDecorationsINTEL = 6146,
81-
ICapabilityNonConstantAddrspacePrintfINTEL = 6411,
8281
ICapabilityComplexFloatMulDivINTEL = 6414,
8382
ICapabilityTensorFloat32ConversionINTEL = 6425,
8483
ICapabilityMaskedGatherScatterINTEL = 6427
@@ -121,8 +120,6 @@ _SPIRV_OP(Capability, HWThreadQueryINTEL)
121120
_SPIRV_OP(BuiltIn, SubDeviceIDINTEL)
122121
_SPIRV_OP(BuiltIn, GlobalHWThreadIDINTEL)
123122

124-
_SPIRV_OP(Capability, NonConstantAddrspacePrintfINTEL)
125-
126123
_SPIRV_OP(Capability, ComplexFloatMulDivINTEL)
127124
_SPIRV_OP(Op, ComplexFMulINTEL)
128125
_SPIRV_OP(Op, ComplexFDivINTEL)

test/extensions/EXT/SPV_EXT_relaxed_printf_string_address_space/non-constant-printf.ll

Lines changed: 0 additions & 88 deletions
This file was deleted.

test/transcoding/SPV_INTEL_non_constant_addrspace_printf/non-constant-printf.ll renamed to test/transcoding/SPV_EXT_relaxed_printf_string_address_space/non-constant-printf.ll

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; RUN: llvm-as %s -o %t.bc
22
; RUN: not llvm-spirv %t.bc -o %t.spv 2>&1 | FileCheck %s --check-prefix=CHECK-WO-EXT
33

4-
; RUN: llvm-spirv -spirv-text %t.bc -o %t.spt --spirv-ext=+SPV_INTEL_non_constant_addrspace_printf
4+
; RUN: llvm-spirv -spirv-text %t.bc -o %t.spt --spirv-ext=+SPV_EXT_relaxed_printf_string_address_space
55
; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV
66

77
; RUN: llvm-spirv -to-binary %t.spt -o %t.spv
@@ -10,10 +10,9 @@
1010
; RUN: FileCheck < %t.rev.ll %s --check-prefix=CHECK-LLVM
1111

1212
; CHECK-WO-EXT: RequiresExtension: Feature requires the following SPIR-V extension:
13-
; 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).
13+
; 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).
1414

15-
; CHECK-SPIRV: Capability NonConstantAddrspacePrintfINTEL
16-
; CHECK-SPIRV: Extension "SPV_INTEL_non_constant_addrspace_printf"
15+
; CHECK-SPIRV: Extension "SPV_EXT_relaxed_printf_string_address_space"
1716
; CHECK-SPIRV: ExtInstImport [[#ExtInstSetId:]] "OpenCL.std"
1817
; CHECK-SPIRV: TypeInt [[#TypeInt8Id:]] 8 0
1918
; CHECK-SPIRV: TypeInt [[#TypeInt32Id:]] 32 0

0 commit comments

Comments
 (0)