From d64028377d7d23ce081364d6b9dcdcac5ac7bd31 Mon Sep 17 00:00:00 2001 From: mlevental Date: Tue, 21 Jun 2022 01:13:24 -0500 Subject: [PATCH] Bump LLVM --- .../lib/Dialect/TMTensor/IR/CMakeLists.txt | 14 +++++++------- .../lib/Dialect/TMTensor/IR/TMTensorOps.cpp | 2 +- .../lib/Dialect/TMTensor/Transforms/CMakeLists.txt | 14 +++++++------- .../Dialect/TMTensor/Transforms/ConvertToLoops.cpp | 2 +- .../tools/torch-mlir-dialects-opt/CMakeLists.txt | 12 ++++++------ .../torch-mlir-dialects-opt.cpp | 4 ++-- externals/llvm-project | 2 +- lib/Conversion/TorchToLinalg/CMakeLists.txt | 4 ++-- lib/Conversion/TorchToSCF/CMakeLists.txt | 4 ++-- lib/Conversion/TorchToSCF/TorchToSCF.cpp | 2 +- lib/Conversion/TorchToStd/CMakeLists.txt | 2 +- lib/Conversion/TorchToTMTensor/CMakeLists.txt | 4 ++-- lib/Conversion/TorchToTosa/CMakeLists.txt | 2 +- lib/Dialect/Torch/IR/TorchOps.cpp | 4 ++-- .../VerifyLinalgOnTensorsBackendContract.cpp | 2 +- .../linalg_on_tensors_backends/refbackend.py | 1 + test/Dialect/Torch/canonicalize.mlir | 8 ++++---- 17 files changed, 42 insertions(+), 41 deletions(-) diff --git a/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/CMakeLists.txt b/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/CMakeLists.txt index d3e1c0ba38c7..682769c4727c 100644 --- a/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/CMakeLists.txt +++ b/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/CMakeLists.txt @@ -11,18 +11,18 @@ add_mlir_library(TorchMLIRTMTensorDialect TorchMLIRTMTensorOpsIncGen LINK_LIBS PUBLIC - MLIRAffine + MLIRAffineDialect MLIRDialectUtils MLIRIR - MLIRLinalg - MLIRMath - MLIRMemRef + MLIRLinalgDialect + MLIRMathDialect + MLIRMemRefDialect MLIRPass MLIRSideEffectInterfaces MLIRSupport - MLIRSCF - MLIRFunc - MLIRTensor + MLIRSCFDialect + MLIRFuncDialect + MLIRTensorDialect MLIRViewLikeInterface ) diff --git a/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/TMTensorOps.cpp b/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/TMTensorOps.cpp index 9905ae070be1..0fa16f1df49b 100644 --- a/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/TMTensorOps.cpp +++ b/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/TMTensorOps.cpp @@ -14,7 +14,7 @@ #include "mlir/Dialect/Linalg/IR/Linalg.h" #include "mlir/Dialect/Math/IR/Math.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/Dialect/Utils/StructuredOpsUtils.h" #include "mlir/IR/Attributes.h" diff --git a/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/Transforms/CMakeLists.txt b/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/Transforms/CMakeLists.txt index ac0635f8dda1..848b416a8fc0 100644 --- a/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/Transforms/CMakeLists.txt +++ b/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/Transforms/CMakeLists.txt @@ -8,16 +8,16 @@ add_mlir_library(TorchMLIRTMTensorPasses LINK_LIBS PUBLIC TorchMLIRTMTensorDialect - MLIRAffine + MLIRAffineDialect MLIRIR - MLIRLinalg + MLIRLinalgDialect MLIRLinalgTransforms - MLIRMath - MLIRMemRef + MLIRMathDialect + MLIRMemRefDialect MLIRPass - MLIRSCF - MLIRFunc + MLIRSCFDialect + MLIRFuncDialect MLIRSupport - MLIRTensor + MLIRTensorDialect MLIRTransforms ) diff --git a/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/Transforms/ConvertToLoops.cpp b/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/Transforms/ConvertToLoops.cpp index a9b5c7cd2a97..b03ea88dcacc 100644 --- a/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/Transforms/ConvertToLoops.cpp +++ b/externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/Transforms/ConvertToLoops.cpp @@ -12,7 +12,7 @@ #include "mlir/Dialect/Linalg/IR/Linalg.h" #include "mlir/Dialect/Math/IR/Math.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/IR/BuiltinTypes.h" #include "mlir/IR/PatternMatch.h" #include "mlir/Pass/Pass.h" 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 index ae7d2d0859cb..4b753e310593 100644 --- 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 @@ -1,13 +1,13 @@ set(LIBS - MLIRArithmetic + MLIRArithmeticDialect MLIRDialect - MLIRLinalg - MLIRMemRef + MLIRLinalgDialect + MLIRMemRefDialect MLIROptLib - MLIRSCF + MLIRSCFDialect MLIRSCFTransforms - MLIRFunc - MLIRTensor + MLIRFuncDialect + MLIRTensorDialect MLIRTransforms TorchMLIRTMTensorDialect TorchMLIRTMTensorPasses 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 index be88939d4353..1dfc756bb552 100644 --- 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 @@ -11,8 +11,8 @@ #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/Passes.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/Transforms/Passes.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/IR/AsmState.h" #include "mlir/IR/Dialect.h" diff --git a/externals/llvm-project b/externals/llvm-project index 5380e30e047b..ca4af13e480e 160000 --- a/externals/llvm-project +++ b/externals/llvm-project @@ -1 +1 @@ -Subproject commit 5380e30e047bbac9b2cceb69162eb8db1e1a7abf +Subproject commit ca4af13e480e856f8f889c1e145308fc4eb69816 diff --git a/lib/Conversion/TorchToLinalg/CMakeLists.txt b/lib/Conversion/TorchToLinalg/CMakeLists.txt index e31a09b8b16d..7a86e43a61c1 100644 --- a/lib/Conversion/TorchToLinalg/CMakeLists.txt +++ b/lib/Conversion/TorchToLinalg/CMakeLists.txt @@ -25,8 +25,8 @@ add_mlir_conversion_library(TorchMLIRTorchToLinalg LINK_LIBS PUBLIC MLIRIR MLIRPass - MLIRLinalg - MLIRMath + MLIRLinalgDialect + MLIRMathDialect TorchMLIRTorchDialect ) diff --git a/lib/Conversion/TorchToSCF/CMakeLists.txt b/lib/Conversion/TorchToSCF/CMakeLists.txt index fc3c7a473afe..06a888b3ecb5 100644 --- a/lib/Conversion/TorchToSCF/CMakeLists.txt +++ b/lib/Conversion/TorchToSCF/CMakeLists.txt @@ -13,8 +13,8 @@ add_mlir_conversion_library(TorchMLIRTorchToSCF LINK_LIBS PUBLIC MLIRIR MLIRPass - MLIRSCF - MLIRFunc + MLIRSCFDialect + MLIRFuncDialect TorchMLIRTorchDialect TorchMLIRTorchConversionDialect ) diff --git a/lib/Conversion/TorchToSCF/TorchToSCF.cpp b/lib/Conversion/TorchToSCF/TorchToSCF.cpp index 5fa1669a20c6..0f833eab53ef 100644 --- a/lib/Conversion/TorchToSCF/TorchToSCF.cpp +++ b/lib/Conversion/TorchToSCF/TorchToSCF.cpp @@ -11,7 +11,7 @@ #include "../PassDetail.h" #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/IR/BuiltinTypes.h" #include "mlir/Transforms/DialectConversion.h" #include "torch-mlir/Dialect/Torch/IR/TorchDialect.h" diff --git a/lib/Conversion/TorchToStd/CMakeLists.txt b/lib/Conversion/TorchToStd/CMakeLists.txt index 452e43a88420..63f0c8c6aca3 100644 --- a/lib/Conversion/TorchToStd/CMakeLists.txt +++ b/lib/Conversion/TorchToStd/CMakeLists.txt @@ -13,7 +13,7 @@ add_mlir_conversion_library(TorchMLIRTorchToStd LINK_LIBS PUBLIC MLIRIR MLIRPass - MLIRFunc + MLIRFuncDialect TorchMLIRTorchDialect ) diff --git a/lib/Conversion/TorchToTMTensor/CMakeLists.txt b/lib/Conversion/TorchToTMTensor/CMakeLists.txt index e456c3fe70aa..eda9ec7ad247 100644 --- a/lib/Conversion/TorchToTMTensor/CMakeLists.txt +++ b/lib/Conversion/TorchToTMTensor/CMakeLists.txt @@ -13,8 +13,8 @@ TorchToTMTensor.cpp LINK_LIBS PUBLIC MLIRIR MLIRPass - MLIRLinalg - MLIRMath + MLIRLinalgDialect + MLIRMathDialect TorchMLIRTorchDialect TorchMLIRTMTensorDialect ) diff --git a/lib/Conversion/TorchToTosa/CMakeLists.txt b/lib/Conversion/TorchToTosa/CMakeLists.txt index 7ba4a51cfb68..e1f5142bd924 100644 --- a/lib/Conversion/TorchToTosa/CMakeLists.txt +++ b/lib/Conversion/TorchToTosa/CMakeLists.txt @@ -15,7 +15,7 @@ add_mlir_conversion_library(TorchMLIRTorchToTosa LINK_LIBS PUBLIC MLIRIR MLIRPass - MLIRTosa + MLIRTosaDialect TorchMLIRTorchDialect ) diff --git a/lib/Dialect/Torch/IR/TorchOps.cpp b/lib/Dialect/Torch/IR/TorchOps.cpp index 36f4501f1414..4a5b1cfccd2d 100644 --- a/lib/Dialect/Torch/IR/TorchOps.cpp +++ b/lib/Dialect/Torch/IR/TorchOps.cpp @@ -237,8 +237,8 @@ LogicalResult ClassTypeOp::verify() { // PrimLoopOp //===----------------------------------------------------------------------===// -OperandRange PrimLoopOp::getSuccessorEntryOperands(unsigned index) { - assert(index == 0); +OperandRange PrimLoopOp::getSuccessorEntryOperands(Optional index) { + assert(index.hasValue() && index.value() == 0); return iterArgsInit(); } diff --git a/lib/Dialect/TorchConversion/Transforms/VerifyLinalgOnTensorsBackendContract.cpp b/lib/Dialect/TorchConversion/Transforms/VerifyLinalgOnTensorsBackendContract.cpp index e04387c581cd..62c3e8faf2f6 100644 --- a/lib/Dialect/TorchConversion/Transforms/VerifyLinalgOnTensorsBackendContract.cpp +++ b/lib/Dialect/TorchConversion/Transforms/VerifyLinalgOnTensorsBackendContract.cpp @@ -15,7 +15,7 @@ #include "mlir/Dialect/Func/IR/FuncOps.h" #include "mlir/Dialect/Linalg/IR/Linalg.h" #include "mlir/Dialect/Math/IR/Math.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/IR/OpDefinition.h" #include "mlir/Transforms/DialectConversion.h" diff --git a/python/torch_mlir_e2e_test/linalg_on_tensors_backends/refbackend.py b/python/torch_mlir_e2e_test/linalg_on_tensors_backends/refbackend.py index 39f20e04f5b3..fd4110afe05a 100644 --- a/python/torch_mlir_e2e_test/linalg_on_tensors_backends/refbackend.py +++ b/python/torch_mlir_e2e_test/linalg_on_tensors_backends/refbackend.py @@ -119,6 +119,7 @@ def invoke(*args): # Bufferize. "func.func(scf-bufferize)", "func.func(tm-tensor-bufferize)", + "func.func(linalg-init-tensor-to-alloc-tensor)", "func.func(linalg-bufferize)", "func-bufferize", "arith-bufferize", diff --git a/test/Dialect/Torch/canonicalize.mlir b/test/Dialect/Torch/canonicalize.mlir index bba9369ed1a4..357f87a2b94b 100644 --- a/test/Dialect/Torch/canonicalize.mlir +++ b/test/Dialect/Torch/canonicalize.mlir @@ -3,8 +3,8 @@ // CHECK-LABEL: func.func @torch.aten.__range_length$fold() -> (!torch.int, !torch.int, !torch.int, !torch.int) { // CHECK: %[[INT1:.*]] = torch.constant.int 1 // CHECK: %[[INT2:.*]] = torch.constant.int 2 -// CHECK: %[[INTM1:.*]] = torch.constant.int -1 // CHECK: %[[INT3:.*]] = torch.constant.int 3 +// CHECK: %[[INTM1:.*]] = torch.constant.int -1 // CHECK: %[[NEG_STEP:.*]] = torch.aten.__range_length %[[INT1]], %[[INT3]], %[[INTM1]] : !torch.int, !torch.int, !torch.int -> !torch.int // CHECK: return %[[INT2]], %[[INT2]], %[[INT1]], %[[NEG_STEP]] : !torch.int, !torch.int, !torch.int, !torch.int func.func @torch.aten.__range_length$fold() -> (!torch.int, !torch.int, !torch.int, !torch.int) { @@ -559,8 +559,8 @@ func.func @torch.aten.__getitem__.t() -> !torch.int { // Not canonicalized because of passed in index // CHECK-LABEL: func.func @torch.aten.__getitem__.t$no_change_test0( -// CHECK: %[[C4:.*]] = torch.constant.int 4 // CHECK: %[[C5:.*]] = torch.constant.int 5 +// CHECK: %[[C4:.*]] = torch.constant.int 4 // CHECK: %[[LIST:.*]] = torch.prim.ListConstruct %[[C4]], %[[C5]] : (!torch.int, !torch.int) -> !torch.list // CHECK: %[[ITEM:.*]] = torch.aten.__getitem__.t %[[LIST]], %arg0 : !torch.list, !torch.int -> !torch.int // CHECK: return %[[ITEM]] : !torch.int @@ -673,8 +673,8 @@ func.func @torch.constant.none$constantlike() -> (!torch.none, !torch.none) { } // CHECK-LABEL: func.func @torch.constant.str$constantlike() -> (!torch.str, !torch.str, !torch.str) { -// CHECK: %[[T:.*]] = torch.constant.str "t" // CHECK: %[[S:.*]] = torch.constant.str "s" +// CHECK: %[[T:.*]] = torch.constant.str "t" // CHECK: return %[[S]], %[[S]], %[[T]] : !torch.str, !torch.str, !torch.str func.func @torch.constant.str$constantlike() -> (!torch.str, !torch.str, !torch.str) { %0 = torch.constant.str "s" @@ -684,8 +684,8 @@ func.func @torch.constant.str$constantlike() -> (!torch.str, !torch.str, !torch. } // CHECK-LABEL: func.func @torch.constant.bool$constantlike() -> (!torch.bool, !torch.bool, !torch.bool) { -// CHECK: %[[F:.*]] = torch.constant.bool false // CHECK: %[[T:.*]] = torch.constant.bool true +// CHECK: %[[F:.*]] = torch.constant.bool false // CHECK: return %[[T]], %[[T]], %[[F]] : !torch.bool, !torch.bool, !torch.bool func.func @torch.constant.bool$constantlike() -> (!torch.bool, !torch.bool, !torch.bool) { %0 = torch.constant.bool true