Skip to content

Commit 75347ba

Browse files
committed
Revert "[mlir][spirv] Add support for OpImageType"
This reverts commit 21f1462.
1 parent 21f1462 commit 75347ba

File tree

6 files changed

+1
-83
lines changed

6 files changed

+1
-83
lines changed

mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBase.td

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3157,7 +3157,6 @@ def SPV_OC_OpTypeInt : I32EnumAttrCase<"OpTypeInt", 21>;
31573157
def SPV_OC_OpTypeFloat : I32EnumAttrCase<"OpTypeFloat", 22>;
31583158
def SPV_OC_OpTypeVector : I32EnumAttrCase<"OpTypeVector", 23>;
31593159
def SPV_OC_OpTypeMatrix : I32EnumAttrCase<"OpTypeMatrix", 24>;
3160-
def SPV_OC_OpTypeImage : I32EnumAttrCase<"OpTypeImage", 25>;
31613160
def SPV_OC_OpTypeArray : I32EnumAttrCase<"OpTypeArray", 28>;
31623161
def SPV_OC_OpTypeRuntimeArray : I32EnumAttrCase<"OpTypeRuntimeArray", 29>;
31633162
def SPV_OC_OpTypeStruct : I32EnumAttrCase<"OpTypeStruct", 30>;
@@ -3316,7 +3315,7 @@ def SPV_OpcodeAttr :
33163315
SPV_OC_OpLine, SPV_OC_OpExtension, SPV_OC_OpExtInstImport, SPV_OC_OpExtInst,
33173316
SPV_OC_OpMemoryModel, SPV_OC_OpEntryPoint, SPV_OC_OpExecutionMode,
33183317
SPV_OC_OpCapability, SPV_OC_OpTypeVoid, SPV_OC_OpTypeBool, SPV_OC_OpTypeInt,
3319-
SPV_OC_OpTypeFloat, SPV_OC_OpTypeVector, SPV_OC_OpTypeMatrix, SPV_OC_OpTypeImage,
3318+
SPV_OC_OpTypeFloat, SPV_OC_OpTypeVector, SPV_OC_OpTypeMatrix,
33203319
SPV_OC_OpTypeArray, SPV_OC_OpTypeRuntimeArray, SPV_OC_OpTypeStruct,
33213320
SPV_OC_OpTypePointer, SPV_OC_OpTypeFunction, SPV_OC_OpTypeForwardPointer,
33223321
SPV_OC_OpConstantTrue, SPV_OC_OpConstantFalse, SPV_OC_OpConstant,

