Bump llvm-project to 484b6648fdd4b104eaf7a2504dd07b60af2c9f8d

- add_mlir_doc arg order
- fix some dependent dialects on passes that were now causing errors
- "encoding" attribute on mlirRankedTensorTypeGetChecked
pull/210/head
Sean Silva 2021-04-22 18:11:40 -07:00
parent b8ad0189ac
commit 544cb4ef54
27 changed files with 36 additions and 30 deletions

@ -1 +1 @@
Subproject commit 223dcdcfbe23affdf17ada7f023ee1872fd76160
Subproject commit 484b6648fdd4b104eaf7a2504dd07b60af2c9f8d

View File

@ -224,8 +224,8 @@ MlirAttribute torch_mlir::converTensorToMlirElementsAttr(at::Tensor tensor,
elementType = typeMapper.mapFromTorchScalarType(tensor.scalar_type());
}
std::vector<int64_t> shape(tensor.sizes().begin(), tensor.sizes().end());
MlirType shapedType = mlirRankedTensorTypeGetChecked(loc, shape.size(),
shape.data(), elementType);
MlirType shapedType = mlirRankedTensorTypeGetChecked(
loc, shape.size(), shape.data(), elementType, {nullptr});
if (mlirTypeIsNull(shapedType)) {
throwUnsupportedTensorError();
}

View File

@ -2,4 +2,4 @@ set(LLVM_TARGET_DEFINITIONS Passes.td)
mlir_tablegen(Passes.h.inc -gen-pass-decls)
add_public_tablegen_target(NPCOMPCommonBackendPassIncGen)
add_mlir_doc(Passes -gen-pass-doc CommonBackendPasses ./)
add_mlir_doc(Passes CommonBackendPasses ./ -gen-pass-doc)

View File

@ -2,4 +2,4 @@ set(LLVM_TARGET_DEFINITIONS Passes.td)
mlir_tablegen(Passes.h.inc -gen-pass-decls)
add_public_tablegen_target(NPCOMPIREEBackendPassIncGen)
add_mlir_doc(Passes -gen-pass-doc IREEBackendPasses ./)
add_mlir_doc(Passes IREEBackendPasses ./ -gen-pass-doc)

View File

@ -2,4 +2,4 @@ set(LLVM_TARGET_DEFINITIONS Passes.td)
mlir_tablegen(Passes.h.inc -gen-pass-decls ${NPCOMP_TABLEGEN_ARGS})
add_public_tablegen_target(NPCOMPConversionPassIncGen)
add_mlir_doc(Passes -gen-pass-doc NPCOMPConversionPasses ./)
add_mlir_doc(Passes NPCOMPConversionPasses ./ -gen-pass-doc)

View File

@ -15,5 +15,5 @@ mlir_tablegen(ATenOpInterfaces.cpp.inc -gen-op-interface-defs)
add_public_tablegen_target(MLIRATenOpInterfacesIncGen)
add_dependencies(mlir-generic-headers MLIRATenOpInterfacesIncGen)
add_mlir_doc(ATenDialect -gen-dialect-doc ATenDialect ATen/)
add_mlir_doc(ATenOps -gen-op-doc ATenOps ATen/)
add_mlir_doc(ATenDialect ATenDialect ATen/ -gen-dialect-doc)
add_mlir_doc(ATenOps ATenOps ATen/ -gen-op-doc)

View File

@ -10,5 +10,5 @@ mlir_tablegen(${dialect}Enums.cpp.inc -gen-enum-defs)
add_public_tablegen_target(MLIR${dialect}IncGen)
add_dependencies(mlir-headers MLIR${dialect}IncGen)
add_mlir_doc(BasicpyDialect -gen-dialect-doc BasicpyDialect Basicpy/)
add_mlir_doc(BasicpyOps -gen-op-doc BasicpyOps Basicpy/)
add_mlir_doc(BasicpyDialect BasicpyDialect Basicpy/ -gen-dialect-doc)
add_mlir_doc(BasicpyOps BasicpyOps Basicpy/ -gen-op-doc)

View File

