From a3bfd115ee758b408c01c001e0da19f253f9ee8b Mon Sep 17 00:00:00 2001 From: Sean Silva Date: Mon, 9 Aug 2021 15:16:19 -0700 Subject: [PATCH] Remove npcomp-iree-backend-lower-linkage pass. This is no longer needed by IREE. --- include/npcomp/Backend/IREE/Passes.h | 2 -- include/npcomp/Backend/IREE/Passes.td | 10 -------- lib/Backend/IREE/CMakeLists.txt | 1 - lib/Backend/IREE/LowerLinkage.cpp | 35 --------------------------- lib/Backend/IREE/Passes.cpp | 4 +-- test/Backend/Iree/lower-linkage.mlir | 14 ----------- 6 files changed, 1 insertion(+), 65 deletions(-) delete mode 100644 lib/Backend/IREE/LowerLinkage.cpp delete mode 100644 test/Backend/Iree/lower-linkage.mlir diff --git a/include/npcomp/Backend/IREE/Passes.h b/include/npcomp/Backend/IREE/Passes.h index 86844a379c69..0e71e7d4544e 100644 --- a/include/npcomp/Backend/IREE/Passes.h +++ b/include/npcomp/Backend/IREE/Passes.h @@ -22,8 +22,6 @@ void registerIREEBackendPasses(); /// contract to IREE's frontend contract. void createNpcompBackendToIreeFrontendPipeline(OpPassManager &pm); -std::unique_ptr> createLowerLinkagePass(); - } // namespace IREEBackend } // namespace NPCOMP } // namespace mlir diff --git a/include/npcomp/Backend/IREE/Passes.td b/include/npcomp/Backend/IREE/Passes.td index 95501f0ec0be..3bb3f2d62aee 100644 --- a/include/npcomp/Backend/IREE/Passes.td +++ b/include/npcomp/Backend/IREE/Passes.td @@ -11,14 +11,4 @@ include "mlir/Pass/PassBase.td" -def LowerLinkage : Pass<"npcomp-iree-backend-lower-linkage", "ModuleOp"> { - let summary = "Lower linkage of symbols to IREE's interfaces"; - let description = [{ - IREE has a specific input modeling for linkage, which differs from - MLIR's native modeling. This pass lowers MLIR's native linkage constructs - (which are otherwise used by npcomp) into the form IREE requires. - }]; - let constructor = "mlir::NPCOMP::IREEBackend::createLowerLinkagePass()"; -} - #endif // NPCOMP_BACKEND_IREE_PASSES diff --git a/lib/Backend/IREE/CMakeLists.txt b/lib/Backend/IREE/CMakeLists.txt index cacd0e71774a..477247746c73 100644 --- a/lib/Backend/IREE/CMakeLists.txt +++ b/lib/Backend/IREE/CMakeLists.txt @@ -1,5 +1,4 @@ add_npcomp_library(NPCOMPIREEBackend - LowerLinkage.cpp Passes.cpp ADDITIONAL_HEADER_DIRS diff --git a/lib/Backend/IREE/LowerLinkage.cpp b/lib/Backend/IREE/LowerLinkage.cpp deleted file mode 100644 index 585b5138e31e..000000000000 --- a/lib/Backend/IREE/LowerLinkage.cpp +++ /dev/null @@ -1,35 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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 -// -//===----------------------------------------------------------------------===// - -#include "PassDetail.h" -#include "npcomp/Backend/IREE/Passes.h" - -#include "mlir/IR/BuiltinOps.h" - -using namespace mlir; -using namespace mlir::NPCOMP; -using namespace mlir::NPCOMP::IREEBackend; - -namespace { -// This pass lowers the public ABI of the module to the primitives exposed by -// the refbackrt dialect. -class LowerLinkagePass : public LowerLinkageBase { - void runOnOperation() override { - ModuleOp module = getOperation(); - for (auto func : module.getOps()) { - if (func.getVisibility() == SymbolTable::Visibility::Public) - func->setAttr("iree.module.export", UnitAttr::get(&getContext())); - } - } -}; -} // namespace - -std::unique_ptr> -mlir::NPCOMP::IREEBackend::createLowerLinkagePass() { - return std::make_unique(); -} diff --git a/lib/Backend/IREE/Passes.cpp b/lib/Backend/IREE/Passes.cpp index db976015ba83..f24dbe2f1e5a 100644 --- a/lib/Backend/IREE/Passes.cpp +++ b/lib/Backend/IREE/Passes.cpp @@ -21,9 +21,7 @@ namespace { } // end namespace void mlir::NPCOMP::IREEBackend::createNpcompBackendToIreeFrontendPipeline( - OpPassManager &pm) { - pm.addPass(createLowerLinkagePass()); -} + OpPassManager &pm) {} void mlir::NPCOMP::IREEBackend::registerIREEBackendPasses() { ::registerPasses(); diff --git a/test/Backend/Iree/lower-linkage.mlir b/test/Backend/Iree/lower-linkage.mlir deleted file mode 100644 index 775a8cd04a12..000000000000 --- a/test/Backend/Iree/lower-linkage.mlir +++ /dev/null @@ -1,14 +0,0 @@ -// RUN: npcomp-opt -npcomp-iree-backend-lower-linkage %s | FileCheck %s - -// CHECK-LABEL: func private @decl() -func private @decl() - -// CHECK-LABEL: func @public() attributes {iree.module.export} { -func @public() { - return -} - -// CHECK-LABEL: func private @private() { -func private @private() { - return -}