Skip to content

Commit 4153f28

Browse files
[SPIR-V] Support extension toggling and enabling all
This patch enhances spirv-extensions CLI option with the ability to enable all extensions through `--spirv-extensions=all` and to toggle individual extensions using `--spirv-extensions=+extension1,-extension2` or `--spirv-extensions=all,-extension`.
1 parent 60fa2b0 commit 4153f28

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+217
-130
lines changed

llvm/lib/Target/SPIRV/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ add_llvm_target(SPIRVCodeGen
1717
SPIRVAsmPrinter.cpp
1818
SPIRVBuiltins.cpp
1919
SPIRVCallLowering.cpp
20+
SPIRVCommandLine.cpp
2021
SPIRVDuplicatesTracker.cpp
2122
SPIRVEmitIntrinsics.cpp
2223
SPIRVGlobalRegistry.cpp
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
//===--- SPIRVCommandLine.cpp ---- Command Line Options ---------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
//
9+
// This file contains definitions of classes and functions needed for
10+
// processing, parsing, and using CLI options for the SPIR-V backend.
11+
//
12+
//===----------------------------------------------------------------------===//
13+
14+
#include "SPIRVCommandLine.h"
15+
#include "llvm/ADT/StringRef.h"
16+
#include <map>
17+
18+
#define DEBUG_TYPE "spirv-commandline"
19+
20+
using namespace llvm;
21+
22+
const std::map<std::string, SPIRV::Extension::Extension> ExtensionMap = {
23+
{"SPV_EXT_shader_atomic_float_add",
24+
SPIRV::Extension::Extension::SPV_EXT_shader_atomic_float_add},
25+
{"SPV_EXT_shader_atomic_float16_add",
26+
SPIRV::Extension::Extension::SPV_EXT_shader_atomic_float16_add},
27+
{"SPV_EXT_shader_atomic_float_min_max",
28+
SPIRV::Extension::Extension::SPV_EXT_shader_atomic_float_min_max},
29+
{"SPV_INTEL_arbitrary_precision_integers",
30+
SPIRV::Extension::Extension::SPV_INTEL_arbitrary_precision_integers},
31+
{"SPV_INTEL_optnone", SPIRV::Extension::Extension::SPV_INTEL_optnone},
32+
{"SPV_INTEL_usm_storage_classes",
33+
SPIRV::Extension::Extension::SPV_INTEL_usm_storage_classes},
34+
{"SPV_INTEL_subgroups", SPIRV::Extension::Extension::SPV_INTEL_subgroups},
35+
{"SPV_KHR_uniform_group_instructions",
36+
SPIRV::Extension::Extension::SPV_KHR_uniform_group_instructions},
37+
{"SPV_KHR_no_integer_wrap_decoration",
38+
SPIRV::Extension::Extension::SPV_KHR_no_integer_wrap_decoration},
39+
{"SPV_KHR_float_controls",
40+
SPIRV::Extension::Extension::SPV_KHR_float_controls},
41+
{"SPV_KHR_expect_assume",
42+
SPIRV::Extension::Extension::SPV_KHR_expect_assume},
43+
{"SPV_KHR_bit_instructions",
44+
SPIRV::Extension::Extension::SPV_KHR_bit_instructions},
45+
{"SPV_KHR_linkonce_odr", SPIRV::Extension::Extension::SPV_KHR_linkonce_odr},
46+
{"SPV_INTEL_bfloat16_conversion",
47+
SPIRV::Extension::Extension::SPV_INTEL_bfloat16_conversion},
48+
{"SPV_KHR_subgroup_rotate",
49+
SPIRV::Extension::Extension::SPV_KHR_subgroup_rotate},
50+
{"SPV_INTEL_variable_length_array",
51+
SPIRV::Extension::Extension::SPV_INTEL_variable_length_array},
52+
{"SPV_INTEL_function_pointers",
53+
SPIRV::Extension::Extension::SPV_INTEL_function_pointers},
54+
};
55+
56+
bool SPIRVExtensionsParser::parse(cl::Option &O, llvm::StringRef ArgName,
57+
llvm::StringRef ArgValue,
58+
std::set<SPIRV::Extension::Extension> &Val) {
59+
llvm::SmallVector<llvm::StringRef, 10> Tokens;
60+
ArgValue.split(Tokens, ",", -1, false);
61+
62+
std::set<SPIRV::Extension::Extension> EnabledExtensions;
63+
64+
for (const auto &Token : Tokens) {
65+
if (Token == "all") {
66+
for (const auto &[ExtensionName, ExtensionEnum] : ExtensionMap)
67+
EnabledExtensions.insert(ExtensionEnum);
68+
69+
continue;
70+
}
71+
72+
if (!Token.empty() && (Token.starts_with("+") || Token.starts_with("-"))) {
73+
llvm::StringRef ExtensionName = Token.substr(1);
74+
auto NameValuePair = ExtensionMap.find(ExtensionName.str());
75+
76+
if (NameValuePair == ExtensionMap.end())
77+
return O.error("Unknown SPIR-V extension: " + Token.str());
78+
79+
if (Token.starts_with("+"))
80+
EnabledExtensions.insert(NameValuePair->second);
81+
else if (EnabledExtensions.count(NameValuePair->second))
82+
EnabledExtensions.erase(NameValuePair->second);
83+
84+
continue;
85+
}
86+
87+
return O.error("Invalid extension list format " + Token.str());
88+
}
89+
90+
Val = std::move(EnabledExtensions);
91+
return false;
92+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//===--- SPIRVCommandLine.h ---- Command Line Options -----------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
//
9+
// This file contains classes and functions needed for processing, parsing, and
10+
// using CLI options for the SPIR-V backend.
11+
//
12+
//===----------------------------------------------------------------------===//
13+
14+
#ifndef LLVM_LIB_TARGET_SPIRV_COMMANDLINE_H
15+
#define LLVM_LIB_TARGET_SPIRV_COMMANDLINE_H
16+
17+
#include "MCTargetDesc/SPIRVBaseInfo.h"
18+
#include "llvm/Support/CommandLine.h"
19+
#include <set>
20+
21+
namespace llvm {
22+
23+
struct SPIRVExtensionsParser
24+
: public cl::parser<std::set<SPIRV::Extension::Extension>> {
25+
public:
26+
SPIRVExtensionsParser(cl::Option &O)
27+
: cl::parser<std::set<SPIRV::Extension::Extension>>(O) {}
28+
29+
/// Parses SPIR-V extension name from a CLI arguments.
30+
///
31+
/// \return Returns true on error.
32+
bool parse(cl::Option &O, StringRef ArgName, StringRef ArgValue,
33+
std::set<SPIRV::Extension::Extension> &Val);
34+
};
35+
36+
} // namespace llvm
37+
#endif // LLVM_LIB_TARGET_SPIRV_COMMANDLINE_H

llvm/lib/Target/SPIRV/SPIRVSubtarget.cpp

Lines changed: 5 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include "SPIRVSubtarget.h"
1414
#include "SPIRV.h"
15+
#include "SPIRVCommandLine.h"
1516
#include "SPIRVGlobalRegistry.h"
1617
#include "SPIRVLegalizerInfo.h"
1718
#include "SPIRVRegisterBankInfo.h"
@@ -27,80 +28,9 @@ using namespace llvm;
2728
#define GET_SUBTARGETINFO_CTOR
2829
#include "SPIRVGenSubtargetInfo.inc"
2930

30-
cl::list<SPIRV::Extension::Extension> Extensions(
31-
"spirv-extensions", cl::desc("SPIR-V extensions"), cl::ZeroOrMore,
32-
cl::Hidden,
33-
cl::values(
34-
clEnumValN(SPIRV::Extension::SPV_EXT_shader_atomic_float_add,
35-
"SPV_EXT_shader_atomic_float_add",
36-
"Adds atomic add instruction on floating-point numbers."),
37-
clEnumValN(
38-
SPIRV::Extension::SPV_EXT_shader_atomic_float16_add,
39-
"SPV_EXT_shader_atomic_float16_add",
40-
"Extends the SPV_EXT_shader_atomic_float_add extension to support "
41-
"atomically adding to 16-bit floating-point numbers in memory."),
42-
clEnumValN(
43-
SPIRV::Extension::SPV_EXT_shader_atomic_float_min_max,
44-
"SPV_EXT_shader_atomic_float_min_max",
45-
"Adds atomic min and max instruction on floating-point numbers."),
46-
clEnumValN(SPIRV::Extension::SPV_INTEL_arbitrary_precision_integers,
47-
"SPV_INTEL_arbitrary_precision_integers",
48-
"Allows generating arbitrary width integer types."),
49-
clEnumValN(SPIRV::Extension::SPV_INTEL_optnone, "SPV_INTEL_optnone",
50-
"Adds OptNoneINTEL value for Function Control mask that "
51-
"indicates a request to not optimize the function."),
52-
clEnumValN(SPIRV::Extension::SPV_INTEL_usm_storage_classes,
53-
"SPV_INTEL_usm_storage_classes",
54-
"Introduces two new storage classes that are sub classes of "
55-
"the CrossWorkgroup storage class "
56-
"that provides additional information that can enable "
57-
"optimization."),
58-
clEnumValN(SPIRV::Extension::SPV_INTEL_subgroups, "SPV_INTEL_subgroups",
59-
"Allows work items in a subgroup to share data without the "
60-
"use of local memory and work group barriers, and to "
61-
"utilize specialized hardware to load and store blocks of "
62-
"data from images or buffers."),
63-
clEnumValN(SPIRV::Extension::SPV_KHR_uniform_group_instructions,
64-
"SPV_KHR_uniform_group_instructions",
65-
"Allows support for additional group operations within "
66-
"uniform control flow."),
67-
clEnumValN(SPIRV::Extension::SPV_KHR_no_integer_wrap_decoration,
68-
"SPV_KHR_no_integer_wrap_decoration",
69-
"Adds decorations to indicate that a given instruction does "
70-
"not cause integer wrapping."),
71-
clEnumValN(
72-
SPIRV::Extension::SPV_KHR_float_controls, "SPV_KHR_float_controls",
73-
"Provides new execution modes to control floating-point "
74-
"computations by overriding an implementation’s default behavior "
75-
"for rounding modes, denormals, signed zero, and infinities."),
76-
clEnumValN(SPIRV::Extension::SPV_KHR_expect_assume,
77-
"SPV_KHR_expect_assume",
78-
"Provides additional information to a compiler, similar to "
79-
"the llvm.assume and llvm.expect intrinsics."),
80-
clEnumValN(SPIRV::Extension::SPV_KHR_bit_instructions,
81-
"SPV_KHR_bit_instructions",
82-
"This enables bit instructions to be used by SPIR-V modules "
83-
"without requiring the Shader capability."),
84-
clEnumValN(
85-
SPIRV::Extension::SPV_KHR_linkonce_odr, "SPV_KHR_linkonce_odr",
86-
"Allows to use the LinkOnceODR linkage type that is to let "
87-
"a function or global variable to be merged with other functions "
88-
"or global variables of the same name when linkage occurs."),
89-
clEnumValN(SPIRV::Extension::SPV_INTEL_bfloat16_conversion,
90-
"SPV_INTEL_bfloat16_conversion",
91-
"Adds instructions to convert between single-precision "
92-
"32-bit floating-point values and 16-bit bfloat16 values."),
93-
clEnumValN(SPIRV::Extension::SPV_KHR_subgroup_rotate,
94-
"SPV_KHR_subgroup_rotate",
95-
"Adds a new instruction that enables rotating values across "
96-
"invocations within a subgroup."),
97-
clEnumValN(SPIRV::Extension::SPV_INTEL_variable_length_array,
98-
"SPV_INTEL_variable_length_array",
99-
"Allows to allocate local arrays whose number of elements "
100-
"is unknown at compile time."),
101-
clEnumValN(SPIRV::Extension::SPV_INTEL_function_pointers,
102-
"SPV_INTEL_function_pointers",
103-
"Allows translation of function pointers.")));
31+
cl::opt<std::set<SPIRV::Extension::Extension>, false, SPIRVExtensionsParser>
32+
Extensions("spirv-extensions",
33+
cl::desc("Specify list of enabled SPIR-V extensions"));
10434

10535
// Compare version numbers, but allow 0 to mean unspecified.
10636
static bool isAtLeastVer(uint32_t Target, uint32_t VerToCompareTo) {
@@ -166,8 +96,7 @@ void SPIRVSubtarget::initAvailableExtensions() {
16696
if (!isOpenCLEnv())
16797
return;
16898

169-
for (auto Extension : Extensions)
170-
AvailableExtensions.insert(Extension);
99+
AvailableExtensions.insert(Extensions.begin(), Extensions.end());
171100
}
172101

173102
// TODO: use command line args for this rather than just defaults.

llvm/test/CodeGen/SPIRV/LinkOnceODR.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=SPV_KHR_linkonce_odr %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV-EXT
2-
; TODO: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=SPV_KHR_linkonce_odr %s -o - -filetype=obj | spirv-val %}
1+
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=+SPV_KHR_linkonce_odr %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV-EXT
2+
; TODO: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=+SPV_KHR_linkonce_odr %s -o - -filetype=obj | spirv-val %}
33

44
; CHECK-SPIRV-EXT: Capability Linkage
55
; CHECK-SPIRV-EXT: Extension "SPV_KHR_linkonce_odr"

llvm/test/CodeGen/SPIRV/LinkOnceODRFun.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=SPV_KHR_linkonce_odr %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV-EXT
2-
; TODO: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=SPV_KHR_linkonce_odr %s -o - -filetype=obj | spirv-val %}
1+
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=+SPV_KHR_linkonce_odr %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV-EXT
2+
; TODO: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=+SPV_KHR_linkonce_odr %s -o - -filetype=obj | spirv-val %}
33