@ -2,4 +2,4 @@ set(LLVM_TARGET_DEFINITIONS Passes.td)
mlir_tablegen(Passes.h.inc -gen-pass-decls)
add_public_tablegen_target(NPCOMPBasicpyPassIncGen)
add_mlir_doc(Passes -gen-pass-doc Transforms ./)
add_mlir_doc(Passes Transforms ./ -gen-pass-doc)

View File

@ -1,3 +1,3 @@
add_mlir_dialect(NumpyOps numpy)
add_mlir_doc(NumpyDialect -gen-dialect-doc NumpyDialect Numpy/)
add_mlir_doc(NumpyOps -gen-op-doc NumpyOps Numpy/)
add_mlir_doc(NumpyDialect NumpyDialect Numpy/ -gen-dialect-doc)
add_mlir_doc(NumpyOps NumpyOps Numpy/ -gen-op-doc)

View File

@ -2,5 +2,4 @@ set(LLVM_TARGET_DEFINITIONS Passes.td)
mlir_tablegen(Passes.h.inc -gen-pass-decls)
add_public_tablegen_target(NPCOMPNumpyPassIncGen)
add_mlir_doc(Passes -gen-pass-doc NPCOMPNumpyTransforms ./)
add_mlir_doc(Passes NPCOMPNumpyTransforms ./ -gen-pass-doc)

View File

@ -2,5 +2,4 @@ set(LLVM_TARGET_DEFINITIONS Passes.td)
mlir_tablegen(Passes.h.inc -gen-pass-decls)
add_public_tablegen_target(NPCOMPTCFPassIncGen)
add_mlir_doc(Passes -gen-pass-doc NPCOMPTCFTransforms ./)
add_mlir_doc(Passes NPCOMPTCFTransforms ./ -gen-pass-doc)

View File

@ -2,5 +2,4 @@ set(LLVM_TARGET_DEFINITIONS Passes.td)
mlir_tablegen(Passes.h.inc -gen-pass-decls)
add_public_tablegen_target(NPCOMPTCPPassIncGen)
add_mlir_doc(Passes -gen-pass-doc NPCOMPTCPTransforms ./)
add_mlir_doc(Passes NPCOMPTCPTransforms ./ -gen-pass-doc)

View File

@ -16,5 +16,5 @@ mlir_tablegen(OpInterfaces.cpp.inc -gen-op-interface-defs)
add_public_tablegen_target(MLIRTorchOpInterfacesIncGen)
add_dependencies(mlir-generic-headers MLIRTorchOpInterfacesIncGen)
add_mlir_doc(TorchDialect -gen-dialect-doc TorchDialect Torch/)
add_mlir_doc(TorchOps -gen-op-doc TorchOps Torch/)
add_mlir_doc(TorchDialect TorchDialect Torch/ -gen-dialect-doc)
add_mlir_doc(TorchOps TorchOps Torch/ -gen-op-doc)

View File

@ -2,4 +2,4 @@ set(LLVM_TARGET_DEFINITIONS Passes.td)
mlir_tablegen(Passes.h.inc -gen-pass-decls)
add_public_tablegen_target(NPCOMPTorchPassIncGen)
add_mlir_doc(Passes -gen-pass-doc NPCOMPTorchTransforms ./)
add_mlir_doc(Passes NPCOMPTorchTransforms ./ -gen-pass-doc)

View File

@ -2,4 +2,4 @@ set(LLVM_TARGET_DEFINITIONS Passes.td)
mlir_tablegen(Passes.h.inc -gen-pass-decls)
add_public_tablegen_target(NPCOMPRefBackendPassIncGen)
add_mlir_doc(Passes -gen-pass-doc RefBackendPasses ./)
add_mlir_doc(Passes RefBackendPasses ./ -gen-pass-doc)

View File

