From 49c935ff70e5258a0cb7658f67d51989d0bc22c5 Mon Sep 17 00:00:00 2001 From: Stephen Neuendorffer Date: Thu, 30 Jul 2020 14:42:45 -0700 Subject: [PATCH] Update LLVM version to c89e46e76 A small fixup is required to avoid conflicts between ODS-generated build methods because of default arguments. Also, since this keeps failing, I've updated the llvm cache so that it runs in a separate job. Otherwise the cache is not updated when the CIRCT build fails. --- .github/workflows/buildAndTest.yml | 31 +++++++++++++++++++++++- lib/Conversion/LLHDToLLVM/LLHDToLLVM.cpp | 3 +-- lib/Dialect/FIRRTL/LowerToRTL.cpp | 4 +-- llvm | 2 +- 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/.github/workflows/buildAndTest.yml b/.github/workflows/buildAndTest.yml index 2c942bf7aec3..dff99ec96c3e 100644 --- a/.github/workflows/buildAndTest.yml +++ b/.github/workflows/buildAndTest.yml @@ -3,8 +3,37 @@ name: Build and Test on: [push, pull_request] jobs: + build-llvm: + name: Build LLVM + runs-on: ubuntu-latest + steps: + - name: Configure Environment + run: echo "::add-path::$GITHUB_WORKSPACE/llvm/install/bin" + - name: Get CIRCT + uses: actions/checkout@v2 + with: + submodules: 'true' + - name: Get LLVM Hash + id: get-llvm-hash + run: echo "::set-output name=hash::$(git submodule status)" + shell: bash + - name: Cache LLVM + id: cache-llvm + uses: actions/cache@v1 + with: + path: llvm + key: ${{ runner.os }}-llvm-install-${{ steps.get-llvm-hash.outputs.hash }} + - name: Rebuild and Install LLVM + if: steps.cache-llvm.outputs.cache-hit != 'true' + run: | + mkdir llvm/build + mkdir llvm/install + cd llvm/build + cmake ../llvm -DLLVM_BUILD_EXAMPLES=OFF -DLLVM_TARGETS_TO_BUILD="host" -DCMAKE_INSTALL_PREFIX=../install -DLLVM_ENABLE_PROJECTS='mlir' -DLLVM_OPTIMIZED_TABLEGEN=ON -DLLVM_ENABLE_OCAMLDOC=OFF -DLLVM_ENABLE_BINDINGS=OFF -DLLVM_INSTALL_UTILS=ON -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_ENABLE_LLD=ON -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON + cmake --build . --target install -- -j$(nproc) build: name: Build and Test + needs: build-llvm runs-on: ubuntu-latest steps: - name: Configure Environment @@ -23,7 +52,7 @@ jobs: with: path: llvm key: ${{ runner.os }}-llvm-install-${{ steps.get-llvm-hash.outputs.hash }} - - name: Install LLVM + - name: Rebuild and Install LLVM if: steps.cache-llvm.outputs.cache-hit != 'true' run: | mkdir llvm/build diff --git a/lib/Conversion/LLHDToLLVM/LLHDToLLVM.cpp b/lib/Conversion/LLHDToLLVM/LLHDToLLVM.cpp index 6723659a1f0d..334afe2e4758 100644 --- a/lib/Conversion/LLHDToLLVM/LLHDToLLVM.cpp +++ b/lib/Conversion/LLHDToLLVM/LLHDToLLVM.cpp @@ -1397,8 +1397,7 @@ void llhd::populateLLHDToLLVMConversionPatterns( // Bitwise conversion patterns. patterns.insert(ctx, converter); - patterns.insert( - converter, LowerToLLVMOptions::getDefaultOptions()); + patterns.insert(converter); // Unit conversion patterns. patterns.insert(op, ValueRange({lhs, rhs})); + return setLoweringTo(op, ValueRange({lhs, rhs}), std::vector{}); } template @@ -401,4 +401,4 @@ LogicalResult FIRRTLLowering::visitExpr(TailPrimOp op) { auto inWidth = input.getType().cast().getWidth(); Type resultType = builder->getIntegerType(inWidth - op.getAmount()); return setLoweringTo(op, resultType, input, 0); -} \ No newline at end of file +} diff --git a/llvm b/llvm index 628288658c5b..c89e46e767e2 160000 --- a/llvm +++ b/llvm @@ -1 +1 @@ -Subproject commit 628288658c5ba14923e1be566b64bada650e35bc +Subproject commit c89e46e767e25c426628f6365c577a3248634f1f