Skip to content

Update LLVM from 13.0.1 to 14.0.6#8031

Merged
csyonghe merged 3 commits intomasterfrom
llvm-14
Aug 7, 2025
Merged

Update LLVM from 13.0.1 to 14.0.6#8031
csyonghe merged 3 commits intomasterfrom
llvm-14

Conversation

@samestep
Copy link
Contributor

@samestep samestep commented Aug 1, 2025

@samestep samestep marked this pull request as ready for review August 1, 2025 18:15
@samestep samestep requested a review from a team as a code owner August 1, 2025 18:15
@samestep samestep added the pr: non-breaking PRs without breaking changes label Aug 1, 2025
Copy link
Collaborator

@jkwak-work jkwak-work left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.
Thanks for the fix.

I don't think our CI covers this part of changes.
I am not sure how to make sure it works?

@samestep
Copy link
Contributor Author

samestep commented Aug 4, 2025

@jkwak-work hmm, not sure what you mean; doesn't this get automatically built in CI?

# Try to restore an LLVM install, and build it otherwise
- uses: actions/cache/restore@v4
id: cache-llvm
if: inputs.build-llvm == 'true'
with:
path: ${{ github.workspace }}/build/llvm-project-install
# Use os*compiler*platform in lieu of an ABI key here, which is what we really want
key: llvm-${{ inputs.os }}-${{ inputs.compiler }}-${{ inputs.platform }}-${{ hashFiles('external/build-llvm.sh') }}
- name: Build LLVM
if: inputs.build-llvm == 'true' && steps.cache-llvm.outputs.cache-hit != 'true'
shell: bash
run: |
./external/build-llvm.sh \
--install-prefix "${{github.workspace}}/build/llvm-project-install" \
--repo "https://${{github.token}}@github.com/llvm/llvm-project"
- uses: actions/cache/save@v4
if: inputs.build-llvm == 'true' && steps.cache-llvm.outputs.cache-hit != 'true'
with:
path: ${{ github.workspace }}/build/llvm-project-install
key: ${{ steps.cache-llvm.outputs.cache-primary-key }}
- name: Set environment variable for CMake
shell: bash
run: |
if [ "${{inputs.build-llvm}}" == "true" ]; then
echo "LLVM_DIR=${{ github.workspace }}/build/llvm-project-install" >> "$GITHUB_ENV"
echo "Clang_DIR=${{ github.workspace }}/build/llvm-project-install" >> "$GITHUB_ENV"
fi

That gets used by most of our GitHub Actions workflows:

$ git grep --files-with-matches '.github/actions/common-setup'
.github/workflows/benchmark.yml
.github/workflows/check-cmdline-ref.yml
.github/workflows/ci.yml
.github/workflows/compile-regression-test.yml
.github/workflows/falcor-compiler-perf-test.yml
.github/workflows/falcor-test.yml
.github/workflows/push-benchmark-results.yml
.github/workflows/regenerate-cmdline-ref.yml
.github/workflows/release.yml
.github/workflows/vk-gl-cts-nightly.yml

Also: what LLVM version do we want to upgrade to? We could upgrade to 14 with this PR, but we could alternatively upgrade to 15 or 16 which already work on Linux and macOS (see my other PRs), just requiring what I'm guessing will be a small fix for Windows; or we could just try to go all the way to 20 since that's the newest version. Is there a particular reason for choosing an older version instead of a newer one?

@jkwak-work
Copy link
Collaborator

@jkwak-work hmm, not sure what you mean; doesn't this get automatically built in CI?

# Try to restore an LLVM install, and build it otherwise
- uses: actions/cache/restore@v4
id: cache-llvm
if: inputs.build-llvm == 'true'
with:
path: ${{ github.workspace }}/build/llvm-project-install
# Use os*compiler*platform in lieu of an ABI key here, which is what we really want
key: llvm-${{ inputs.os }}-${{ inputs.compiler }}-${{ inputs.platform }}-${{ hashFiles('external/build-llvm.sh') }}
- name: Build LLVM
if: inputs.build-llvm == 'true' && steps.cache-llvm.outputs.cache-hit != 'true'
shell: bash
run: |
./external/build-llvm.sh \
--install-prefix "${{github.workspace}}/build/llvm-project-install" \
--repo "https://${{github.token}}@github.com/llvm/llvm-project"
- uses: actions/cache/save@v4
if: inputs.build-llvm == 'true' && steps.cache-llvm.outputs.cache-hit != 'true'
with:
path: ${{ github.workspace }}/build/llvm-project-install
key: ${{ steps.cache-llvm.outputs.cache-primary-key }}
- name: Set environment variable for CMake
shell: bash
run: |
if [ "${{inputs.build-llvm}}" == "true" ]; then
echo "LLVM_DIR=${{ github.workspace }}/build/llvm-project-install" >> "$GITHUB_ENV"
echo "Clang_DIR=${{ github.workspace }}/build/llvm-project-install" >> "$GITHUB_ENV"
fi

That gets used by most of our GitHub Actions workflows:

$ git grep --files-with-matches '.github/actions/common-setup'
.github/workflows/benchmark.yml
.github/workflows/check-cmdline-ref.yml
.github/workflows/ci.yml
.github/workflows/compile-regression-test.yml
.github/workflows/falcor-compiler-perf-test.yml
.github/workflows/falcor-test.yml
.github/workflows/push-benchmark-results.yml
.github/workflows/regenerate-cmdline-ref.yml
.github/workflows/release.yml
.github/workflows/vk-gl-cts-nightly.yml

Also: what LLVM version do we want to upgrade to? We could upgrade to 14 with this PR, but we could alternatively upgrade to 15 or 16 which already work on Linux and macOS (see my other PRs), just requiring what I'm guessing will be a small fix for Windows; or we could just try to go all the way to 20 since that's the newest version. Is there a particular reason for choosing an older version instead of a newer one?

Oh. You are right. I forgot about that.
CI builds it on a certain configurations.
https://github.com/shader-slang/slang/blob/master/.github/workflows/ci.yml#L51-L52

Copy link
Collaborator

@jkwak-work jkwak-work left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@csyonghe csyonghe added this pull request to the merge queue Aug 7, 2025
Merged via the queue into master with commit 4721b6e Aug 7, 2025
19 of 20 checks passed
@samestep samestep deleted the llvm-14 branch August 8, 2025 13:05
szihs pushed a commit to szihs/slang that referenced this pull request Aug 19, 2025
Full set of mutually exclusive choices for upgrading LLVM:

- shader-slang#8031 (you are here)
- shader-slang#8035
- shader-slang#8036
- shader-slang#8034
- shader-slang#8038
- shader-slang#8039
- shader-slang#8033

Alternative to shader-slang#8028. Required some minor changes due to these upstream
commits:

- llvm/llvm-project@e463b69
- llvm/llvm-project@89b5706
@samestep samestep mentioned this pull request Dec 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: non-breaking PRs without breaking changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants