forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Test tdiff action #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
461622a
Test tdiff action
lukel97 c81c6dc
Modify tdiff workflow for pull requests and benchmarking
lukel97 39d8402
Fetch commit before checkout
lukel97 9be34c9
Fetch and checkout sha, not ref
lukel97 4088ce8
Set LLVM_APPEND_VC_REV=OFF
lukel97 19e98c3
Add armv9-a and x86_64
lukel97 1e514e2
Refactor LLVM test suite build commands into a function
lukel97 475aa5c
Add toolchain for x86_64
lukel97 e1883f6
Update build_llvm_test_suite function parameters
lukel97 d4322c2
--depth=1
lukel97 96c5874
Update GitHub Actions workflow for tdiff
lukel97 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,123 @@ | ||
| name: Diff llvm-test-suite codegen | ||
|
|
||
| on: | ||
| issue_comment: | ||
| types: | ||
| - created | ||
| - edited | ||
|
|
||
| jobs: | ||
| tdiff: | ||
| name: Build and diff | ||
| runs-on: ubuntu-24.04 | ||
| permissions: | ||
| issues: write | ||
| pull-requests: write | ||
| # if: >- | ||
| # !startswith(github.event.comment.body, '<!--IGNORE-->') && | ||
| # github.event.issue.pull_request && contains(github.event.comment.body, '/tdiff') | ||
| steps: | ||
| - id: base-ref | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| script: | | ||
| const { data: pr } = await github.rest.pulls.get({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| pull_number: context.payload.issue.number | ||
| }); | ||
| core.setOutput('base_ref', pr.base.ref); | ||
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||
| with: | ||
| ref: refs/pull/${{ github.event.issue.number }}/head | ||
| - run: | | ||
| echo "REF=$(git rev-parse HEAD)" >> $GITHUB_ENV | ||
| echo "MERGE_BASE=$(git merge-base HEAD ${{steps.base-ref.outputs.base_ref}})" >> $GITHUB_ENV | ||
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||
| with: | ||
| repository: llvm/llvm-test-suite | ||
| path: llvm-test-suite | ||
| - name: Install system dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y cmake ninja-build libc6-dev-{arm64,riscv64}-cross libgcc-14-dev-{arm64,riscv64}-cross libstdc++-14-dev-{arm64,riscv64}-cross | ||
| - run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD='AArch64;X86;RISCV' -DLLVM_ENABLE_PROJECTS='clang;lld' -DLLVM_APPEND_VC_REV=OFF llvm -GNinja | ||
| - run: ninja -C build | ||
| - run: | | ||
| cat << EOF > rva23u64.cmake | ||
| set(CMAKE_SYSTEM_NAME Linux) | ||
| set(CMAKE_C_COMPILER ${GITHUB_WORKSPACE}/build/bin/clang) | ||
| set(CMAKE_CXX_COMPILER ${GITHUB_WORKSPACE}/build/bin/clang++) | ||
| set(CMAKE_C_COMPILER_TARGET riscv64-linux-gnu) | ||
| set(CMAKE_CXX_COMPILER_TARGET riscv64-linux-gnu) | ||
| set(CMAKE_C_FLAGS_INIT "-march=rva23u64 -save-temps=obj") | ||
| set(CMAKE_CXX_FLAGS_INIT "-march=rva23u64 -save-temps=obj") | ||
| set(CMAKE_SYSTEM_PROCESSOR riscv64) | ||
| set(CMAKE_LINKER_TYPE LLD) | ||
| EOF | ||
| cat << EOF > armv9-a.cmake | ||
| set(CMAKE_SYSTEM_NAME Linux) | ||
| set(CMAKE_C_COMPILER ${GITHUB_WORKSPACE}/build/bin/clang) | ||
| set(CMAKE_CXX_COMPILER ${GITHUB_WORKSPACE}/build/bin/clang++) | ||
| set(CMAKE_C_COMPILER_TARGET aarch64-linux-gnu) | ||
| set(CMAKE_CXX_COMPILER_TARGET aarch64-linux-gnu) | ||
| set(CMAKE_C_FLAGS_INIT "-march=armv9-a -save-temps=obj") | ||
| set(CMAKE_CXX_FLAGS_INIT "-march=armv9-a -save-temps=obj") | ||
| set(CMAKE_SYSTEM_PROCESSOR arm64) | ||
| set(CMAKE_LINKER_TYPE LLD) | ||
| EOF | ||
| cat << EOF > x86_64.cmake | ||
| set(CMAKE_C_COMPILER ${GITHUB_WORKSPACE}/build/bin/clang) | ||
| set(CMAKE_CXX_COMPILER ${GITHUB_WORKSPACE}/build/bin/clang++) | ||
| set(CMAKE_C_FLAGS_INIT "-save-temps=obj") | ||
| set(CMAKE_CXX_FLAGS_INIT "-save-temps=obj") | ||
| set(CMAKE_LINKER_TYPE LLD) | ||
| EOF | ||
| build_llvm_test_suite () { | ||
| cmake -B build.$1 -C cmake/caches/O3.cmake --toolchain $2 -DTEST_SUITE_BENCHMARKING_ONLY=ON -DTEST_SUITE_RUN_BENCHMARKS=OFF -GNinja | ||
| ninja -C build.$1 | ||
| $GITHUB_WORKSPACE/build/bin/llvm-lit build.$1 -o results.$1.json | ||
| } | ||
| build_llvm_test_suite rva23u64-O3-b rva23u64.cmake | ||
| build_llvm_test_suite armv9-a-O3-b armv9-a.cmake | ||
| build_llvm_test_suite x86_64-O3-b x86_64.cmake | ||
| working-directory: llvm-test-suite | ||
| - run: git fetch --depth=1 origin $MERGE_BASE && git checkout $MERGE_BASE | ||
| - run: ninja -C build | ||
| - run: | | ||
| build_llvm_test_suite () { | ||
| cmake -B build.$1 -C cmake/caches/O3.cmake --toolchain $2 -DTEST_SUITE_BENCHMARKING_ONLY=ON -DTEST_SUITE_RUN_BENCHMARKS=OFF -GNinja | ||
| ninja -C build.$1 | ||
| $GITHUB_WORKSPACE/build/bin/llvm-lit build.$1 -o results.$1.json | ||
| } | ||
| build_llvm_test_suite rva23u64-O3-a rva23u64.cmake | ||
| build_llvm_test_suite armv9-a-O3-a armv9-a.cmake | ||
| build_llvm_test_suite x86_64-O3-a x86_64.cmake | ||
| working-directory: llvm-test-suite | ||
| - run: | | ||
| mkdir diffs | ||
| ./utils/tdiff.py -a build.rva23u64-O3-a -b build.rva23u64-O3-b -s all > diffs/rva23u64-O3.diff || true | ||
| ./utils/tdiff.py -a build.armv9-a-O3-a -b build.armv9-a-O3-b -s all > diffs/armv9-a-O3.diff || true | ||
| ./utils/tdiff.py -a build.x86_64-O3-a -b build.x86_64-O3-b -s all > diffs/x86_64-O3.diff || true | ||
| working-directory: llvm-test-suite | ||
| - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f #v7.0.0 | ||
| id: upload-diffs | ||
| with: | ||
| name: diffs | ||
| path: llvm-test-suite/diffs | ||
| - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f #v7.0.0 | ||
| with: | ||
| name: results | ||
| path: llvm-test-suite/results*.json | ||
| - uses: actions/github-script@v7 | ||
| env: | ||
| DIFF_URL: ${{ steps.upload-diffs.outputs.artifact-url }} | ||
| with: | ||
| script: | | ||
| github.rest.issues.createComment({ | ||
| issue_number: context.issue.number, | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| body: process.env.DIFF_URL | ||
| }) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check failure
Code scanning / CodeQL
Checkout of untrusted code in a privileged context Critical