@@ -543,56 +543,6 @@ LogicalResult CopyMemoryOp::verify() {
543543 return verifySourceMemoryAccessAttribute (*this );
544544}
545545
546- static ParseResult parsePtrAccessChainOpImpl (StringRef opName,
547- OpAsmParser &parser,
548- OperationState &state) {
549- OpAsmParser::UnresolvedOperand ptrInfo;
550- SmallVector<OpAsmParser::UnresolvedOperand, 4 > indicesInfo;
551- Type type;
552- auto loc = parser.getCurrentLocation ();
553- SmallVector<Type, 4 > indicesTypes;
554-
555- if (parser.parseOperand (ptrInfo) ||
556- parser.parseOperandList (indicesInfo, OpAsmParser::Delimiter::Square) ||
557- parser.parseColonType (type) ||
558- parser.resolveOperand (ptrInfo, type, state.operands ))
559- return failure ();
560-
561- // Check that the provided indices list is not empty before parsing their
562- // type list.
563- if (indicesInfo.empty ())
564- return emitError (state.location ) << opName << " expected element" ;
565-
566- if (parser.parseComma () || parser.parseTypeList (indicesTypes))
567- return failure ();
568-
569- // Check that the indices types list is not empty and that it has a one-to-one
570- // mapping to the provided indices.
571- if (indicesTypes.size () != indicesInfo.size ())
572- return emitError (state.location )
573- << opName
574- << " indices types' count must be equal to indices info count" ;
575-
576- if (parser.resolveOperands (indicesInfo, indicesTypes, loc, state.operands ))
577- return failure ();
578-
579- auto resultType = getElementPtrType (
580- type, llvm::ArrayRef (state.operands ).drop_front (2 ), state.location );
581- if (!resultType)
582- return failure ();
583-
584- state.addTypes (resultType);
585- return success ();
586- }
587-
588- template <typename Op>
589- static auto concatElemAndIndices (Op op) {
590- SmallVector<Value> ret (op.getIndices ().size () + 1 );
591- ret[0 ] = op.getElement ();
592- llvm::copy (op.getIndices (), ret.begin () + 1 );
593- return ret;
594- }
595-
596546// ===----------------------------------------------------------------------===//
597547// spirv.InBoundsPtrAccessChainOp
598548// ===----------------------------------------------------------------------===//
@@ -605,16 +555,6 @@ void InBoundsPtrAccessChainOp::build(OpBuilder &builder, OperationState &state,
605555 build (builder, state, type, basePtr, element, indices);
606556}
607557
608- ParseResult InBoundsPtrAccessChainOp::parse (OpAsmParser &parser,
609- OperationState &result) {
610- return parsePtrAccessChainOpImpl (
611- spirv::InBoundsPtrAccessChainOp::getOperationName (), parser, result);
612- }
613-
614- void InBoundsPtrAccessChainOp::print (OpAsmPrinter &printer) {
615- printAccessChain (*this , concatElemAndIndices (*this ), printer);
616- }
617-
618558LogicalResult InBoundsPtrAccessChainOp::verify () {
619559 return verifyAccessChain (*this , getIndices ());
620560}
@@ -630,16 +570,6 @@ void PtrAccessChainOp::build(OpBuilder &builder, OperationState &state,
630570 build (builder, state, type, basePtr, element, indices);
631571}
632572
633- ParseResult PtrAccessChainOp::parse (OpAsmParser &parser,
634- OperationState &result) {
635- return parsePtrAccessChainOpImpl (spirv::PtrAccessChainOp::getOperationName (),
636- parser, result);
637- }
638-
639- void PtrAccessChainOp::print (OpAsmPrinter &printer) {
640- printAccessChain (*this , concatElemAndIndices (*this ), printer);
641- }
642-
643573LogicalResult PtrAccessChainOp::verify () {
644574 return verifyAccessChain (*this , getIndices ());
645575}
0 commit comments