picceler
A compiled DSL for image processing, built on MLIR
Loading...
Searching...
No Matches
picceler_to_affine_pass.cpp File Reference
#include "passes.h"
#include "channels.h"
#include "spdlog/spdlog.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/Math/IR/Math.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/IRMapping.h"
#include "mlir/Pass/Pass.h"
#include "mlir/IR/Matchers.h"
#include "mlir/Transforms/DialectConversion.h"
#include "mlir/IR/BuiltinOps.h"
#include "ops.h"
#include "types.h"
#include "dialect.h"
#include "piccelerPasses.h.inc"

Classes

struct  picceler::RotateToAffine
struct  picceler::NeighbourhoodOpsToAffine
struct  picceler::ElementWiseBinaryOpToAffine
struct  picceler::ElementWiseUnaryOpToAffine
struct  picceler::CropToAffine
struct  picceler::PiccelerToAffinePass
 A pass that converts Picceler operations to the Affine dialect. This is the crucial step where we lower from our high-level image processing operations to a more explicit representation that can be further lowered to LLVM IR. Each Picceler operation is matched and rewritten into one or more Affine loops that perform the equivalent computation. This pass also handles type conversions and ensures that necessary runtime functions (like piccelerCreateImage) are declared. More...

Namespaces

namespace  picceler

Macros

#define GEN_PASS_DEF_PICCELERTOAFFINE

Functions

mlir::FailureOr< mlir::Value > picceler::hoistArithChainToFunctionTop (mlir::ConversionPatternRewriter &rewriter, mlir::func::FuncOp funcOp, mlir::Operation *insertBefore, mlir::Value value)
 Relocates value's defining chain to funcOp's top level, since MLIR requires an affine.parallel/affine.apply dim or symbol to be defined there. Only safe for a pure arith chain (a compile-time-constant kernel size); fails otherwise.
The following functions create instances of the various passes used in the compilation process.

Each function corresponds to a specific pass that transforms the IR in a particular way.

std::unique_ptr< mlir::Pass > picceler::createPiccelerToAffinePass ()

Macro Definition Documentation

◆ GEN_PASS_DEF_PICCELERTOAFFINE

#define GEN_PASS_DEF_PICCELERTOAFFINE