Skip to content

Commit 1b4a17c

Browse files
Dmitry Sidorovvmaksimo
authored andcommitted
[Backport to 18] 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 810df4b commit 1b4a17c

File tree

6 files changed

+30
-82
lines changed

6 files changed

+30
-82
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,3 +256,19 @@ LLVM/Clang release and there are no objections from the maintainer(s). There
256256
is no guarantee that older release branches are proactively kept up to date
257257
with main, but you can request specific commits on older release branches by
258258
creating a pull request or raising an issue on GitHub.
259+
260+
## Deprecation of "preview extensions"
261+
262+
In a case if a "preview extension" has to be deprecated, as the first step one
263+
should disable support for forward translation of the extension in the main branch
264+
(this will prevent new SPIR-V modules from being generated using the extension).
265+
Meanwhile support reverse translation for the extension should be continued
266+
(this retains compatibility with existing SPIR-V modules).
267+
* Addition of deprecation warning for the extension is not required, yet recommended for extensions adding
268+
instructions representable in LLVM IR only via SPIR-V friendly LLVM IR.
269+
* We encourage backporting the changes to other branches to speed up removal, but this is not required.
270+
271+
After at least one release cycle one may remove support for reverse translation in the main branch as well,
272+
at which point support for the "preview extension" is considered removed.
273+
274+
These are guidelines, not requirements, and we will consider exceptions on a case-by-case basis.

lib/SPIRV/SPIRVWriter.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2098,14 +2098,11 @@ LLVMToSPIRVBase::transValueWithoutDecoration(Value *V, SPIRVBasicBlock *BB,
20982098
if (static_cast<uint32_t>(Builtin) >= internal::BuiltInSubDeviceIDINTEL &&
20992099
static_cast<uint32_t>(Builtin) <=
21002100
internal::BuiltInGlobalHWThreadIDINTEL) {
2101-
if (!BM->isAllowedToUseExtension(
2102-
ExtensionID::SPV_INTEL_hw_thread_queries)) {
2103-
std::string ErrorStr = "Intel HW thread queries must be enabled by "
2104-
"SPV_INTEL_hw_thread_queries extension.\n"
2105-
"LLVM value that is being translated:\n";
2106-
getErrorLog().checkError(false, SPIRVEC_InvalidModule, V, ErrorStr);
2107-
}
2108-
BM->addExtension(ExtensionID::SPV_INTEL_hw_thread_queries);
2101+
std::string ErrorStr = "SPV_INTEL_hw_thread_queries\n"
2102+
"Please report to "
2103+
"https://github.com/intel/llvm in case if you see "
2104+
"this error.\nRef LLVM Value:";
2105+
getErrorLog().checkError(false, SPIRVEC_DeprecatedExtension, V, ErrorStr);
21092106
}
21102107

21112108
BVar->setBuiltin(Builtin);

lib/SPIRV/libSPIRV/SPIRVErrorEnum.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ _SPIRV_OP(InvalidVersionNumber,
2929
"Invalid Version Number.")
3030
_SPIRV_OP(UnspecifiedMemoryModel, "Unspecified Memory Model.")
3131
_SPIRV_OP(RepeatedMemoryModel, "Expects a single OpMemoryModel instruction.")
32+
_SPIRV_OP(DeprecatedExtension,
33+
"Feature requires the following deprecated SPIR-V extension:\n")
3234

3335
/* This is the last error code to have a maximum valid value to compare to */
3436
_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)