44
; CHECK-SPIRV-EXT: Capability Linkage
55
; CHECK-SPIRV-EXT: Extension "SPV_KHR_linkonce_odr"

llvm/test/CodeGen/SPIRV/assume.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
; RUN: llc -mtriple=spirv32-unknown-unknown --spirv-extensions=SPV_KHR_expect_assume < %s | FileCheck --check-prefixes=EXT,CHECK %s
2-
; RUN: llc -mtriple=spirv64-unknown-unknown --spirv-extensions=SPV_KHR_expect_assume < %s | FileCheck --check-prefixes=EXT,CHECK %s
1+
; RUN: llc -mtriple=spirv32-unknown-unknown --spirv-extensions=+SPV_KHR_expect_assume < %s | FileCheck --check-prefixes=EXT,CHECK %s
2+
; RUN: llc -mtriple=spirv64-unknown-unknown --spirv-extensions=+SPV_KHR_expect_assume < %s | FileCheck --check-prefixes=EXT,CHECK %s
33
; RUN: llc -mtriple=spirv32-unknown-unknown < %s | FileCheck --check-prefixes=NOEXT,CHECK %s
44
; RUN: llc -mtriple=spirv64-unknown-unknown < %s | FileCheck --check-prefixes=NOEXT,CHECK %s
55

