Skip to content

Commit ac7a759

Browse files
authored
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.
1 parent 3ff87c3 commit ac7a759

File tree

6 files changed

+9
-112
lines changed

6 files changed

+9
-112
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
@@ -4166,26 +4166,18 @@ SPIRVValue *LLVMToSPIRVBase::transDirectCallInst(CallInst *CI,
41664166
auto *FormatStrPtr = cast<PointerType>(CI->getArgOperand(0)->getType());
41674167
if (FormatStrPtr->getAddressSpace() !=
41684168
SPIR::TypeAttributeEnum::ATTR_CONST) {
4169-
if (BM->isAllowedToUseExtension(
4169+
if (!BM->isAllowedToUseExtension(
41704170
ExtensionID::SPV_EXT_relaxed_printf_string_address_space)) {
4171-
BM->addExtension(
4172-
ExtensionID::SPV_EXT_relaxed_printf_string_address_space);
4173-
} else if (BM->isAllowedToUseExtension(
4174-
ExtensionID::SPV_INTEL_non_constant_addrspace_printf)) {
4175-
BM->addExtension(
4176-
ExtensionID::SPV_INTEL_non_constant_addrspace_printf);
4177-
BM->addCapability(
4178-
internal::CapabilityNonConstantAddrspacePrintfINTEL);
4179-
} else {
41804171
std::string ErrorStr =
4181-
"Either SPV_EXT_relaxed_printf_string_address_space or "
4182-
"SPV_INTEL_non_constant_addrspace_printf extension should be "
4183-
"allowed to translate this module, because this LLVM module "
4184-
"contains the printf function with format string, whose address "
4185-
"space is not equal to 2 (constant).";
4172+
"Either SPV_EXT_relaxed_printf_string_address_space extension "
4173+
"should be allowed to translate this module, because this LLVM "
4174+
"module contains the printf function with format string, whose "
4175+
"address space is not equal to 2 (constant).";
41864176
getErrorLog().checkError(false, SPIRVEC_RequiresExtension, CI,
41874177
ErrorStr);
41884178
}
4179+
BM->addExtension(
4180+
ExtensionID::SPV_EXT_relaxed_printf_string_address_space);
41894181
}
41904182
}
41914183

lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h

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

lib/SPIRV/libSPIRV/spirv_internal.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ enum InternalCapability {
7171
ICapabilityHWThreadQueryINTEL = 6134,
7272
ICapFPArithmeticFenceINTEL = 6144,
7373
ICapGlobalVariableDecorationsINTEL = 6146,
74-
ICapabilityNonConstantAddrspacePrintfINTEL = 6411,
7574
ICapabilityComplexFloatMulDivINTEL = 6414,
7675
ICapabilityTensorFloat32ConversionINTEL = 6425,
7776
ICapabilityMaskedGatherScatterINTEL = 6427
@@ -111,8 +110,6 @@ _SPIRV_OP(Capability, HWThreadQueryINTEL)
111110
_SPIRV_OP(BuiltIn, SubDeviceIDINTEL)
112111
_SPIRV_OP(BuiltIn, GlobalHWThreadIDINTEL)
113112

114-
_SPIRV_OP(Capability, NonConstantAddrspacePrintfINTEL)
115-
116113
_SPIRV_OP(Capability, ComplexFloatMulDivINTEL)
117114
_SPIRV_OP(Op, ComplexFMulINTEL)
118115
_SPIRV_OP(Op, ComplexFDivINTEL)

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

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)