Skip to content

LLVM 23: Run AssignGUIDPass in some places#157055

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
TimNN:guid
Jun 2, 2026
Merged

LLVM 23: Run AssignGUIDPass in some places#157055
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
TimNN:guid

Conversation

@TimNN
Copy link
Copy Markdown
Contributor

@TimNN TimNN commented May 28, 2026

llvm/llvm-project#184065 introduced the new pass.

I'm not 100% confident that this is the correct patch, but it makes all the previously failing run-make "lto" tests pass on my machine.

I added the pass to the if (NeedThinLTOBufferPasses) section to match the addRequiredLTOPreLinkPasses changes from the LLVM PR, and to the LLVMRustModuleSerialize section based on the stack trace of an LLVM assertion.

The IR may now contain an additional !guid attribute, requiring some codegen test expectations to be updated. I mostly followed the pattern from the LLVM PR, and removed trailing {s. (For both, tests that were failing locally, as well as potentially problematic expectations identified via grep, in case the test wasn't being run locally).

@rustbot label llvm-main

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 28, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 28, 2026

r? @cuviper

rustbot has assigned @cuviper.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @cuviper

@rustbot rustbot added the llvm-main Marks PRs that are making Rust work with LLVM main (this label is consumed by CI tooling) label May 28, 2026
@TimNN TimNN marked this pull request as draft May 28, 2026 11:14
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 28, 2026
@TimNN
Copy link
Copy Markdown
Contributor Author

TimNN commented May 28, 2026

Some FileCheck tests also need to be updated since the generated IR can now include !guid annotations.

@rustbot rustbot added the PG-exploit-mitigations Project group: Exploit mitigations label May 28, 2026
@TimNN TimNN marked this pull request as ready for review May 28, 2026 13:00
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 28, 2026

Some changes occurred in tests/codegen-llvm/sanitizer

cc @rcvalle

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 28, 2026
@durin42
Copy link
Copy Markdown
Contributor

durin42 commented Jun 1, 2026

This is a little over my head in some ways, but the patch matches what I naively expected from looking at the LLVM change.

@cuviper
Copy link
Copy Markdown
Member

cuviper commented Jun 1, 2026

I'm not 100% sure either, but it looks ok -- and we can always follow up later. :)

@bors r+ rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 1, 2026

📌 Commit cdb73bb has been approved by cuviper

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 1, 2026
rust-bors Bot pushed a commit that referenced this pull request Jun 1, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #156085 (miri: require (almost) all 1-ZST arguments to be actually passed)
 - #155193 (Check arguments of attributes where no arguments are expected)
 - #156516 (nix: remove some unneeded variables)
 - #156562 (Resolving Windows environment test failures)
 - #156588 (Don't drop uninit memory when `MapWindows::clone` panics)
 - #156673 (Privacy: small cleanups)
 - #156817 (Add `#[unsafe_eii]` to unsafe EII UI tests)
 - #156924 (Use #[panic_handler] rather than #[lang = "panic_impl"])
 - #157055 (LLVM 23: Run AssignGUIDPass in some places)
 - #157108 (Add Xtensa va_arg assembly coverage)
 - #157220 (cg_ssa: a bit less `immediate_or_packed_pair`)
 - #157241 (Trace `?id.local_def_index` instead of `id` in `def_path_hash`)
 - #157242 (Tune backport Zulip messages)
rust-bors Bot pushed a commit that referenced this pull request Jun 1, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #156085 (miri: require (almost) all 1-ZST arguments to be actually passed)
 - #155193 (Check arguments of attributes where no arguments are expected)
 - #156516 (nix: remove some unneeded variables)
 - #156562 (Resolving Windows environment test failures)
 - #156588 (Don't drop uninit memory when `MapWindows::clone` panics)
 - #156673 (Privacy: small cleanups)
 - #156817 (Add `#[unsafe_eii]` to unsafe EII UI tests)
 - #156924 (Use #[panic_handler] rather than #[lang = "panic_impl"])
 - #157055 (LLVM 23: Run AssignGUIDPass in some places)
 - #157108 (Add Xtensa va_arg assembly coverage)
 - #157220 (cg_ssa: a bit less `immediate_or_packed_pair`)
 - #157241 (Trace `?id.local_def_index` instead of `id` in `def_path_hash`)
 - #157242 (Tune backport Zulip messages)
rust-bors Bot pushed a commit that referenced this pull request Jun 1, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #156085 (miri: require (almost) all 1-ZST arguments to be actually passed)
 - #155193 (Check arguments of attributes where no arguments are expected)
 - #156516 (nix: remove some unneeded variables)
 - #156562 (Resolving Windows environment test failures)
 - #156588 (Don't drop uninit memory when `MapWindows::clone` panics)
 - #156673 (Privacy: small cleanups)
 - #156817 (Add `#[unsafe_eii]` to unsafe EII UI tests)
 - #156924 (Use #[panic_handler] rather than #[lang = "panic_impl"])
 - #157055 (LLVM 23: Run AssignGUIDPass in some places)
 - #157108 (Add Xtensa va_arg assembly coverage)
 - #157220 (cg_ssa: a bit less `immediate_or_packed_pair`)
 - #157241 (Trace `?id.local_def_index` instead of `id` in `def_path_hash`)
 - #157242 (Tune backport Zulip messages)
@rust-bors rust-bors Bot merged commit 0f6fb22 into rust-lang:main Jun 2, 2026
12 checks passed
@rustbot rustbot added this to the 1.98.0 milestone Jun 2, 2026
rust-timer added a commit that referenced this pull request Jun 2, 2026
Rollup merge of #157055 - TimNN:guid, r=cuviper

LLVM 23: Run AssignGUIDPass in some places

llvm/llvm-project#184065 introduced the new pass.

I'm not 100% confident that this is the correct patch, but it makes all the previously failing `run-make` "lto" tests pass on my machine.

I added the pass to the `if (NeedThinLTOBufferPasses)` section to match the `addRequiredLTOPreLinkPasses` changes from the LLVM PR, and to the `LLVMRustModuleSerialize` section based on the stack trace of an LLVM assertion.

The IR may now contain an additional `!guid` attribute, requiring some codegen test expectations to be updated. I mostly followed the pattern from the LLVM PR, and removed trailing `{`s. (For both, tests that were failing locally, as well as potentially problematic expectations identified via grep, in case the test wasn't being run locally).

@rustbot label llvm-main
pull Bot pushed a commit to xtqqczze/rust-lang-miri that referenced this pull request Jun 2, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - rust-lang/rust#156085 (miri: require (almost) all 1-ZST arguments to be actually passed)
 - rust-lang/rust#155193 (Check arguments of attributes where no arguments are expected)
 - rust-lang/rust#156516 (nix: remove some unneeded variables)
 - rust-lang/rust#156562 (Resolving Windows environment test failures)
 - rust-lang/rust#156588 (Don't drop uninit memory when `MapWindows::clone` panics)
 - rust-lang/rust#156673 (Privacy: small cleanups)
 - rust-lang/rust#156817 (Add `#[unsafe_eii]` to unsafe EII UI tests)
 - rust-lang/rust#156924 (Use #[panic_handler] rather than #[lang = "panic_impl"])
 - rust-lang/rust#157055 (LLVM 23: Run AssignGUIDPass in some places)
 - rust-lang/rust#157108 (Add Xtensa va_arg assembly coverage)
 - rust-lang/rust#157220 (cg_ssa: a bit less `immediate_or_packed_pair`)
 - rust-lang/rust#157241 (Trace `?id.local_def_index` instead of `id` in `def_path_hash`)
 - rust-lang/rust#157242 (Tune backport Zulip messages)
@zmodem
Copy link
Copy Markdown
Contributor

zmodem commented Jun 3, 2026

The LLVM-side patch was reverted in llvm/llvm-project#201194

Should we revert this, or wait for the LLVM-side patch to come back?

The builds will be broken in the meantime :/ E.g. https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/46237

@TimNN
Copy link
Copy Markdown
Contributor Author

TimNN commented Jun 3, 2026

Guess I didn't wait long enough 🙄 (I was watching the LLVM PR to see whether it would get rolled back…)

For https://buildkite.com/llvm-project/rust-llvm-integrate-prototype at least, we could just post a draft PR for now with the llvm-main label without actually submitting it.

Depends a bit on how quickly we expect this to be rolled forwards again.

@zmodem
Copy link
Copy Markdown
Contributor

zmodem commented Jun 3, 2026

Guess I didn't wait long enough 🙄

No, getting this fix in early was good since it unblocked us.

we could just post a draft PR for now with the llvm-main label without actually submitting it.

Sounds good to me: #157365

@mati865
Copy link
Copy Markdown
Member

mati865 commented Jun 3, 2026

Is LLVM patch expected to reland soon? Otherwise, we will have to proceed with the revert.

@zmodem
Copy link
Copy Markdown
Contributor

zmodem commented Jun 4, 2026

I'm sure they're working on it, but I don't know if there's an ETA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. llvm-main Marks PRs that are making Rust work with LLVM main (this label is consumed by CI tooling) PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants