Fix compatibility with LLVM 23#2951
Merged
Merged
Conversation
nikic
commented
Jul 16, 2026
| static InlineParams getInlineParamsFromOptLevel(OptimizationLevel Level) { | ||
| #if LLVM_VERSION_MAJOR >= 23 | ||
| return getInlineParams(Level.getSpeedupLevel()); | ||
| return getInlineParamsFromOptLevel(static_cast<unsigned>(Level)); |
Collaborator
Author
There was a problem hiding this comment.
This was previously passing the optimization level to an API accepting an inlining threshold ... so this was effectively setting a very low inlining threshold.
wsmoses
reviewed
Jul 16, 2026
| MPM.addPass(InferFunctionAttrsPass()); | ||
|
|
||
| #if LLVM_VERSION_MAJOR >= 23 | ||
| if (Level > OptimizationLevel::O1) { |
Member
There was a problem hiding this comment.
Can we put the { outside the ifdef (so basic code completion tools don't get confused)
Collaborator
Author
|
I updated the commit has in the MLIR test similar to what was done in 7be5247. The commit has is the last one before LLVM 23 was branched. |
rust-bors Bot
pushed a commit
to rust-lang/rust
that referenced
this pull request
Jul 24, 2026
Update to LLVM 23 Changes in this PR (apart from the LLVM update): * Updated cov-map tests due to minor ordering changes introduced in llvm/llvm-project@5931034. The affected tests are limited to LLVM >= 23 now. * Set `LLVM_VERSIONED_DYLIB_NAME_ON_DARWIN=OFF`, which restores the previous unversioned naming of the LLVM dylib on Darwin. I expect we'll want to change this for consistency with Linux, but given the amount of trouble Darwin dylibs have caused in the past, I'm not trying to do it in this PR. * Distribute the llvm-project/libc subproject, which is now a build dependency of LLVM. * Pull in f128 Windows ABI changes from #158778. These need to land in sync with the LLVM update (as ABI of libcalls is controlled by LLVM, not our ABI lowering). * Disable RISCV backend on dist-i686-mingw, because the build OOMs on a large generated file. This is a temporary measure until host tools are removed by rust-lang/compiler-team#1020. * The llvm-project fork includes a new downstream patch for mingw: rust-lang/llvm-project@b89cd8e It works around mingw having broken TLS prior to GCC 16. (We're currently on GCC 14.) Issues: * [x] llvm/llvm-project#209512 * [x] llvm/llvm-project#209714 * [x] llvm/llvm-project#209718 * [x] rust-lang/stdarch#2190 (synced in #159517) * [x] llvm/llvm-project#210025 * [x] #159391 * [x] EnzymeAD/Enzyme#2951 * [x] #159301 * [x] llvm/llvm-project#210300
rust-bors Bot
pushed a commit
to rust-lang/rust
that referenced
this pull request
Jul 24, 2026
Update to LLVM 23 Changes in this PR (apart from the LLVM update): * Updated cov-map tests due to minor ordering changes introduced in llvm/llvm-project@5931034. The affected tests are limited to LLVM >= 23 now. * Set `LLVM_VERSIONED_DYLIB_NAME_ON_DARWIN=OFF`, which restores the previous unversioned naming of the LLVM dylib on Darwin. I expect we'll want to change this for consistency with Linux, but given the amount of trouble Darwin dylibs have caused in the past, I'm not trying to do it in this PR. * Distribute the llvm-project/libc subproject, which is now a build dependency of LLVM. * Pull in f128 Windows ABI changes from #158778. These need to land in sync with the LLVM update (as ABI of libcalls is controlled by LLVM, not our ABI lowering). * Disable RISCV backend on dist-i686-mingw, because the build OOMs on a large generated file. This is a temporary measure until host tools are removed by rust-lang/compiler-team#1020. * The llvm-project fork includes a new downstream patch for mingw: rust-lang/llvm-project@b89cd8e It works around mingw having broken TLS prior to GCC 16. (We're currently on GCC 14.) Issues: * [x] llvm/llvm-project#209512 * [x] llvm/llvm-project#209714 * [x] llvm/llvm-project#209718 * [x] rust-lang/stdarch#2190 (synced in #159517) * [x] llvm/llvm-project#210025 * [x] #159391 * [x] EnzymeAD/Enzyme#2951 * [x] #159301 * [x] llvm/llvm-project#210300
rust-bors Bot
pushed a commit
to rust-lang/rust
that referenced
this pull request
Jul 25, 2026
Update to LLVM 23 Changes in this PR (apart from the LLVM update): * Updated cov-map tests due to minor ordering changes introduced in llvm/llvm-project@5931034. The affected tests are limited to LLVM >= 23 now. * Set `LLVM_VERSIONED_DYLIB_NAME_ON_DARWIN=OFF`, which restores the previous unversioned naming of the LLVM dylib on Darwin. I expect we'll want to change this for consistency with Linux, but given the amount of trouble Darwin dylibs have caused in the past, I'm not trying to do it in this PR. * Distribute the llvm-project/libc subproject, which is now a build dependency of LLVM. * Pull in f128 Windows ABI changes from #158778. These need to land in sync with the LLVM update (as ABI of libcalls is controlled by LLVM, not our ABI lowering). * Disable RISCV backend on dist-i686-mingw, because the build OOMs on a large generated file. This is a temporary measure until host tools are removed by rust-lang/compiler-team#1020. * The llvm-project fork includes a new downstream patch for mingw: rust-lang/llvm-project@b89cd8e It works around mingw having broken TLS prior to GCC 16. (We're currently on GCC 14.) Issues: * [x] llvm/llvm-project#209512 * [x] llvm/llvm-project#209714 * [x] llvm/llvm-project#209718 * [x] rust-lang/stdarch#2190 (synced in #159517) * [x] llvm/llvm-project#210025 * [x] #159391 * [x] EnzymeAD/Enzyme#2951 * [x] #159301 * [x] llvm/llvm-project#210300
rust-bors Bot
pushed a commit
to rust-lang/rust
that referenced
this pull request
Jul 25, 2026
Update to LLVM 23 Changes in this PR (apart from the LLVM update): * Updated cov-map tests due to minor ordering changes introduced in llvm/llvm-project@5931034. The affected tests are limited to LLVM >= 23 now. * Set `LLVM_VERSIONED_DYLIB_NAME_ON_DARWIN=OFF`, which restores the previous unversioned naming of the LLVM dylib on Darwin. I expect we'll want to change this for consistency with Linux, but given the amount of trouble Darwin dylibs have caused in the past, I'm not trying to do it in this PR. * Distribute the llvm-project/libc subproject, which is now a build dependency of LLVM. * Pull in f128 Windows ABI changes from #158778. These need to land in sync with the LLVM update (as ABI of libcalls is controlled by LLVM, not our ABI lowering). * Disable RISCV backend on dist-i686-mingw, because the build OOMs on a large generated file. This is a temporary measure until host tools are removed by rust-lang/compiler-team#1020. * The llvm-project fork includes a new downstream patch for mingw: rust-lang/llvm-project@b89cd8e It works around mingw having broken TLS prior to GCC 16. (We're currently on GCC 14.) Issues: * [x] llvm/llvm-project#209512 * [x] llvm/llvm-project#209714 * [x] llvm/llvm-project#209718 * [x] rust-lang/stdarch#2190 (synced in #159517) * [x] llvm/llvm-project#210025 * [x] #159391 * [x] EnzymeAD/Enzyme#2951 * [x] #159301 * [x] llvm/llvm-project#210300
rust-bors Bot
pushed a commit
to rust-lang/rust
that referenced
this pull request
Jul 25, 2026
Update to LLVM 23 Changes in this PR (apart from the LLVM update): * Updated cov-map tests due to minor ordering changes introduced in llvm/llvm-project@5931034. The affected tests are limited to LLVM >= 23 now. * Set `LLVM_VERSIONED_DYLIB_NAME_ON_DARWIN=OFF`, which restores the previous unversioned naming of the LLVM dylib on Darwin. I expect we'll want to change this for consistency with Linux, but given the amount of trouble Darwin dylibs have caused in the past, I'm not trying to do it in this PR. * Distribute the llvm-project/libc subproject, which is now a build dependency of LLVM. * Pull in f128 Windows ABI changes from #158778. These need to land in sync with the LLVM update (as ABI of libcalls is controlled by LLVM, not our ABI lowering). * Disable RISCV backend on dist-i686-mingw, because the build OOMs on a large generated file. This is a temporary measure until host tools are removed by rust-lang/compiler-team#1020. * The llvm-project fork includes a new downstream patch for mingw: rust-lang/llvm-project@b89cd8e It works around mingw having broken TLS prior to GCC 16. (We're currently on GCC 14.) Issues: * [x] llvm/llvm-project#209512 * [x] llvm/llvm-project#209714 * [x] llvm/llvm-project#209718 * [x] rust-lang/stdarch#2190 (synced in #159517) * [x] llvm/llvm-project#210025 * [x] #159391 * [x] EnzymeAD/Enzyme#2951 * [x] #159301 * [x] llvm/llvm-project#210300
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
OptimizationLevel is an enum now.