From d9272e504c124f73b85c87265144ee742f0df100 Mon Sep 17 00:00:00 2001 From: Maximilian Bartel Date: Mon, 2 Oct 2023 12:36:24 -0400 Subject: [PATCH] refactor: bump llvm Signed-off-by: Maximilian Bartel --- docs/BuildOnLinuxOSX.md | 2 +- docs/BuildOnWindows.md | 2 +- src/Conversion/KrnlToAffine/ConvertKrnlToAffine.cpp | 13 ++++++------- src/Dialect/Krnl/KrnlOps.cpp | 4 +++- src/Dialect/ONNX/Rewrite.cpp | 2 +- utils/clone-mlir.sh | 2 +- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/docs/BuildOnLinuxOSX.md b/docs/BuildOnLinuxOSX.md index 9b58bb06f4..907d5926cc 100644 --- a/docs/BuildOnLinuxOSX.md +++ b/docs/BuildOnLinuxOSX.md @@ -15,7 +15,7 @@ Firstly, install MLIR (as a part of LLVM-Project): ``` bash git clone -n https://github.com/llvm/llvm-project.git # Check out a specific branch that is known to work with ONNX-MLIR. -cd llvm-project && git checkout f66cd9e9556a53142a26a5c21a72e21f1579217c && cd .. +cd llvm-project && git checkout d13da154a7c7eff77df8686b2de1cfdfa7cc7029 && cd .. ``` [same-as-file]: <> (utils/build-mlir.sh) diff --git a/docs/BuildOnWindows.md b/docs/BuildOnWindows.md index 1550a48ed0..eb2a93a31b 100644 --- a/docs/BuildOnWindows.md +++ b/docs/BuildOnWindows.md @@ -52,7 +52,7 @@ Install MLIR (as a part of LLVM-Project): ```shell git clone -n https://github.com/llvm/llvm-project.git # Check out a specific branch that is known to work with ONNX-MLIR. -cd llvm-project && git checkout f66cd9e9556a53142a26a5c21a72e21f1579217c && cd .. +cd llvm-project && git checkout d13da154a7c7eff77df8686b2de1cfdfa7cc7029 && cd .. ``` [same-as-file]: <> (utils/build-mlir.cmd) diff --git a/src/Conversion/KrnlToAffine/ConvertKrnlToAffine.cpp b/src/Conversion/KrnlToAffine/ConvertKrnlToAffine.cpp index cf82a9b541..bffb389582 100644 --- a/src/Conversion/KrnlToAffine/ConvertKrnlToAffine.cpp +++ b/src/Conversion/KrnlToAffine/ConvertKrnlToAffine.cpp @@ -210,13 +210,12 @@ class LoopBodyMover { // Find the forOp associated with loopRef, get ready to insert into // forOp body. // Cast to affine.forOp or affine.parallelOp - Block &loopBody = dyn_cast_or_null(loopRefToOp[loopRef]) - ? llvm::cast(loopRefToOp[loopRef]) - .getLoopBody() - .front() - : llvm::cast(loopRefToOp[loopRef]) - .getLoopBody() - .front(); + Block &loopBody = + dyn_cast_or_null(loopRefToOp[loopRef]) + ? llvm::cast(loopRefToOp[loopRef]).getRegion().front() + : llvm::cast(loopRefToOp[loopRef]) + .getRegion() + .front(); auto insertPt = loopBody.begin(); // Find the ops to transfer (saved into a Movable) associated with diff --git a/src/Dialect/Krnl/KrnlOps.cpp b/src/Dialect/Krnl/KrnlOps.cpp index 434512d62f..b89ccd547b 100644 --- a/src/Dialect/Krnl/KrnlOps.cpp +++ b/src/Dialect/Krnl/KrnlOps.cpp @@ -506,7 +506,9 @@ ParseResult KrnlIterateOp::parse(OpAsmParser &parser, OperationState &result) { return success(); } -Region &KrnlIterateOp::getLoopBody() { return getBodyRegion(); } +::llvm::SmallVector KrnlIterateOp::getLoopRegions() { + return {&getBodyRegion()}; +} LogicalResult KrnlIterateOp::verify() { // TODO: Verify number of induction variable bounds matches the number of diff --git a/src/Dialect/ONNX/Rewrite.cpp b/src/Dialect/ONNX/Rewrite.cpp index 755800ffb6..80dfe0a881 100644 --- a/src/Dialect/ONNX/Rewrite.cpp +++ b/src/Dialect/ONNX/Rewrite.cpp @@ -720,7 +720,7 @@ class InputOutputTransposer { void transposeInput(MutableOperandRange operand, ArrayAttr perm) { assert(operand.size() == 1 && "should be called with singleton range"); - Value input = operand[0]; + Value input = operand[0].get(); if (!input.getType().isa()) { Value transposed = transpose(input, perm); operand.assign(transposed); diff --git a/utils/clone-mlir.sh b/utils/clone-mlir.sh index 949db8e3b9..e50ba730b5 100644 --- a/utils/clone-mlir.sh +++ b/utils/clone-mlir.sh @@ -1,3 +1,3 @@ git clone -n https://github.com/llvm/llvm-project.git # Check out a specific branch that is known to work with ONNX-MLIR. -cd llvm-project && git checkout f66cd9e9556a53142a26a5c21a72e21f1579217c && cd .. +cd llvm-project && git checkout d13da154a7c7eff77df8686b2de1cfdfa7cc7029 && cd ..