@@ -187,7 +187,6 @@ class ConvertFIRToLLVMPattern : public mlir::ConvertToLLVMPattern {
187187
188188 const fir::FIRToLLVMPassOptions &options;
189189
190- using ConvertToLLVMPattern::match;
191190 using ConvertToLLVMPattern::matchAndRewrite;
192191};
193192
@@ -206,20 +205,6 @@ class FIROpConversion : public ConvertFIRToLLVMPattern {
206205 options, benefit) {}
207206
208207 // / Wrappers around the RewritePattern methods that pass the derived op type.
209- void rewrite (mlir::Operation *op, mlir::ArrayRef<mlir::Value> operands,
210- mlir::ConversionPatternRewriter &rewriter) const final {
211- rewrite (mlir::cast<SourceOp>(op),
212- OpAdaptor (operands, mlir::cast<SourceOp>(op)), rewriter);
213- }
214- void rewrite (mlir::Operation *op, mlir::ArrayRef<mlir::ValueRange> operands,
215- mlir::ConversionPatternRewriter &rewriter) const final {
216- auto sourceOp = llvm::cast<SourceOp>(op);
217- rewrite (llvm::cast<SourceOp>(op), OneToNOpAdaptor (operands, sourceOp),
218- rewriter);
219- }
220- llvm::LogicalResult match (mlir::Operation *op) const final {
221- return match (mlir::cast<SourceOp>(op));
222- }
223208 llvm::LogicalResult
224209 matchAndRewrite (mlir::Operation *op, mlir::ArrayRef<mlir::Value> operands,
225210 mlir::ConversionPatternRewriter &rewriter) const final {
@@ -235,28 +220,12 @@ class FIROpConversion : public ConvertFIRToLLVMPattern {
235220 return matchAndRewrite (sourceOp, OneToNOpAdaptor (operands, sourceOp),
236221 rewriter);
237222 }
238- // / Rewrite and Match methods that operate on the SourceOp type. These must be
223+ // / Methods that operate on the SourceOp type. These must be
239224 // / overridden by the derived pattern class.
240- virtual llvm::LogicalResult match (SourceOp op) const {
241- llvm_unreachable (" must override match or matchAndRewrite" );
242- }
243- virtual void rewrite (SourceOp op, OpAdaptor adaptor,
244- mlir::ConversionPatternRewriter &rewriter) const {
245- llvm_unreachable (" must override rewrite or matchAndRewrite" );
246- }
247- virtual void rewrite (SourceOp op, OneToNOpAdaptor adaptor,
248- mlir::ConversionPatternRewriter &rewriter) const {
249- llvm::SmallVector<mlir::Value> oneToOneOperands =
250- getOneToOneAdaptorOperands (adaptor.getOperands ());
251- rewrite (op, OpAdaptor (oneToOneOperands, adaptor), rewriter);
252- }
253225 virtual llvm::LogicalResult
254226 matchAndRewrite (SourceOp op, OpAdaptor adaptor,
255227 mlir::ConversionPatternRewriter &rewriter) const {
256- if (mlir::failed (match (op)))
257- return mlir::failure ();
258- rewrite (op, adaptor, rewriter);
259- return mlir::success ();
228+ llvm_unreachable (" matchAndRewrite is not implemented" );
260229 }
261230 virtual llvm::LogicalResult
262231 matchAndRewrite (SourceOp op, OneToNOpAdaptor adaptor,
@@ -268,7 +237,6 @@ class FIROpConversion : public ConvertFIRToLLVMPattern {
268237
269238private:
270239 using ConvertFIRToLLVMPattern::matchAndRewrite;
271- using ConvertToLLVMPattern::match;
272240};
273241
274242// / FIR conversion pattern template
0 commit comments