36 template <
typename AtomicOpTy,
typename ExpectedElementType>
39 auto elementType = ptrType.getPointeeType();
40 if (!llvm::isa<ExpectedElementType>(elementType))
41 return op->
emitOpError() <<
"pointer operand must point to an "
42 << stringifyTypeName<ExpectedElementType>()
43 <<
" value, found " << elementType;
45 StringAttr semanticsAttrName =
46 AtomicOpTy::getSemanticsAttrName(op->
getName());
47 auto memorySemantics =
48 op->
getAttrOfType<spirv::MemorySemanticsAttr>(semanticsAttrName)
61 return verifyAtomicUpdateOp<AtomicAndOp, IntegerType>(getOperation());
69 return verifyAtomicUpdateOp<AtomicIAddOp, IntegerType>(getOperation());
77 return verifyAtomicUpdateOp<EXTAtomicFAddOp, FloatType>(getOperation());
85 return verifyAtomicUpdateOp<AtomicIDecrementOp, IntegerType>(getOperation());
93 return verifyAtomicUpdateOp<AtomicIIncrementOp, IntegerType>(getOperation());
101 return verifyAtomicUpdateOp<AtomicISubOp, IntegerType>(getOperation());
109 return verifyAtomicUpdateOp<AtomicOrOp, IntegerType>(getOperation());
117 return verifyAtomicUpdateOp<AtomicSMaxOp, IntegerType>(getOperation());
125 return verifyAtomicUpdateOp<AtomicSMinOp, IntegerType>(getOperation());
133 return verifyAtomicUpdateOp<AtomicUMaxOp, IntegerType>(getOperation());
141 return verifyAtomicUpdateOp<AtomicUMinOp, IntegerType>(getOperation());
149 return verifyAtomicUpdateOp<AtomicXorOp, IntegerType>(getOperation());
Operation is the basic unit of execution within MLIR.
Value getOperand(unsigned idx)
AttrClass getAttrOfType(StringAttr name)
OperationName getName()
The name of an operation is the key identifier for it.
InFlightDiagnostic emitOpError(const Twine &message={})
Emit an error with the op name prefixed, like "'dim' op " which is convenient for verifiers.
Type getType() const
Return the type of this value.
static StringRef stringifyTypeName()
LogicalResult verifyMemorySemantics(Operation *op, spirv::MemorySemantics memorySemantics)
StringRef stringifyTypeName< FloatType >()
StringRef stringifyTypeName< IntegerType >()
static LogicalResult verifyAtomicUpdateOp(Operation *op)
LogicalResult verify(Operation *op, bool verifyRecursively=true)
Perform (potentially expensive) checks of invariants, used to detect compiler bugs,...