mlir/lib/Target/SPIRV/Deserialization/DeserializeOps.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ LogicalResult spirv::Deserializer::processInstruction(
157157
case spirv::Opcode::OpTypeMatrix:
158158
case spirv::Opcode::OpTypeArray:
159159
case spirv::Opcode::OpTypeFunction:
160-
case spirv::Opcode::OpTypeImage:
161160
case spirv::Opcode::OpTypeRuntimeArray:
162161
case spirv::Opcode::OpTypeStruct:
163162
case spirv::Opcode::OpTypePointer:

mlir/lib/Target/SPIRV/Deserialization/Deserializer.cpp

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -713,8 +713,6 @@ LogicalResult spirv::Deserializer::processType(spirv::Opcode opcode,
713713
return processCooperativeMatrixType(operands);
714714
case spirv::Opcode::OpTypeFunction:
715715
return processFunctionType(operands);
716-
case spirv::Opcode::OpTypeImage:
717-
return processImageType(operands);
718716
case spirv::Opcode::OpTypeRuntimeArray:
719717
return processRuntimeArrayType(operands);
720718
case spirv::Opcode::OpTypeStruct:
@@ -1006,54 +1004,6 @@ spirv::Deserializer::processTypeForwardPointer(ArrayRef<uint32_t> operands) {
10061004
return success();
10071005
}
10081006

1009-
LogicalResult
1010-
spirv::Deserializer::processImageType(ArrayRef<uint32_t> operands) {
1011-
// TODO: Add support for Access Qualifier.
1012-
if (operands.size() != 8)
1013-
return emitError(
1014-
unknownLoc,
1015-
"OpTypeImage with non-eight operands are not supported yet");
1016-
1017-
Type elementTy = getType(operands[1]);
1018-
if (!elementTy)
1019-
return emitError(unknownLoc, "OpTypeImage references undefined <id>: ")
1020-
<< operands[1];
1021-
1022-
auto dim = spirv::symbolizeDim(operands[2]);
1023-
if (!dim)
1024-
return emitError(unknownLoc, "unknown Dim for OpTypeImage: ")
1025-
<< operands[2];
1026-
1027-
auto depthInfo = spirv::symbolizeImageDepthInfo(operands[3]);
1028-
if (!depthInfo)
1029-
return emitError(unknownLoc, "unknown Depth for OpTypeImage: ")
1030-
<< operands[3];
1031-
1032-
auto arrayedInfo = spirv::symbolizeImageArrayedInfo(operands[4]);
1033-
if (!arrayedInfo)
1034-
return emitError(unknownLoc, "unknown Arrayed for OpTypeImage: ")
1035-
<< operands[4];
1036-
1037-
auto samplingInfo = spirv::symbolizeImageSamplingInfo(operands[5]);
1038-
if (!samplingInfo)
1039-
return emitError(unknownLoc, "unknown MS for OpTypeImage: ") << operands[5];
1040-
1041-
auto samplerUseInfo = spirv::symbolizeImageSamplerUseInfo(operands[6]);
1042-
if (!samplerUseInfo)
1043-
return emitError(unknownLoc, "unknown Sampled for OpTypeImage: ")
1044-
<< operands[6];
1045-
1046-
auto format = spirv::symbolizeImageFormat(operands[7]);
1047-
if (!format)
1048-
return emitError(unknownLoc, "unknown Format for OpTypeImage: ")
1049-
<< operands[7];
1050-
1051-
typeMap[operands[0]] = spirv::ImageType::get(
1052-
elementTy, dim.getValue(), depthInfo.getValue(), arrayedInfo.getValue(),
1053-
samplingInfo.getValue(), samplerUseInfo.getValue(), format.getValue());
1054-
return success();
1055-
}
1056-
10571007
//===----------------------------------------------------------------------===//
10581008
// Constant
10591009
//===----------------------------------------------------------------------===//

mlir/lib/Target/SPIRV/Deserialization/Deserializer.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,6 @@ class Deserializer {
273273

274274
LogicalResult processFunctionType(ArrayRef<uint32_t> operands);
275275

276-
LogicalResult processImageType(ArrayRef<uint32_t> operands);
277-
278276
LogicalResult processRuntimeArrayType(ArrayRef<uint32_t> operands);
279277

280278
LogicalResult processStructType(ArrayRef<uint32_t> operands);

mlir/lib/Target/SPIRV/Serialization/Serialization.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,22 +1192,6 @@ LogicalResult Serializer::prepareBasicType(
11921192
return success();
11931193
}
11941194

1195-
if (auto imageType = type.dyn_cast<spirv::ImageType>()) {
1196-
typeEnum = spirv::Opcode::OpTypeImage;
1197-
uint32_t sampledTypeID = 0;
1198-
if (failed(processType(loc, imageType.getElementType(), sampledTypeID)))
1199-
return failure();
1200-
1201-
operands.push_back(sampledTypeID);
1202-
operands.push_back(static_cast<uint32_t>(imageType.getDim()));
1203-
operands.push_back(static_cast<uint32_t>(imageType.getDepthInfo()));
1204-
operands.push_back(static_cast<uint32_t>(imageType.getArrayedInfo()));
1205-
operands.push_back(static_cast<uint32_t>(imageType.getSamplingInfo()));
1206-
operands.push_back(static_cast<uint32_t>(imageType.getSamplerUseInfo()));
1207-
operands.push_back(static_cast<uint32_t>(imageType.getImageFormat()));
1208-
return success();
1209-
}
1210-
12111195
if (auto arrayType = type.dyn_cast<spirv::ArrayType>()) {
12121196
typeEnum = spirv::Opcode::OpTypeArray;
12131197
uint32_t elementTypeID = 0;

mlir/test/Target/SPIRV/image.mlir

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

0 commit comments

Comments
 (0)