@ -29,7 +29,7 @@ def LowerToRefbackrtABI : Pass<"lower-to-refbackrt-abi", "ModuleOp"> {
def LowerAllocMemRefOps : Pass<"lower-alloc-memref-ops", "FuncOp"> {
let summary = "Lower AllocMemRefOp's";
let constructor = "mlir::NPCOMP::createLowerAllocMemRefOpsPass()";
let dependentDialects = ["tensor::TensorDialect"];
let dependentDialects = ["tensor::TensorDialect", "memref::MemRefDialect"];
}
def LowerToLLVM : Pass<"refback-lower-to-llvm", "ModuleOp"> {

View File

@ -2,4 +2,4 @@ set(LLVM_TARGET_DEFINITIONS Passes.td)
mlir_tablegen(Passes.h.inc -gen-pass-decls)
add_public_tablegen_target(NPCOMPTypingTransformsPassIncGen)
#add_mlir_doc(Passes -gen-pass-doc Transforms ./)
#add_mlir_doc(Passes Transforms ./ -gen-pass-doc)

View File

@ -120,6 +120,7 @@ class ConvertATenToLinalg
: public ConvertATenToLinalgBase<ConvertATenToLinalg> {
public:
void getDependentDialects(DialectRegistry &registry) const override {
registry.insert<linalg::LinalgDialect>();
registry.insert<memref::MemRefDialect>();
}

View File

@ -191,8 +191,8 @@ namespace {
class ConvertTCFToLinalg : public ConvertTCFToLinalgBase<ConvertTCFToLinalg> {
public:
void getDependentDialects(DialectRegistry &registry) const override {
registry
.insert<shape::ShapeDialect, tcp::TCPDialect, tensor::TensorDialect>();
registry.insert<shape::ShapeDialect, tcp::TCPDialect, tensor::TensorDialect,
memref::MemRefDialect, linalg::LinalgDialect>();
}
void runOnOperation() override {

View File

@ -136,7 +136,7 @@ namespace {
class ConvertTCFToStd : public ConvertTCFToStdBase<ConvertTCFToStd> {
public:
void getDependentDialects(DialectRegistry &registry) const override {
registry.insert<shape::ShapeDialect>();
registry.insert<math::MathDialect, shape::ShapeDialect, tcp::TCPDialect>();
}
void runOnOperation() override {

View File

@ -860,7 +860,8 @@ MemRefType convertTensorType(TensorType tensor) {
/// FIXME: Audit this for completeness
struct ATenLoweringPass : public ATenLoweringBase<ATenLoweringPass> {
void getDependentDialects(DialectRegistry &registry) const override {
registry.insert<LLVM::LLVMDialect, StandardOpsDialect>();
registry
.insert<LLVM::LLVMDialect, StandardOpsDialect, memref::MemRefDialect>();
}
void runOnOperation() override {

View File

@ -24,6 +24,7 @@ void NumpyDialect::initialize() {
#include "npcomp/Dialect/Numpy/IR/NumpyOps.cpp.inc"
>();
addTypes<AnyDtypeType, NdArrayType>();
getContext()->loadDialect<Basicpy::BasicpyDialect>();
}
Type NumpyDialect::parseType(DialectAsmParser &parser) const {

View File

@ -226,6 +226,7 @@ namespace {
class TCPBufferizePass : public TCPBufferizeBase<TCPBufferizePass> {
void getDependentDialects(::mlir::DialectRegistry &registry) const override {
registry.insert<refback::RefbackDialect>();
registry.insert<memref::MemRefDialect>();
registry.insert<linalg::LinalgDialect>();
registry.insert<scf::SCFDialect>();
}

View File

@ -18,6 +18,7 @@
#include "npcomp/Dialect/Torch/Transforms/Passes.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/StringExtras.h"
using namespace mlir;
using namespace mlir::NPCOMP;

View File

@ -351,6 +351,9 @@ void optimize(FuncOp func, TypeAnalyzer &analyzer) {
namespace {
class RefineTypesPass : public RefineTypesBase<RefineTypesPass> {
void getDependentDialects(DialectRegistry &registry) const override {
registry.insert<Numpy::NumpyDialect, aten::ATenDialect>();
}
void runOnOperation() override {
auto func = getOperation();
TypeAnalyzer analyzer(&getContext());

View File

@ -420,7 +420,7 @@ namespace {
class LowerToRefbackrtABI
: public LowerToRefbackrtABIBase<LowerToRefbackrtABI> {
void getDependentDialects(DialectRegistry &registry) const override {
registry.insert<refbackrt::RefbackrtDialect>();
registry.insert<refbackrt::RefbackrtDialect, memref::MemRefDialect>();
}
void runOnOperation() override {

View File

@ -9,6 +9,7 @@
#ifndef REFBACKEND_PASSDETAIL_H
#define REFBACKEND_PASSDETAIL_H
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "mlir/Pass/Pass.h"