#include "mlir/Conversion/TosaToSCF/TosaToSCF.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "mlir/Dialect/Tosa/IR/TosaOps.h"
#include "mlir/IR/IRMapping.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
usingnamespacemlir;
usingnamespacetosa;
static void inlineIfCase(Region &srcRegion, Region &dstRegion,
OperandRange operands, PatternRewriter &rewriter) { … }
static void inlineWhileCase(Region &srcRegion, Region &dstRegion,
PatternRewriter &rewriter, bool isCond) { … }
namespace {
class IfOpConverter : public OpRewritePattern<tosa::IfOp> { … };
class ScatterOpConverter : public OpRewritePattern<tosa::ScatterOp> { … };
class WhileOpConverter : public OpRewritePattern<tosa::WhileOp> { … };
}
void mlir::tosa::populateTosaToSCFConversionPatterns(
RewritePatternSet *patterns) { … }