2020-05-07 09:41:54 +08:00
|
|
|
//===-- Passes.td - Pass definition file -------------------*- tablegen -*-===//
|
|
|
|
//
|
|
|
|
// 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
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2020-10-07 07:14:37 +08:00
|
|
|
#ifndef NPCOMP_REFBACKEND_PASSES
|
|
|
|
#define NPCOMP_REFBACKEND_PASSES
|
2020-05-07 09:41:54 +08:00
|
|
|
|
|
|
|
include "mlir/Pass/PassBase.td"
|
|
|
|
|
2020-10-08 08:12:52 +08:00
|
|
|
def LowerToRefbackrtABI : Pass<"lower-to-refbackrt-abi", "ModuleOp"> {
|
|
|
|
let summary = "Lower constructs requiring runtime support to `refbackrt`";
|
2020-09-17 08:31:40 +08:00
|
|
|
let description = [{
|
2020-10-08 08:12:52 +08:00
|
|
|
We have a specialized dialect `refbackrt` which models our runtime's data
|
2020-09-17 08:31:40 +08:00
|
|
|
structures, and function signatures (and presumably eventually, other
|
|
|
|
ABI boundaries like external calls if we ever support it) will be
|
|
|
|
converted.
|
|
|
|
|
|
|
|
The constructs requiring runtime support are:
|
|
|
|
- function signatures / module metadata
|
|
|
|
- error handling
|
|
|
|
}];
|
2020-10-08 08:12:52 +08:00
|
|
|
let constructor = "mlir::NPCOMP::createLowerToRefbackrtABIPass()";
|
2020-05-16 07:33:01 +08:00
|
|
|
}
|
|
|
|
|
2020-05-19 03:50:16 +08:00
|
|
|
def LowerAllocMemRefOps : Pass<"lower-alloc-memref-ops", "FuncOp"> {
|
|
|
|
let summary = "Lower AllocMemRefOp's";
|
|
|
|
let constructor = "mlir::NPCOMP::createLowerAllocMemRefOpsPass()";
|
2021-04-23 09:11:40 +08:00
|
|
|
let dependentDialects = ["tensor::TensorDialect", "memref::MemRefDialect"];
|
2020-05-19 03:50:16 +08:00
|
|
|
}
|
|
|
|
|
2020-10-07 07:14:37 +08:00
|
|
|
def LowerToLLVM : Pass<"refback-lower-to-llvm", "ModuleOp"> {
|
2020-05-21 09:48:53 +08:00
|
|
|
let summary = "Lower everything to LLVM";
|
|
|
|
let constructor = "mlir::NPCOMP::createLowerToLLVMPass();";
|
|
|
|
}
|
|
|
|
|
2020-10-07 07:14:37 +08:00
|
|
|
#endif // NPCOMP_REFBACKEND_PASSES
|