llvm/test/CodeGen/SPIRV/exec_mode_float_control_khr.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s --check-prefixes=SPV
2-
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s --mattr=+spirv1.3 --spirv-extensions=SPV_KHR_float_controls -o - | FileCheck %s --check-prefixes=SPVEXT
2+
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s --mattr=+spirv1.3 --spirv-extensions=+SPV_KHR_float_controls -o - | FileCheck %s --check-prefixes=SPVEXT
33

44
define dso_local dllexport spir_kernel void @k_float_controls_0(i32 %ibuf, i32 %obuf) local_unnamed_addr {
55
entry:

llvm/test/CodeGen/SPIRV/expect.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
; RUN: llc -mtriple=spirv32-unknown-unknown --spirv-extensions=SPV_KHR_expect_assume < %s | FileCheck --check-prefixes=CHECK,EXT %s
2-
; RUN: llc -mtriple=spirv64-unknown-unknown --spirv-extensions=SPV_KHR_expect_assume < %s | FileCheck --check-prefixes=CHECK,EXT %s
1+
; RUN: llc -mtriple=spirv32-unknown-unknown --spirv-extensions=+SPV_KHR_expect_assume < %s | FileCheck --check-prefixes=CHECK,EXT %s
2+
; RUN: llc -mtriple=spirv64-unknown-unknown --spirv-extensions=+SPV_KHR_expect_assume < %s | FileCheck --check-prefixes=CHECK,EXT %s
33
; RUN: llc -mtriple=spirv32-unknown-unknown < %s | FileCheck --check-prefixes=CHECK,NOEXT %s
44
; RUN: llc -mtriple=spirv64-unknown-unknown < %s | FileCheck --check-prefixes=CHECK,NOEXT %s
55

llvm/test/CodeGen/SPIRV/extensions/SPV_EXT_shader_atomic_float_add/atomicrmw_faddfsub_double.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: not llc -O0 -mtriple=spirv32-unknown-unknown %s -o %t.spvt 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR
22

3-
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=SPV_EXT_shader_atomic_float_add %s -o - | FileCheck %s
3+
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=+SPV_EXT_shader_atomic_float_add %s -o - | FileCheck %s
44

55
; CHECK-ERROR: LLVM ERROR: The atomic float instruction requires the following SPIR-V extension: SPV_EXT_shader_atomic_float_add
66

llvm/test/CodeGen/SPIRV/extensions/SPV_EXT_shader_atomic_float_add/atomicrmw_faddfsub_float.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: not llc -O0 -mtriple=spirv32-unknown-unknown %s -o %t.spvt 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR
22

3-
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=SPV_EXT_shader_atomic_float_add %s -o - | FileCheck %s
3+
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=+SPV_EXT_shader_atomic_float_add %s -o - | FileCheck %s
44

55
; CHECK-ERROR: LLVM ERROR: The atomic float instruction requires the following SPIR-V extension: SPV_EXT_shader_atomic_float_add
66

llvm/test/CodeGen/SPIRV/extensions/SPV_EXT_shader_atomic_float_add/atomicrmw_faddfsub_half.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; RUN: not llc -O0 -mtriple=spirv32-unknown-unknown %s -o %t.spvt 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR1
2-
; RUN: not llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=SPV_EXT_shader_atomic_float_add %s -o %t.spvt 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR2
2+
; RUN: not llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=+SPV_EXT_shader_atomic_float_add %s -o %t.spvt 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR2
33

4-
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=SPV_EXT_shader_atomic_float_add --spirv-extensions=SPV_EXT_shader_atomic_float16_add %s -o - | FileCheck %s
4+
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=+SPV_EXT_shader_atomic_float_add,+SPV_EXT_shader_atomic_float16_add %s -o - | FileCheck %s
55

66
; CHECK-ERROR1: LLVM ERROR: The atomic float instruction requires the following SPIR-V extension: SPV_EXT_shader_atomic_float_add
77
; CHECK-ERROR2: LLVM ERROR: The atomic float instruction requires the following SPIR-V extension: SPV_EXT_shader_atomic_float16_add

llvm/test/CodeGen/SPIRV/extensions/SPV_EXT_shader_atomic_float_min_max/atomicrmw_fminfmax_double.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: not llc -O0 -mtriple=spirv32-unknown-unknown %s -o %t.spvt 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR
22

3-
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=SPV_EXT_shader_atomic_float_min_max %s -o - | FileCheck %s
3+
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=+SPV_EXT_shader_atomic_float_min_max %s -o - | FileCheck %s
44

55
; CHECK-ERROR: LLVM ERROR: The atomic float instruction requires the following SPIR-V extension: SPV_EXT_shader_atomic_float_min_max
66

llvm/test/CodeGen/SPIRV/extensions/SPV_EXT_shader_atomic_float_min_max/atomicrmw_fminfmax_float.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: not llc -O0 -mtriple=spirv32-unknown-unknown %s -o %t.spvt 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR
22

3-
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=SPV_EXT_shader_atomic_float_min_max %s -o - | FileCheck %s
3+
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=+SPV_EXT_shader_atomic_float_min_max %s -o - | FileCheck %s
44

55
; CHECK-ERROR: LLVM ERROR: The atomic float instruction requires the following SPIR-V extension: SPV_EXT_shader_atomic_float_min_max
66

llvm/test/CodeGen/SPIRV/extensions/SPV_EXT_shader_atomic_float_min_max/atomicrmw_fminfmax_half.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: not llc -O0 -mtriple=spirv32-unknown-unknown %s -o %t.spvt 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR
22

3-
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=SPV_EXT_shader_atomic_float_min_max %s -o - | FileCheck %s
3+
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=+SPV_EXT_shader_atomic_float_min_max %s -o - | FileCheck %s
44

55
; CHECK-ERROR: LLVM ERROR: The atomic float instruction requires the following SPIR-V extension: SPV_EXT_shader_atomic_float_min_max
66

llvm/test/CodeGen/SPIRV/extensions/SPV_INTEL_arbitrary_precision_integers.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=SPV_INTEL_arbitrary_precision_integers %s -o - | FileCheck %s
1+
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=+SPV_INTEL_arbitrary_precision_integers %s -o - | FileCheck %s
22

33
define i6 @getConstantI6() {
44
ret i6 2

llvm/test/CodeGen/SPIRV/extensions/SPV_INTEL_bfloat16_conversion/bfloat16-conv-negative1.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: not llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=SPV_INTEL_bfloat16_conversion %s -o %t.spvt 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR
1+
; RUN: not llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=+SPV_INTEL_bfloat16_conversion %s -o %t.spvt 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR
22
; CHECK-ERROR: result and argument must have the same number of components
33

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

llvm/test/CodeGen/SPIRV/extensions/SPV_INTEL_bfloat16_conversion/bfloat16-conv-negative2.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: not llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=SPV_INTEL_bfloat16_conversion %s -o %t.spvt 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR
1+
; RUN: not llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=+SPV_INTEL_bfloat16_conversion %s -o %t.spvt 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR
22
; CHECK-ERROR: result and argument must have the same number of components
33

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

llvm/test/CodeGen/SPIRV/extensions/SPV_INTEL_bfloat16_conversion/bfloat16-conv-negative3.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: not llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=SPV_INTEL_bfloat16_conversion %s -o %t.spvt 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR
1+
; RUN: not llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=+SPV_INTEL_bfloat16_conversion %s -o %t.spvt 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR
22
; CHECK-ERROR: result and argument must have the same number of components
33

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

0 commit comments

Comments
 (0)