@@ -187,7 +187,6 @@ class ConvertFIRToLLVMPattern : public mlir::ConvertToLLVMPattern {
187
187
188
188
const fir::FIRToLLVMPassOptions &options;
189
189
190
- using ConvertToLLVMPattern::match;
191
190
using ConvertToLLVMPattern::matchAndRewrite;
192
191
};
193
192
@@ -206,20 +205,6 @@ class FIROpConversion : public ConvertFIRToLLVMPattern {
206
205
options, benefit) {}
207
206
208
207
// / 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
- }
223
208
llvm::LogicalResult
224
209
matchAndRewrite (mlir::Operation *op, mlir::ArrayRef<mlir::Value> operands,
225
210
mlir::ConversionPatternRewriter &rewriter) const final {
@@ -235,28 +220,12 @@ class FIROpConversion : public ConvertFIRToLLVMPattern {
235
220
return matchAndRewrite (sourceOp, OneToNOpAdaptor (operands, sourceOp),
236
221
rewriter);
237
222
}
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
239
224
// / 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
- }
253
225
virtual llvm::LogicalResult
254
226
matchAndRewrite (SourceOp op, OpAdaptor adaptor,
255
227
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" );
260
229
}
261
230
virtual llvm::LogicalResult
262
231
matchAndRewrite (SourceOp op, OneToNOpAdaptor adaptor,
@@ -268,7 +237,6 @@ class FIROpConversion : public ConvertFIRToLLVMPattern {
268
237
269
238
private:
270
239
using ConvertFIRToLLVMPattern::matchAndRewrite;
271
- using ConvertToLLVMPattern::match;
272
240
};
273
241
274
242
// / FIR conversion pattern template
0 commit comments