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
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef NPCOMP_CONVERSION_PASSES
|
|
|
|
#define NPCOMP_CONVERSION_PASSES
|
|
|
|
|
|
|
|
include "mlir/Pass/PassBase.td"
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
2020-11-05 08:54:52 +08:00
|
|
|
// ATen conversions
|
2020-05-07 09:41:54 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2020-11-05 08:54:52 +08:00
|
|
|
def ConvertATenToTCF : Pass<"convert-aten-to-tcf", "FuncOp"> {
|
|
|
|
let summary = "Convert recognized ATen to TCF ops";
|
|
|
|
let constructor = "mlir::NPCOMP::createConvertATenToTCFPass()";
|
2020-05-07 09:41:54 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
2020-06-14 14:45:43 +08:00
|
|
|
// Basicpy conversions
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
def ConvertBasicpyToStd : Pass<"convert-basicpy-to-std", "FuncOp"> {
|
|
|
|
let summary = "Convert representable Basicpy ops to std";
|
|
|
|
let constructor = "mlir::NPCOMP::createConvertBasicpyToStdPass()";
|
|
|
|
}
|
|
|
|
|
2020-07-09 12:03:57 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Numpy conversions
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
def ConvertNumpyToTCF : Pass<"convert-numpy-to-tcf", "FuncOp"> {
|
|
|
|
let summary = "Convert the numpy dialect to supported TCF ops";
|
|
|
|
let constructor = "mlir::NPCOMP::createConvertNumpyToTCFPass()";
|
|
|
|
}
|
|
|
|
|
2020-11-10 07:49:22 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// TCFToTCP
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2020-11-14 07:34:24 +08:00
|
|
|
def ConvertTCFToLinalg : Pass<"convert-tcf-to-linalg", "FuncOp"> {
|
2020-11-10 07:49:22 +08:00
|
|
|
let summary = "Convert TCF to Linalg";
|
|
|
|
let description = [{
|
|
|
|
The intention is for this pass to convert mainly to linalg named ops.
|
|
|
|
|
|
|
|
Because linalg is at the "TCP" layer of abstraction, this pass has to
|
|
|
|
concern itself with generating guards for error cases.
|
|
|
|
}];
|
|
|
|
let constructor = "mlir::NPCOMP::createConvertTCFToLinalgPass()";
|
|
|
|
}
|
|
|
|
|
2020-11-07 09:17:28 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// TCFToStd
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2020-11-14 07:34:24 +08:00
|
|
|
def ConvertTCFToStd : Pass<"convert-tcf-to-std", "FuncOp"> {
|
2020-11-07 09:17:28 +08:00
|
|
|
let summary = "Convert TCF to Std";
|
|
|
|
let constructor = "mlir::NPCOMP::createConvertTCFToStdPass()";
|
|
|
|
}
|
|
|
|
|
2020-11-05 08:54:52 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// TCFToTCP
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2020-11-14 07:34:24 +08:00
|
|
|
def ConvertTCFToTCP : Pass<"convert-tcf-to-tcp", "FuncOp"> {
|
2020-11-05 08:54:52 +08:00
|
|
|
let summary = "Convert TCF to TCP";
|
|
|
|
let constructor = "mlir::NPCOMP::createConvertTCFToTCPPass()";
|
|
|
|
}
|
|
|
|
|
2020-05-07 09:41:54 +08:00
|
|
|
#endif // NPCOMP_CONVERSION_PASSES
|