Skip to content

Commit 2a47681

Browse files
vmaksimoKornevNikita
authored andcommitted
Deprecate SPV_INTEL_non_constant_addrspace_printf extension (intel#1818)
This change continues intel#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. Original commit: KhronosGroup/SPIRV-LLVM-Translator@ac7a759
1 parent 5089053 commit 2a47681

File tree

6 files changed

+9
-112
lines changed

6 files changed

+9
-112
lines changed

llvm-spirv/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)

llvm-spirv/lib/SPIRV/SPIRVWriter.cpp

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4253,26 +4253,18 @@ SPIRVValue *LLVMToSPIRVBase::transDirectCallInst(CallInst *CI,
42534253
auto *FormatStrPtr = cast<PointerType>(CI->getArgOperand(0)->getType());
42544254
if (FormatStrPtr->getAddressSpace() !=
42554255
SPIR::TypeAttributeEnum::ATTR_CONST) {
4256-
if (BM->isAllowedToUseExtension(
4256+
if (!BM->isAllowedToUseExtension(
42574257
ExtensionID::SPV_EXT_relaxed_printf_string_address_space)) {
4258-
BM->addExtension(
4259-
ExtensionID::SPV_EXT_relaxed_printf_string_address_space);
4260-
} else if (BM->isAllowedToUseExtension(
4261-
ExtensionID::SPV_INTEL_non_constant_addrspace_printf)) {
4262-
BM->addExtension(
4263-
ExtensionID::SPV_INTEL_non_constant_addrspace_printf);
4264-
BM->addCapability(
4265-
internal::CapabilityNonConstantAddrspacePrintfINTEL);
4266-
} else {
42674258
std::string ErrorStr =
4268-
"Either SPV_EXT_relaxed_printf_string_address_space or "
4269-
"SPV_INTEL_non_constant_addrspace_printf extension should be "
4270-
"allowed to translate this module, because this LLVM module "
4271-
"contains the printf function with format string, whose address "
4272-
"space is not equal to 2 (constant).";
4259+
"Either SPV_EXT_relaxed_printf_string_address_space extension "
4260+
"should be allowed to translate this module, because this LLVM "
4261+
"module contains the printf function with format string, whose "
4262+
"address space is not equal to 2 (constant).";
42734263
getErrorLog().checkError(false, SPIRVEC_RequiresExtension, CI,
42744264
ErrorStr);
42754265
}
4266+
BM->addExtension(
4267+
ExtensionID::SPV_EXT_relaxed_printf_string_address_space);
42764268
}
42774269
}
42784270

llvm-spirv/lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -629,8 +629,6 @@ template <> inline void SPIRVMap<Capability, std::string>::init() {
629629
add(internal::CapabilityHWThreadQueryINTEL, "HWThreadQueryINTEL");
630630
add(internal::CapabilityGlobalVariableDecorationsINTEL,
631631
"GlobalVariableDecorationsINTEL");
632-
add(internal::CapabilityNonConstantAddrspacePrintfINTEL,
633-
"NonConstantAddrspacePrintfINTEL");
634632
add(internal::CapabilityComplexFloatMulDivINTEL, "ComplexFloatMulDivINTEL");
635633
add(internal::CapabilityMaskedGatherScatterINTEL, "MaskedGatherScatterINTEL");
636634
add(internal::CapabilityTensorFloat32ConversionINTEL,

llvm-spirv/lib/SPIRV/libSPIRV/spirv_internal.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ enum InternalCapability {
7373
ICapabilityHWThreadQueryINTEL = 6134,
7474
ICapFPArithmeticFenceINTEL = 6144,
7575
ICapGlobalVariableDecorationsINTEL = 6146,
76-
ICapabilityNonConstantAddrspacePrintfINTEL = 6411,
7776
ICapabilityComplexFloatMulDivINTEL = 6414,
7877
ICapabilityTensorFloat32ConversionINTEL = 6425,
7978
ICapabilityMaskedGatherScatterINTEL = 6427
@@ -113,8 +112,6 @@ _SPIRV_OP(Capability, HWThreadQueryINTEL)
113112
_SPIRV_OP(BuiltIn, SubDeviceIDINTEL)
114113
_SPIRV_OP(BuiltIn, GlobalHWThreadIDINTEL)
115114

116-
_SPIRV_OP(Capability, NonConstantAddrspacePrintfINTEL)
117-
118115
_SPIRV_OP(Capability, ComplexFloatMulDivINTEL)
119116
_SPIRV_OP(Op, ComplexFMulINTEL)
120117
_SPIRV_OP(Op, ComplexFDivINTEL)

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

Lines changed: 2 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_EXT_relaxed_printf_string_address_space,+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,8 @@
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-NOT: Capability NonConstantAddrspacePrintfINTEL
16-
; CHECK-SPIRV-NOT: Extension "SPV_INTEL_non_constant_addrspace_printf"
1715
; CHECK-SPIRV: Extension "SPV_EXT_relaxed_printf_string_address_space"
1816
; CHECK-SPIRV: ExtInstImport [[#ExtInstSetId:]] "OpenCL.std"
1917
; CHECK-SPIRV: TypeInt [[#TypeInt8Id:]] 8 0

llvm-spirv/test/extensions/INTEL/SPV_INTEL_non_constant_addrspace_printf/non-constant-printf.ll

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

0 commit comments

Comments
 (0)