From 69788159aca4860643f185beeb08510c7bb6f386 Mon Sep 17 00:00:00 2001 From: Mikhail Sherstennikov Date: Mon, 29 Jan 2024 18:43:36 +0200 Subject: [PATCH] Fix release build Also, add release build step to CI. --- .github/workflows/evm-compiler-push.yml | 17 +++++++++++++++-- llvm/lib/Target/EVM/EVMConvertRegToStack.cpp | 2 +- llvm/projects/evm-tests/run_evm_tests.sh | 10 +++++++--- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/workflows/evm-compiler-push.yml b/.github/workflows/evm-compiler-push.yml index 20e30fcf7104..a316e59da65e 100644 --- a/.github/workflows/evm-compiler-push.yml +++ b/.github/workflows/evm-compiler-push.yml @@ -10,7 +10,6 @@ jobs: test: runs-on: [self-hosted, tests-runner] name: EVM compiler tests - steps: - name: checkout uses: actions/checkout@v3 @@ -26,6 +25,20 @@ jobs: ruby-version: '3.3' - run: gem install keccak256 - name: Build - run: bash llvm/projects/evm-tests/run_evm_tests.sh build + run: bash llvm/projects/evm-tests/run_evm_tests.sh build-debug - name: Run regression EVM tests run: bash llvm/projects/evm-tests/run_evm_tests.sh test + test: + runs-on: [self-hosted, tests-runner] + name: Release build + steps: + - name: checkout + uses: actions/checkout@v3 + with: + submodules: true + - name: Setup Cmake + uses: jwlawson/actions-setup-cmake@v1.13 + with: + cmake-version: '3.22.x' + - name: Build + run: bash llvm/projects/evm-tests/run_evm_tests.sh build-release \ No newline at end of file diff --git a/llvm/lib/Target/EVM/EVMConvertRegToStack.cpp b/llvm/lib/Target/EVM/EVMConvertRegToStack.cpp index a63457b82f3b..de32a1e8265e 100644 --- a/llvm/lib/Target/EVM/EVMConvertRegToStack.cpp +++ b/llvm/lib/Target/EVM/EVMConvertRegToStack.cpp @@ -315,7 +315,7 @@ bool EVMConvertRegToStack::runOnMachineFunction(MachineFunction &MF) { } } if (StackOpcode == -1) { - MI.dump(); + LLVM_DEBUG(MI.dump()); report_fatal_error("Failed to convert instruction to stack version."); } diff --git a/llvm/projects/evm-tests/run_evm_tests.sh b/llvm/projects/evm-tests/run_evm_tests.sh index f87bb4d9985c..9c9e6cce912a 100755 --- a/llvm/projects/evm-tests/run_evm_tests.sh +++ b/llvm/projects/evm-tests/run_evm_tests.sh @@ -9,7 +9,7 @@ BUILD_DIR=${CWD}/build NPROC=`nproc` function build() { - cmake -S ${SOURCE_DIR}/../../ -B ${BUILD_DIR} -DCMAKE_BUILD_TYPE=Debug \ + cmake -S ${SOURCE_DIR}/../../ -B ${BUILD_DIR} -DCMAKE_BUILD_TYPE=$1 \ -DLLVM_ENABLE_PROJECTS="clang" \ -DLLVM_TARGETS_TO_BUILD="EVM" \ -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=EVM \ @@ -36,9 +36,13 @@ function run_test() { } case $1 in - build ) + build-debug ) shift - build + build Debug + ;; + build-release ) + shift + build Release ;; test ) shift