llvm/mlir/lib/Conversion/TosaToArith/TosaToArith.cpp

//===- TosaToArith.cpp - Lowering Tosa to Arith Dialect -------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// These rewriters lower from the Tosa to the Arith dialect.
//
//===----------------------------------------------------------------------===//

#include "mlir/Conversion/TosaToArith/TosaToArith.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Tosa/IR/TosaOps.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/TypeUtilities.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"

usingnamespacemlir;
usingnamespacetosa;

namespace {

class ConstOpConverter : public OpRewritePattern<tosa::ConstOp> {};

Type matchContainerType(Type element, Type container) {}

TypedAttr getConstantAttr(Type type, int64_t value, PatternRewriter &rewriter) {}

Value getConstantValue(Location loc, Type type, int64_t value,
                       PatternRewriter &rewriter) {}

// This converts the TOSA ApplyScale operator to a set of arithmetic ops,
// using 64-bit operations to perform the necessary multiply, bias, and shift.
class ApplyScaleGenericOpConverter
    : public OpRewritePattern<tosa::ApplyScaleOp> {};

class ApplyScale32BitOpConverter : public OpRewritePattern<tosa::ApplyScaleOp> {};

} // namespace

void mlir::tosa::populateTosaToArithConversionPatterns(
    RewritePatternSet *patterns) {}

void mlir::tosa::populateTosaRescaleToArithConversionPatterns(
    RewritePatternSet *patterns, bool include32Bit) {}