22 Type pointeeType = llvm::cast<spirv::PointerType>(pointer).getPointeeType();
23 if (!llvm::isa<spirv::ScalarType>(pointeeType) &&
24 !llvm::isa<VectorType>(pointeeType))
26 "Pointer must point to a scalar or vector type but provided ")
28 spirv::StorageClass storage =
29 llvm::cast<spirv::PointerType>(pointer).getStorageClass();
30 if (storage != spirv::StorageClass::Workgroup &&
31 storage != spirv::StorageClass::CrossWorkgroup &&
32 storage != spirv::StorageClass::UniformConstant &&
33 storage != spirv::StorageClass::Generic)
34 return op->
emitError(
"Pointer storage class must be Workgroup or "
35 "CrossWorkgroup but provided ")
36 << stringifyStorageClass(storage);
42 getResult().getType());
51 getObject().getType());
60 return op.
emitOpError(
"result and third operand must have the same type");
61 auto typeA = llvm::cast<spirv::JointMatrixINTELType>(op.getA().getType());
62 auto typeB = llvm::cast<spirv::JointMatrixINTELType>(op.getB().getType());
63 auto typeC = llvm::cast<spirv::JointMatrixINTELType>(op.getC().getType());
66 if (typeA.getRows() != typeR.getRows() ||
67 typeA.getColumns() != typeB.getRows() ||
68 typeB.getColumns() != typeR.getColumns())
70 if (typeR.getScope() != typeA.getScope() ||
71 typeR.getScope() != typeB.getScope() ||
72 typeR.getScope() != typeC.getScope())
74 if (typeA.getElementType() != typeB.getElementType() ||
75 typeR.getElementType() != typeC.getElementType())
76 return op.
emitOpError(
"matrix element type must match");
Operation is the basic unit of execution within MLIR.
OpResult getResult(unsigned idx)
Get the 'idx'th result of this operation.
InFlightDiagnostic emitError(const Twine &message={})
Emit an error about fatal conditions with this operation, reporting up to any diagnostic handlers tha...
InFlightDiagnostic emitOpError(const Twine &message={})
Emit an error with the op name prefixed, like "'dim' op " which is convenient for verifiers.
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
Type getType() const
Return the type of this value.
Include the generated interface declarations.
LogicalResult success(bool isSuccess=true)
Utility function to generate a LogicalResult.
static LogicalResult verifyPointerAndJointMatrixType(Operation *op, Type pointer, Type jointMatrix)
static LogicalResult verifyJointMatrixMad(spirv::INTELJointMatrixMadOp op)
LogicalResult verify(Operation *op, bool verifyRecursively=true)
Perform (potentially expensive) checks of invariants, used to detect compiler bugs,...
This class represents an efficient way to signal success or failure.