[Mlir-commits] [mlir] [mlir][SPIRV] update SPIRV Atomic Ops to assemblyFormat (PR #76323)
Alex Beloi
llvmlistbot at llvm.org
Sun Dec 24 01:07:00 PST 2023
================
@@ -101,46 +58,6 @@ static LogicalResult verifyAtomicUpdateOp(Operation *op) {
return success();
}
-template <typename T>
-static void printAtomicCompareExchangeImpl(T atomOp, OpAsmPrinter &printer) {
- printer << " \"" << stringifyScope(atomOp.getMemoryScope()) << "\" \""
- << stringifyMemorySemantics(atomOp.getEqualSemantics()) << "\" \""
- << stringifyMemorySemantics(atomOp.getUnequalSemantics()) << "\" "
- << atomOp.getOperands() << " : " << atomOp.getPointer().getType();
-}
-
-static ParseResult parseAtomicCompareExchangeImpl(OpAsmParser &parser,
- OperationState &state) {
- spirv::Scope memoryScope;
- spirv::MemorySemantics equalSemantics, unequalSemantics;
- SmallVector<OpAsmParser::UnresolvedOperand, 3> operandInfo;
- Type type;
- if (parseEnumStrAttr<spirv::ScopeAttr>(memoryScope, parser, state,
- kMemoryScopeAttrName) ||
- parseEnumStrAttr<spirv::MemorySemanticsAttr>(
- equalSemantics, parser, state, kEqualSemanticsAttrName) ||
- parseEnumStrAttr<spirv::MemorySemanticsAttr>(
- unequalSemantics, parser, state, kUnequalSemanticsAttrName) ||
- parser.parseOperandList(operandInfo, 3))
- return failure();
-
- auto loc = parser.getCurrentLocation();
- if (parser.parseColonType(type))
- return failure();
-
- auto ptrType = llvm::dyn_cast<spirv::PointerType>(type);
- if (!ptrType)
- return parser.emitError(loc, "expected pointer type");
-
- if (parser.resolveOperands(
- operandInfo,
- {ptrType, ptrType.getPointeeType(), ptrType.getPointeeType()},
- parser.getNameLoc(), state.operands))
- return failure();
-
- return parser.addTypeToList(ptrType.getPointeeType(), state.types);
-}
-
template <typename T>
static LogicalResult verifyAtomicCompareExchangeImpl(T atomOp) {
----------------
alexbeloi wrote:
Can these verifiers also be removed?
https://github.com/llvm/llvm-project/pull/76323
More information about the Mlir-commits
mailing list