Skip to content

Commit 69d6c1f

Browse files
authored
Revert "[SPIR-V] Support SPV_INTEL_int4 extension" (#141219)
Reverts #141031
1 parent 5c3a997 commit 69d6c1f

File tree

9 files changed

+7
-102
lines changed

9 files changed

+7
-102
lines changed

llvm/docs/SPIRVUsage.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,6 @@ list of supported SPIR-V extensions, sorted alphabetically by their extension na
215215
- Adds a bitwise instruction on three operands and a look-up table index for specifying the bitwise operation to perform.
216216
* - ``SPV_INTEL_subgroup_matrix_multiply_accumulate``
217217
- Adds an instruction to compute the matrix product of an M x K matrix with a K x N matrix and then add an M x N matrix.
218-
* - ``SPV_INTEL_int4``
219-
- Adds support for 4-bit integer type, and allow this type to be used in cooperative matrices.
220218

221219
To enable multiple extensions, list them separated by comma. For example, to enable support for atomic operations on floating-point numbers and arbitrary precision integers, use:
222220

llvm/lib/Target/SPIRV/SPIRVCommandLine.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ static const std::map<std::string, SPIRV::Extension::Extension, std::less<>>
9999
{"SPV_INTEL_ternary_bitwise_function",
100100
SPIRV::Extension::Extension::SPV_INTEL_ternary_bitwise_function},
101101
{"SPV_INTEL_2d_block_io",
102-
SPIRV::Extension::Extension::SPV_INTEL_2d_block_io},
103-
{"SPV_INTEL_int4", SPIRV::Extension::Extension::SPV_INTEL_int4}};
102+
SPIRV::Extension::Extension::SPV_INTEL_2d_block_io}};
104103

105104
bool SPIRVExtensionsParser::parse(cl::Option &O, StringRef ArgName,
106105
StringRef ArgValue,

llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,7 @@ unsigned SPIRVGlobalRegistry::adjustOpTypeIntWidth(unsigned Width) const {
154154
report_fatal_error("Unsupported integer width!");
155155
const SPIRVSubtarget &ST = cast<SPIRVSubtarget>(CurMF->getSubtarget());
156156
if (ST.canUseExtension(
157-
SPIRV::Extension::SPV_INTEL_arbitrary_precision_integers) ||
158-
ST.canUseExtension(SPIRV::Extension::SPV_INTEL_int4))
157+
SPIRV::Extension::SPV_INTEL_arbitrary_precision_integers))
159158
return Width;
160159
if (Width <= 8)
161160
Width = 8;
@@ -175,14 +174,9 @@ SPIRVType *SPIRVGlobalRegistry::getOpTypeInt(unsigned Width,
175174
const SPIRVSubtarget &ST =
176175
cast<SPIRVSubtarget>(MIRBuilder.getMF().getSubtarget());
177176
return createOpType(MIRBuilder, [&](MachineIRBuilder &MIRBuilder) {
178-
if (Width == 4 && ST.canUseExtension(SPIRV::Extension::SPV_INTEL_int4)) {
179-
MIRBuilder.buildInstr(SPIRV::OpExtension)
180-
.addImm(SPIRV::Extension::SPV_INTEL_int4);
181-
MIRBuilder.buildInstr(SPIRV::OpCapability)
182-
.addImm(SPIRV::Capability::Int4TypeINTEL);
183-
} else if ((!isPowerOf2_32(Width) || Width < 8) &&
184-
ST.canUseExtension(
185-
SPIRV::Extension::SPV_INTEL_arbitrary_precision_integers)) {
177+
if ((!isPowerOf2_32(Width) || Width < 8) &&
178+
ST.canUseExtension(
179+
SPIRV::Extension::SPV_INTEL_arbitrary_precision_integers)) {
186180
MIRBuilder.buildInstr(SPIRV::OpExtension)
187181
.addImm(SPIRV::Extension::SPV_INTEL_arbitrary_precision_integers);
188182
MIRBuilder.buildInstr(SPIRV::OpCapability)
@@ -1569,13 +1563,6 @@ SPIRVType *SPIRVGlobalRegistry::getOrCreateOpTypeCoopMatr(
15691563
const MachineInstr *NewMI =
15701564
createOpType(MIRBuilder, [&](MachineIRBuilder &MIRBuilder) {
15711565
SPIRVType *SpvTypeInt32 = getOrCreateSPIRVIntegerType(32, MIRBuilder);
1572-
const Type *ET = getTypeForSPIRVType(ElemType);
1573-
if (ET->isIntegerTy() && ET->getIntegerBitWidth() == 4 &&
1574-
cast<SPIRVSubtarget>(MIRBuilder.getMF().getSubtarget())
1575-
.canUseExtension(SPIRV::Extension::SPV_INTEL_int4)) {
1576-
MIRBuilder.buildInstr(SPIRV::OpCapability)
1577-
.addImm(SPIRV::Capability::Int4CooperativeMatrixINTEL);
1578-
}
15791566
return MIRBuilder.buildInstr(SPIRV::OpTypeCooperativeMatrixKHR)
15801567
.addDef(createTypeVReg(MIRBuilder))
15811568
.addUse(getSPIRVTypeID(ElemType))

llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,7 @@ SPIRVLegalizerInfo::SPIRVLegalizerInfo(const SPIRVSubtarget &ST) {
128128
bool IsExtendedInts =
129129
ST.canUseExtension(
130130
SPIRV::Extension::SPV_INTEL_arbitrary_precision_integers) ||
131-
ST.canUseExtension(SPIRV::Extension::SPV_KHR_bit_instructions) ||
132-
ST.canUseExtension(SPIRV::Extension::SPV_INTEL_int4);
131+
ST.canUseExtension(SPIRV::Extension::SPV_KHR_bit_instructions);
133132
auto extendedScalarsAndVectors =
134133
[IsExtendedInts](const LegalityQuery &Query) {
135134
const LLT Ty = Query.Types[0];

llvm/lib/Target/SPIRV/SPIRVPreLegalizer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,7 @@ generateAssignInstrs(MachineFunction &MF, SPIRVGlobalRegistry *GR,
492492
bool IsExtendedInts =
493493
ST->canUseExtension(
494494
SPIRV::Extension::SPV_INTEL_arbitrary_precision_integers) ||
495-
ST->canUseExtension(SPIRV::Extension::SPV_KHR_bit_instructions) ||
496-
ST->canUseExtension(SPIRV::Extension::SPV_INTEL_int4);
495+
ST->canUseExtension(SPIRV::Extension::SPV_KHR_bit_instructions);
497496

498497
for (MachineBasicBlock *MBB : post_order(&MF)) {
499498
if (MBB->empty())

llvm/lib/Target/SPIRV/SPIRVSymbolicOperands.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@ defm SPV_INTEL_fp_max_error : ExtensionOperand<119>;
317317
defm SPV_INTEL_ternary_bitwise_function : ExtensionOperand<120>;
318318
defm SPV_INTEL_subgroup_matrix_multiply_accumulate : ExtensionOperand<121>;
319319
defm SPV_INTEL_2d_block_io : ExtensionOperand<122>;
320-
defm SPV_INTEL_int4 : ExtensionOperand<123>;
321320

322321
//===----------------------------------------------------------------------===//
323322
// Multiclass used to define Capabilities enum values and at the same time
@@ -523,8 +522,6 @@ defm SubgroupMatrixMultiplyAccumulateINTEL : CapabilityOperand<6236, 0, 0, [SPV_
523522
defm Subgroup2DBlockIOINTEL : CapabilityOperand<6228, 0, 0, [SPV_INTEL_2d_block_io], []>;
524523
defm Subgroup2DBlockTransformINTEL : CapabilityOperand<6229, 0, 0, [SPV_INTEL_2d_block_io], [Subgroup2DBlockIOINTEL]>;
525524
defm Subgroup2DBlockTransposeINTEL : CapabilityOperand<6230, 0, 0, [SPV_INTEL_2d_block_io], [Subgroup2DBlockIOINTEL]>;
526-
defm Int4TypeINTEL : CapabilityOperand<5112, 0, 0, [SPV_INTEL_int4], []>;
527-
defm Int4CooperativeMatrixINTEL : CapabilityOperand<5114, 0, 0, [SPV_INTEL_int4], [Int4TypeINTEL, CooperativeMatrixKHR]>;
528525

529526
//===----------------------------------------------------------------------===//
530527
// Multiclass used to define SourceLanguage enum values and at the same time

llvm/test/CodeGen/SPIRV/extensions/SPV_INTEL_int4/cooperative_matrix.ll

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

llvm/test/CodeGen/SPIRV/extensions/SPV_INTEL_int4/negative.ll

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

llvm/test/CodeGen/SPIRV/extensions/SPV_INTEL_int4/trivial.ll

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

0 commit comments

Comments
 (0)