Skip to content

Commit 011108c

Browse files
authored
Deprecate SPV_INTEL_hw_thread_queries extension from forward llvm-spirv (#3130)
Apparently it was never used. Since it was in preview mode - we can remove it. Signed-off-by: Sidorov, Dmitry <dmitry.sidorov@intel.com>
1 parent c59f0f4 commit 011108c

File tree

6 files changed

+16
-83
lines changed

6 files changed

+16
-83
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,8 @@ should disable support for forward translation of the extension in the main bran
273273
(this will prevent new SPIR-V modules from being generated using the extension).
274274
Meanwhile support reverse translation for the extension should be continued
275275
(this retains compatibility with existing SPIR-V modules).
276-
* Addition of deprecation warning for the extension is not required.
276+
* Addition of deprecation warning for the extension is not required, yet recommended for extensions adding
277+
instructions representable in LLVM IR only via SPIR-V friendly LLVM IR.
277278
* We encourage backporting the changes to other branches to speed up removal, but this is not required.
278279
279280
After at least one release cycle one may remove support for reverse translation in the main branch as well,

lib/SPIRV/SPIRVWriter.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2151,14 +2151,11 @@ LLVMToSPIRVBase::transValueWithoutDecoration(Value *V, SPIRVBasicBlock *BB,
21512151
if (static_cast<uint32_t>(Builtin) >= internal::BuiltInSubDeviceIDINTEL &&
21522152
static_cast<uint32_t>(Builtin) <=
21532153
internal::BuiltInGlobalHWThreadIDINTEL) {
2154-
if (!BM->isAllowedToUseExtension(
2155-
ExtensionID::SPV_INTEL_hw_thread_queries)) {
2156-
std::string ErrorStr = "Intel HW thread queries must be enabled by "
2157-
"SPV_INTEL_hw_thread_queries extension.\n"
2158-
"LLVM value that is being translated:\n";
2159-
getErrorLog().checkError(false, SPIRVEC_InvalidModule, V, ErrorStr);
2160-
}
2161-
BM->addExtension(ExtensionID::SPV_INTEL_hw_thread_queries);
2154+
std::string ErrorStr = "SPV_INTEL_hw_thread_queries\n"
2155+
"Please report to "
2156+
"https://github.com/intel/llvm in case if you see "
2157+
"this error.\nRef LLVM Value:";
2158+
getErrorLog().checkError(false, SPIRVEC_DeprecatedExtension, V, ErrorStr);
21622159
}
21632160

21642161
BVar->setBuiltin(Builtin);

lib/SPIRV/libSPIRV/SPIRVErrorEnum.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ _SPIRV_OP(UnspecifiedMemoryModel, "Unspecified Memory Model.")
2828
_SPIRV_OP(RepeatedMemoryModel, "Expects a single OpMemoryModel instruction.")
2929
_SPIRV_OP(UnsupportedVarArgFunction,
3030
"Variadic functions other than 'printf' are not supported in SPIR-V.")
31+
_SPIRV_OP(DeprecatedExtension,
32+
"Feature requires the following deprecated SPIR-V extension:\n")
3133

3234
/* This is the last error code to have a maximum valid value to compare to */
3335
_SPIRV_OP(InternalMaxErrorCode, "Unknown error code")

test/extensions/INTEL/SPV_INTEL_hw_thread_queries/intel_hw_thread_queries_function_call.ll

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

test/extensions/INTEL/SPV_INTEL_hw_thread_queries/intel_hw_thread_queries_load_from_global.ll

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

test/extensions/INTEL/SPV_INTEL_hw_thread_queries/negative_intel_hw_thread_queries.ll

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
; Negative test for SPV_INTEL_hw_thread_queries feature
2-
; Check for errors in case if the extension is not enabled, but the appropriate
3-
; SPV-IR patter is found
1+
; Deprecation test for SPV_INTEL_hw_thread_queries extension.
2+
; Check for errors in case if LLVM IR module contains HW thread queries as a for of
3+
; SPIR-V friendly LLVM IR.
44
; RUN: llvm-as %s -o %t.bc
55
; RUN: not llvm-spirv %t.bc -o %t.spv 2>&1 | FileCheck %s
66

7-
; CHECK: InvalidModule: Invalid SPIR-V module: Intel HW thread queries must be enabled by SPV_INTEL_hw_thread_queries extension.
8-
; CHECK: LLVM value that is being translated:
7+
; CHECK: DeprecatedExtension: Feature requires the following deprecated SPIR-V extension:
8+
; CHECK: SPV_INTEL_hw_thread_queries
9+
; CHECK: Please report to https://github.com/intel/llvm in case if you see this error.
10+
; CHECK: Ref LLVM Value:
911
; CHECK: @__spirv_BuiltInSubDeviceIDINTEL = external addrspace(1) global i32
1012

1113
target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"

0 commit comments

Comments
 (0)