Skip to content

Commit f3df1c7

Browse files
vmaksimosys-ce-bb
authored andcommitted
Revert "Allow cooperative matrix types for OpMatrixTimesScalar (#2124)" (#2276)
Per discussion in Khronos and the spec itself, OpMatrixTimesScalar should not be used in OpenCL environment, as long as the same can be achieved either via an elementwise multiplication with a cooperative matrix object created from the scalar using OpConstantComposite or by iterating over the elements of the cooperative matrix to multiply each element by the scalar. Spec: https://github.com/KhronosGroup/SPIRV-Registry/blob/main/extensions/KHR/SPV_KHR_cooperative_matrix.asciidoc This reverts commit 6522c4ac4764cc1f251edd4266d06cba64549928. Original commit: KhronosGroup/SPIRV-LLVM-Translator@3b6ff3e
1 parent ec5ec34 commit f3df1c7

File tree

4 files changed

+0
-65
lines changed

4 files changed

+0
-65
lines changed

llvm-spirv/lib/SPIRV/SPIRVReader.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1964,12 +1964,6 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
19641964
IRBuilder<> Builder(BB);
19651965
auto *Scalar = transValue(MTS->getScalar(), F, BB);
19661966
auto *Matrix = transValue(MTS->getMatrix(), F, BB);
1967-
1968-
if (MTS->getMatrix()->getType()->isTypeCooperativeMatrixKHR()) {
1969-
return mapValue(BV, transSPIRVBuiltinFromInst(
1970-
static_cast<SPIRVInstruction *>(BV), BB));
1971-
}
1972-
19731967
uint64_t ColNum = Matrix->getType()->getArrayNumElements();
19741968
auto *ColType = cast<ArrayType>(Matrix->getType())->getElementType();
19751969
auto VecSize = cast<FixedVectorType>(ColType)->getNumElements();

llvm-spirv/lib/SPIRV/SPIRVWriter.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6246,11 +6246,6 @@ LLVMToSPIRVBase::transBuiltinToInstWithoutDecoration(Op OC, CallInst *CI,
62466246
return BM->addCompositeConstructInst(transType(CI->getType()), Operands,
62476247
BB);
62486248
}
6249-
case OpMatrixTimesScalar: {
6250-
return BM->addMatrixTimesScalarInst(
6251-
transType(CI->getType()), transValue(CI->getArgOperand(0), BB)->getId(),
6252-
transValue(CI->getArgOperand(1), BB)->getId(), BB);
6253-
}
62546249
default: {
62556250
if (isCvtOpCode(OC) && OC != OpGenericCastToPtrExplicit) {
62566251
return BM->addUnaryInst(OC, transScavengedType(CI),

llvm-spirv/lib/SPIRV/libSPIRV/SPIRVType.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,6 @@ SPIRVType *SPIRVType::getScalarType() const {
142142
return getVectorComponentType();
143143
case OpTypeMatrix:
144144
return getMatrixColumnType()->getVectorComponentType();
145-
case OpTypeCooperativeMatrixKHR:
146-
return static_cast<const SPIRVTypeCooperativeMatrixKHR *>(this)
147-
->getCompType();
148145
case OpTypeInt:
149146
case OpTypeFloat:
150147
case OpTypeBool:

llvm-spirv/test/extensions/KHR/SPV_KHR_cooperative_matrix/matrix_times_scalar.ll

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

0 commit comments

Comments
 (0)