From af20d259b96e573fd4c2d67cf625d6b2a5043194 Mon Sep 17 00:00:00 2001 From: Stella Laurenzo Date: Wed, 1 Nov 2023 18:44:12 -0700 Subject: [PATCH] Move torch-mlir-dialects into the main source tree. --- .../torch-mlir-dialects/CMakeLists.txt | 64 ----------------- .../torch-mlir-dialects/README.md | 11 --- .../include/CMakeLists.txt | 1 - .../torch-mlir-dialects/lib/CMakeLists.txt | 1 - .../lib/Dialect/CMakeLists.txt | 1 - .../torch-mlir-dialects/test/CMakeLists.txt | 21 ------ .../torch-mlir-dialects/test/lit.cfg.py | 69 ------------------- .../test/lit.site.cfg.py.in | 27 -------- .../torch-mlir-dialects/tools/CMakeLists.txt | 1 - .../torch-mlir-dialects-opt/CMakeLists.txt | 22 ------ .../torch-mlir-dialects-opt.cpp | 48 ------------- .../torch-mlir-dialects/CMakeLists.txt | 0 .../Dialect/CMakeLists.txt | 0 .../Dialect/TMTensor/CMakeLists.txt | 0 .../Dialect/TMTensor/IR/CMakeLists.txt | 0 .../TMTensor/IR/ScalarLoopOpInterface.h | 0 .../TMTensor/IR/ScalarLoopOpInterface.td | 0 .../Dialect/TMTensor/IR/TMTensorBase.td | 0 .../Dialect/TMTensor/IR/TMTensorDialect.h | 0 .../Dialect/TMTensor/IR/TMTensorInterfaces.h | 0 .../Dialect/TMTensor/IR/TMTensorInterfaces.td | 0 .../Dialect/TMTensor/IR/TMTensorOpInterface.h | 0 .../Dialect/TMTensor/IR/TMTensorOps.h | 0 .../Dialect/TMTensor/IR/TMTensorOps.td | 0 .../TMTensor/Transforms/CMakeLists.txt | 0 .../Dialect/TMTensor/Transforms/PassDetail.h | 0 .../Dialect/TMTensor/Transforms/Passes.h | 0 .../Dialect/TMTensor/Transforms/Passes.td | 0 .../Dialect/TMTensor/CMakeLists.txt | 0 .../Dialect/TMTensor/IR/CMakeLists.txt | 0 .../TMTensor/IR/ScalarLoopOpInterface.cpp | 0 .../Dialect/TMTensor/IR/TMTensorDialect.cpp | 0 .../TMTensor/IR/TMTensorInterfaces.cpp | 0 .../Dialect/TMTensor/IR/TMTensorOps.cpp | 0 .../Dialect/TMTensor/Transforms/Bufferize.cpp | 0 .../TMTensor/Transforms/CMakeLists.txt | 0 .../TMTensor/Transforms/ConvertToLoops.cpp | 0 .../Dialect/TMTensor/Transforms/Passes.cpp | 0 .../test => test}/tmtensor/bufferize.mlir | 0 .../test => test}/tmtensor/canonicalize.mlir | 0 .../tmtensor/convert_to_loops.mlir | 0 .../test => test}/tmtensor/invalid.mlir | 0 42 files changed, 266 deletions(-) delete mode 100644 externals/llvm-external-projects/torch-mlir-dialects/CMakeLists.txt delete mode 100644 externals/llvm-external-projects/torch-mlir-dialects/README.md delete mode 100644 externals/llvm-external-projects/torch-mlir-dialects/include/CMakeLists.txt delete mode 100644 externals/llvm-external-projects/torch-mlir-dialects/lib/CMakeLists.txt delete mode 100644 externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/CMakeLists.txt delete mode 100644 externals/llvm-external-projects/torch-mlir-dialects/test/CMakeLists.txt delete mode 100644 externals/llvm-external-projects/torch-mlir-dialects/test/lit.cfg.py delete mode 100644 externals/llvm-external-projects/torch-mlir-dialects/test/lit.site.cfg.py.in delete mode 100644 externals/llvm-external-projects/torch-mlir-dialects/tools/CMakeLists.txt delete mode 100644 externals/llvm-external-projects/torch-mlir-dialects/tools/torch-mlir-dialects-opt/CMakeLists.txt delete mode 100644 externals/llvm-external-projects/torch-mlir-dialects/tools/torch-mlir-dialects-opt/torch-mlir-dialects-opt.cpp rename {externals/llvm-external-projects/torch-mlir-dialects/include => include}/torch-mlir-dialects/CMakeLists.txt (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/include => include}/torch-mlir-dialects/Dialect/CMakeLists.txt (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/include => include}/torch-mlir-dialects/Dialect/TMTensor/CMakeLists.txt (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/include => include}/torch-mlir-dialects/Dialect/TMTensor/IR/CMakeLists.txt (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/include => include}/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.h (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/include => include}/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.td (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/include => include}/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorBase.td (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/include => include}/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorDialect.h (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/include => include}/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorInterfaces.h (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/include => include}/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorInterfaces.td (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/include => include}/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOpInterface.h (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/include => include}/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.h (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/include => include}/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.td (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/include => include}/torch-mlir-dialects/Dialect/TMTensor/Transforms/CMakeLists.txt (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/include => include}/torch-mlir-dialects/Dialect/TMTensor/Transforms/PassDetail.h (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/include => include}/torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.h (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/include => include}/torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.td (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/lib => lib}/Dialect/TMTensor/CMakeLists.txt (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/lib => lib}/Dialect/TMTensor/IR/CMakeLists.txt (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/lib => lib}/Dialect/TMTensor/IR/ScalarLoopOpInterface.cpp (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/lib => lib}/Dialect/TMTensor/IR/TMTensorDialect.cpp (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/lib => lib}/Dialect/TMTensor/IR/TMTensorInterfaces.cpp (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/lib => lib}/Dialect/TMTensor/IR/TMTensorOps.cpp (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/lib => lib}/Dialect/TMTensor/Transforms/Bufferize.cpp (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/lib => lib}/Dialect/TMTensor/Transforms/CMakeLists.txt (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/lib => lib}/Dialect/TMTensor/Transforms/ConvertToLoops.cpp (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/lib => lib}/Dialect/TMTensor/Transforms/Passes.cpp (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/test => test}/tmtensor/bufferize.mlir (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/test => test}/tmtensor/canonicalize.mlir (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/test => test}/tmtensor/convert_to_loops.mlir (100%) rename {externals/llvm-external-projects/torch-mlir-dialects/test => test}/tmtensor/invalid.mlir (100%) diff --git a/externals/llvm-external-projects/torch-mlir-dialects/CMakeLists.txt b/externals/llvm-external-projects/torch-mlir-dialects/CMakeLists.txt deleted file mode 100644 index c8f747af7..000000000 --- a/externals/llvm-external-projects/torch-mlir-dialects/CMakeLists.txt +++ /dev/null @@ -1,64 +0,0 @@ -if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) - # The cmake configuration to build torch-mlir-dialects as - # an out-of-tree project has not been implemented. It can - # be built as part of LLVM or as a subdirectory of torch-mlir. - message(FATAL_ERROR - "This project is intended to be built as part of LLVM via " - "-DLLVM_EXTERNAL_PROJECTS=torch-mlir-dialects " - "-DLLVM_EXTERNAL_TORCH_MLIR_DIALECTS_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}") -endif() - -option(MLIR_ENABLE_BINDINGS_PYTHON "Enables MLIR Python Bindings" OFF) - -set(TORCH_MLIR_DIALECTS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") -set(TORCH_MLIR_DIALECTS_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}") -message(STATUS "Building torch-mlir-dialects project at ${TORCH_MLIR_DIALECTS_SOURCE_DIR} (into ${TORCH_MLIR_DIALECTS_BINARY_DIR})") - -if(MLIR_FOUND) - message(STATUS "LLVM and MLIR packages have already been configured.") -else() - message(STATUS "torch-mlir-dialect is being built in-tree") - # An in-tree build, LLVM hasn't been installed yet. - # We compute these properties manually, they're otherwise - # contributed by find_package(MLIR...) - set(MLIR_MAIN_SRC_DIR ${LLVM_MAIN_SRC_DIR}/../mlir) - set(MLIR_INCLUDE_DIR ${LLVM_MAIN_SRC_DIR}/../mlir/include) - set(MLIR_GENERATED_INCLUDE_DIR ${LLVM_BINARY_DIR}/tools/mlir/include) - set(MLIR_INCLUDE_DIRS ${MLIR_INCLUDE_DIR} ${MLIR_GENERATED_INCLUDE_DIR}) - set(LLVM_INCLUDE_DIRS ${LLVM_MAIN_INCLUDE_DIR}) - - # Configure CMake and tablegen. - list(APPEND CMAKE_MODULE_PATH ${MLIR_MAIN_SRC_DIR}/cmake/modules) - list(APPEND CMAKE_MODULE_PATH ${LLVM_MAIN_SRC_DIR}/cmake) - - include(TableGen) - include(AddLLVM) - include(AddMLIR) -endif() - -function(torch_mlir_dialects_target_includes target) - set(_dirs - $ - $ - $ - ) - # In LLVM parlance, the actual target may just be an interface and may not - # be responsible for actually compiling anything. The corresponding obj. - # target, when present, is just used for compilation and does not - # contribute to the interface properties. - # TODO: Normalize this upstream. - target_include_directories(${target} PUBLIC "${_dirs}") - if(TARGET obj.${target}) - target_include_directories(obj.${target} PRIVATE "${_dirs}") - endif() -endfunction() - -# TODO: Needed for tablegen. Remove. -include_directories(SYSTEM ${MLIR_INCLUDE_DIRS}) -include_directories(SYSTEM ${LLVM_INCLUDE_DIRS}) -include_directories(SYSTEM ${TORCH_MLIR_DIALECTS_SOURCE_DIR}/include) - -add_subdirectory(include) -add_subdirectory(lib) -add_subdirectory(tools) -add_subdirectory(test) diff --git a/externals/llvm-external-projects/torch-mlir-dialects/README.md b/externals/llvm-external-projects/torch-mlir-dialects/README.md deleted file mode 100644 index 1a3caaa2c..000000000 --- a/externals/llvm-external-projects/torch-mlir-dialects/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Torch-MLIR Dialects Project - -Sources for torch-mlir's public dialects (containing ops/types/attributes that -are unique to Torch-MLIR at the moment) - -This project is intended to be used via LLVM's external projects setup: - -* `-DLLVM_EXTERNAL_PROJECTS=torch-mlir-dialects` -* `-DLLVM_EXTERNAL_TORCH_MLIR_DIALECTS_SOURCE_DIR={this_directory}` - -It depends on the `mlir` project. diff --git a/externals/llvm-external-projects/torch-mlir-dialects/include/CMakeLists.txt b/externals/llvm-external-projects/torch-mlir-dialects/include/CMakeLists.txt deleted file mode 100644 index 991c1bb41..000000000 --- a/externals/llvm-external-projects/torch-mlir-dialects/include/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(torch-mlir-dialects) diff --git a/externals/llvm-external-projects/torch-mlir-dialects/lib/CMakeLists.txt b/externals/llvm-external-projects/torch-mlir-dialects/lib/CMakeLists.txt deleted file mode 100644 index 0ca0f41c5..000000000 --- a/externals/llvm-external-projects/torch-mlir-dialects/lib/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(Dialect) diff --git a/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/CMakeLists.txt b/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/CMakeLists.txt deleted file mode 100644 index 683a52159..000000000 --- a/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(TMTensor) diff --git a/externals/llvm-external-projects/torch-mlir-dialects/test/CMakeLists.txt b/externals/llvm-external-projects/torch-mlir-dialects/test/CMakeLists.txt deleted file mode 100644 index 4596fabd7..000000000 --- a/externals/llvm-external-projects/torch-mlir-dialects/test/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -# lit needs to find the tools, and the location differs for in-tree and out-of-tree builds. -get_target_property(TORCH_MLIR_DIALECTS_TOOLS_DIR torch-mlir-dialects-opt RUNTIME_OUTPUT_DIRECTORY) -configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in - ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py - MAIN_CONFIG - ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py -) - -set(TORCH_MLIR_DIALECTS_TEST_DEPENDS - FileCheck count not - torch-mlir-dialects-opt - ) - -add_lit_testsuite(check-torch-mlir-dialects "Running the torch-mlir-dialects regression tests" - ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS ${TORCH_MLIR_DIALECTS_TEST_DEPENDS} - ) -set_target_properties(check-torch-mlir-dialects PROPERTIES FOLDER "Tests") - -add_lit_testsuites(TORCH_MLIR_DIALECTS ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${TORCH_MLIR_DIALECTS_TEST_DEPENDS}) diff --git a/externals/llvm-external-projects/torch-mlir-dialects/test/lit.cfg.py b/externals/llvm-external-projects/torch-mlir-dialects/test/lit.cfg.py deleted file mode 100644 index 272718b68..000000000 --- a/externals/llvm-external-projects/torch-mlir-dialects/test/lit.cfg.py +++ /dev/null @@ -1,69 +0,0 @@ -# -*- Python -*- -# 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 -# Also available under a BSD-style license. See LICENSE. - -import os -import platform -import re -import subprocess -import tempfile - -import lit.formats -import lit.util - -from lit.llvm import llvm_config -from lit.llvm.subst import ToolSubst -from lit.llvm.subst import FindTool - -# Configuration file for the 'lit' test runner. - -# name: The name of this test suite. -config.name = 'TORCH_MLIR_DIALECTS' - -config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell) - -# suffixes: A list of file extensions to treat as test files. -config.suffixes = ['.mlir', '.py'] - -# test_source_root: The root path where tests are located. -config.test_source_root = os.path.dirname(__file__) - -# test_exec_root: The root path where tests should be run. -config.test_exec_root = os.path.join(config.torch_mlir_dialects_obj_root, 'test') - -config.substitutions.append(('%PATH%', config.environment['PATH'])) -config.substitutions.append(('%shlibext', config.llvm_shlib_ext)) -config.substitutions.append( - ('%resources_dir', os.path.join(config.torch_mlir_dialects_obj_root, - 'resources'))) - -llvm_config.with_system_environment(['HOME', 'INCLUDE', 'LIB', 'TMP', 'TEMP']) - -#llvm_config.use_default_substitutions() - -# excludes: A list of directories to exclude from the testsuite. The 'Inputs' -# subdirectories contain auxiliary inputs for various tests in their parent -# directories. -config.excludes = [ - 'Inputs', 'Examples', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt', - 'lit.cfg.py', 'lit.site.cfg.py' -] - -# test_source_root: The root path where tests are located. -config.test_source_root = os.path.dirname(__file__) - -# test_exec_root: The root path where tests should be run. -config.test_exec_root = os.path.join(config.torch_mlir_dialects_obj_root, 'test') -config.standalone_tools_dir = os.path.join(config.torch_mlir_dialects_obj_root, 'bin') - -# Tweak the PATH to include the tools dir. -llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True) -tool_dirs = [config.torch_mlir_dialects_tools_dir, config.llvm_tools_dir] -tools = [ - "torch-mlir-dialects-opt", - ToolSubst('%PYTHON', config.python_executable, unresolved='ignore'), -] - -llvm_config.add_tool_substitutions(tools, tool_dirs) diff --git a/externals/llvm-external-projects/torch-mlir-dialects/test/lit.site.cfg.py.in b/externals/llvm-external-projects/torch-mlir-dialects/test/lit.site.cfg.py.in deleted file mode 100644 index 8f41e043f..000000000 --- a/externals/llvm-external-projects/torch-mlir-dialects/test/lit.site.cfg.py.in +++ /dev/null @@ -1,27 +0,0 @@ -# -*- Python -*- -# 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 -# Also available under a BSD-style license. See LICENSE. - -@LIT_SITE_CFG_IN_HEADER@ - -import sys - -config.torch_mlir_dialects_obj_root = "@TORCH_MLIR_DIALECTS_BINARY_DIR@" -config.torch_mlir_dialects_tools_dir = "@TORCH_MLIR_DIALECTS_TOOLS_DIR@" -config.llvm_src_root = "@LLVM_SOURCE_DIR@" -config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_lib_dir = "@LLVM_LIBS_DIR@" -config.llvm_shlib_dir = "@SHLIBDIR@" -config.llvm_shlib_ext = "@SHLIBEXT@" -config.llvm_exe_ext = "@EXEEXT@" -config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" -config.python_executable = sys.executable - -import lit.llvm -lit.llvm.initialize(lit_config, config) - -# Let the main config do the real work. -lit_config.load_config(config, "@TORCH_MLIR_DIALECTS_SOURCE_DIR@/test/lit.cfg.py") diff --git a/externals/llvm-external-projects/torch-mlir-dialects/tools/CMakeLists.txt b/externals/llvm-external-projects/torch-mlir-dialects/tools/CMakeLists.txt deleted file mode 100644 index db400ab20..000000000 --- a/externals/llvm-external-projects/torch-mlir-dialects/tools/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(torch-mlir-dialects-opt) diff --git a/externals/llvm-external-projects/torch-mlir-dialects/tools/torch-mlir-dialects-opt/CMakeLists.txt b/externals/llvm-external-projects/torch-mlir-dialects/tools/torch-mlir-dialects-opt/CMakeLists.txt deleted file mode 100644 index 102d60bce..000000000 --- a/externals/llvm-external-projects/torch-mlir-dialects/tools/torch-mlir-dialects-opt/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -set(LIBS - MLIRArithDialect - MLIRDialect - MLIRLinalgDialect - MLIRMemRefDialect - MLIROptLib - MLIRSCFDialect - MLIRSCFTransforms - MLIRFuncDialect - MLIRTensorDialect - MLIRTransforms - TorchMLIRTMTensorDialect - TorchMLIRTMTensorPasses -) - -add_llvm_tool(torch-mlir-dialects-opt - torch-mlir-dialects-opt.cpp - - DEPENDS - ${LIBS} -) -target_link_libraries(torch-mlir-dialects-opt PRIVATE ${LIBS}) diff --git a/externals/llvm-external-projects/torch-mlir-dialects/tools/torch-mlir-dialects-opt/torch-mlir-dialects-opt.cpp b/externals/llvm-external-projects/torch-mlir-dialects/tools/torch-mlir-dialects-opt/torch-mlir-dialects-opt.cpp deleted file mode 100644 index 058dfc82d..000000000 --- a/externals/llvm-external-projects/torch-mlir-dialects/tools/torch-mlir-dialects-opt/torch-mlir-dialects-opt.cpp +++ /dev/null @@ -1,48 +0,0 @@ -//===------------------------------------------------------------*- C++ -*-===// -// -// 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 -// Also available under a BSD-style license. See LICENSE. -// -//===----------------------------------------------------------------------===// - -#include "mlir/Dialect/Arith/IR/Arith.h" -#include "mlir/Dialect/Func/IR/FuncOps.h" -#include "mlir/Dialect/Linalg/IR/Linalg.h" -#include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/IR/SCF.h" -#include "mlir/Dialect/SCF/Transforms/Passes.h" -#include "mlir/Dialect/Tensor/IR/Tensor.h" -#include "mlir/IR/AsmState.h" -#include "mlir/IR/Dialect.h" -#include "mlir/Tools/mlir-opt/MlirOptMain.h" -#include "mlir/Transforms/Passes.h" -#include "torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.h" -#include "torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorDialect.h" -#include "torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.h" - -using namespace mlir; - -int main(int argc, char **argv) { - registerAsmPrinterCLOptions(); - registerMLIRContextCLOptions(); - - registerTransformsPasses(); - registerSCFPasses(); - - // Local dialects. - mlir::torch::TMTensor::registerPasses(); - - DialectRegistry registry; - registry.insert< - // Local dialects - mlir::torch::TMTensor::TMTensorDialect, - // Upstream dialects - mlir::arith::ArithDialect, mlir::linalg::LinalgDialect, - mlir::func::FuncDialect, mlir::memref::MemRefDialect, - mlir::scf::SCFDialect, mlir::tensor::TensorDialect>(); - - return mlir::asMainReturnCode(mlir::MlirOptMain( - argc, argv, "MLIR modular optimizer driver\n", registry)); -} diff --git a/externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/CMakeLists.txt b/include/torch-mlir-dialects/CMakeLists.txt similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/CMakeLists.txt rename to include/torch-mlir-dialects/CMakeLists.txt diff --git a/externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/CMakeLists.txt b/include/torch-mlir-dialects/Dialect/CMakeLists.txt similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/CMakeLists.txt rename to include/torch-mlir-dialects/Dialect/CMakeLists.txt diff --git a/externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/CMakeLists.txt b/include/torch-mlir-dialects/Dialect/TMTensor/CMakeLists.txt similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/CMakeLists.txt rename to include/torch-mlir-dialects/Dialect/TMTensor/CMakeLists.txt diff --git a/externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/CMakeLists.txt b/include/torch-mlir-dialects/Dialect/TMTensor/IR/CMakeLists.txt similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/CMakeLists.txt rename to include/torch-mlir-dialects/Dialect/TMTensor/IR/CMakeLists.txt diff --git a/externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.h b/include/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.h similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.h rename to include/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.h diff --git a/externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.td b/include/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.td similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.td rename to include/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.td diff --git a/externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorBase.td b/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorBase.td similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorBase.td rename to include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorBase.td diff --git a/externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorDialect.h b/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorDialect.h similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorDialect.h rename to include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorDialect.h diff --git a/externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorInterfaces.h b/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorInterfaces.h similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorInterfaces.h rename to include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorInterfaces.h diff --git a/externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorInterfaces.td b/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorInterfaces.td similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorInterfaces.td rename to include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorInterfaces.td diff --git a/externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOpInterface.h b/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOpInterface.h similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOpInterface.h rename to include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOpInterface.h diff --git a/externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.h b/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.h similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.h rename to include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.h diff --git a/externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.td b/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.td similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.td rename to include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.td diff --git a/externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/CMakeLists.txt b/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/CMakeLists.txt similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/CMakeLists.txt rename to include/torch-mlir-dialects/Dialect/TMTensor/Transforms/CMakeLists.txt diff --git a/externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/PassDetail.h b/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/PassDetail.h similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/PassDetail.h rename to include/torch-mlir-dialects/Dialect/TMTensor/Transforms/PassDetail.h diff --git a/externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.h b/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.h similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.h rename to include/torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.h diff --git a/externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.td b/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.td similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.td rename to include/torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.td diff --git a/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/CMakeLists.txt b/lib/Dialect/TMTensor/CMakeLists.txt similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/CMakeLists.txt rename to lib/Dialect/TMTensor/CMakeLists.txt diff --git a/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/CMakeLists.txt b/lib/Dialect/TMTensor/IR/CMakeLists.txt similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/CMakeLists.txt rename to lib/Dialect/TMTensor/IR/CMakeLists.txt diff --git a/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/ScalarLoopOpInterface.cpp b/lib/Dialect/TMTensor/IR/ScalarLoopOpInterface.cpp similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/ScalarLoopOpInterface.cpp rename to lib/Dialect/TMTensor/IR/ScalarLoopOpInterface.cpp diff --git a/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/TMTensorDialect.cpp b/lib/Dialect/TMTensor/IR/TMTensorDialect.cpp similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/TMTensorDialect.cpp rename to lib/Dialect/TMTensor/IR/TMTensorDialect.cpp diff --git a/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/TMTensorInterfaces.cpp b/lib/Dialect/TMTensor/IR/TMTensorInterfaces.cpp similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/TMTensorInterfaces.cpp rename to lib/Dialect/TMTensor/IR/TMTensorInterfaces.cpp diff --git a/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/TMTensorOps.cpp b/lib/Dialect/TMTensor/IR/TMTensorOps.cpp similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/TMTensorOps.cpp rename to lib/Dialect/TMTensor/IR/TMTensorOps.cpp diff --git a/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/Transforms/Bufferize.cpp b/lib/Dialect/TMTensor/Transforms/Bufferize.cpp similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/Transforms/Bufferize.cpp rename to lib/Dialect/TMTensor/Transforms/Bufferize.cpp diff --git a/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/Transforms/CMakeLists.txt b/lib/Dialect/TMTensor/Transforms/CMakeLists.txt similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/Transforms/CMakeLists.txt rename to lib/Dialect/TMTensor/Transforms/CMakeLists.txt diff --git a/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/Transforms/ConvertToLoops.cpp b/lib/Dialect/TMTensor/Transforms/ConvertToLoops.cpp similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/Transforms/ConvertToLoops.cpp rename to lib/Dialect/TMTensor/Transforms/ConvertToLoops.cpp diff --git a/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/Transforms/Passes.cpp b/lib/Dialect/TMTensor/Transforms/Passes.cpp similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/Transforms/Passes.cpp rename to lib/Dialect/TMTensor/Transforms/Passes.cpp diff --git a/externals/llvm-external-projects/torch-mlir-dialects/test/tmtensor/bufferize.mlir b/test/tmtensor/bufferize.mlir similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/test/tmtensor/bufferize.mlir rename to test/tmtensor/bufferize.mlir diff --git a/externals/llvm-external-projects/torch-mlir-dialects/test/tmtensor/canonicalize.mlir b/test/tmtensor/canonicalize.mlir similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/test/tmtensor/canonicalize.mlir rename to test/tmtensor/canonicalize.mlir diff --git a/externals/llvm-external-projects/torch-mlir-dialects/test/tmtensor/convert_to_loops.mlir b/test/tmtensor/convert_to_loops.mlir similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/test/tmtensor/convert_to_loops.mlir rename to test/tmtensor/convert_to_loops.mlir diff --git a/externals/llvm-external-projects/torch-mlir-dialects/test/tmtensor/invalid.mlir b/test/tmtensor/invalid.mlir similarity index 100% rename from externals/llvm-external-projects/torch-mlir-dialects/test/tmtensor/invalid.mlir rename to test/tmtensor/invalid.mlir