Skip to content

Conversation

@maurer
Copy link
Contributor

@maurer maurer commented Jan 21, 2026

The attribute now has a size parameter and sorts differently. Adjust tests to tolerate this.

llvm/llvm-project#171712

r? durin42

@rustbot label llvm-main

@rustbot rustbot added 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. llvm-main Marks PRs that are making Rust work with LLVM main (this label is consumed by CI tooling) labels Jan 21, 2026
Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

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

You also need to change the attribute construction code. dead_on_return(0) is not the correct result, it should be just dead_on_return at a different position.

View changes since this review

@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 Jan 21, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 21, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@maurer
Copy link
Contributor Author

maurer commented Jan 21, 2026

@nikic - I don't see a special Attribute::getWithFoo family function for the attribute, and the default Attribute::get all pass a parameter (with the default one we're using right now passing 0, thus the issue).

Reading the CL, it appears that it is only possible to construct the unparameterized attribute through the AttrBuilder interface, which Rust currently doesn't use until the end (when actually applying attributes). Is there actually a way to directly construct an Atribute with dead_on_return (and no parameter)?

If there isn't currently a way, would adding an additional getWith static method to LLVM that explicitly doesn't add any optional parameters be the right way to address this?

@nikic
Copy link
Contributor

nikic commented Jan 21, 2026

It's possible to construct it as a normal integer attribute with std::numeric_limits<uint64_t>::max() value. But this is somewhat relying on internal implementation details. Adding an additional getWith method would be the clean way to do it.

@rustbot rustbot added the A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. label Jan 21, 2026
@rust-log-analyzer

This comment has been minimized.

The attribute now has a size parameter and sorts differently:
* Explicitly omit size parameter during construction on 23+
* Tolerate alternate sorting in tests

llvm/llvm-project#171712
@maurer
Copy link
Contributor Author

maurer commented Jan 22, 2026

@rustbot ready

I added the getWith method LLVM side, and we now have a green CI build with this change, and are no longer setting size=0, and instead leaving the size unset.

@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 Jan 22, 2026
@maurer maurer requested a review from nikic January 22, 2026 02:11
@nikic
Copy link
Contributor

nikic commented Jan 22, 2026

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 22, 2026

📌 Commit b639b0a has been approved by nikic

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 Jan 22, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jan 22, 2026
llvm: Tolerate dead_on_return attribute changes

The attribute now has a size parameter and sorts differently. Adjust tests to tolerate this.

llvm/llvm-project#171712

r? durin42

@rustbot label llvm-main
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jan 22, 2026
llvm: Tolerate dead_on_return attribute changes

The attribute now has a size parameter and sorts differently. Adjust tests to tolerate this.

llvm/llvm-project#171712

r? durin42

@rustbot label llvm-main
rust-bors bot pushed a commit that referenced this pull request Jan 22, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #148206 (Deduplicated float tests and unified in floats/mod.rs)
 - #151042 (fix fallback impl for select_unpredictable intrinsic)
 - #151220 (option: Use Option::map in Option::cloned)
 - #151260 (Handle unevaluated ConstKind in in_operand)
 - #151441 (Fix ICE: Don't try to evaluate type_consts when eagerly collecting items)
 - #151465 (codegen: clarify some variable names around function calls)
 - #151469 (llvm: Tolerate dead_on_return attribute changes)
 - #151476 (Avoid `-> ()` in derived functions.)

r? @ghost
rust-bors bot pushed a commit that referenced this pull request Jan 22, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #148206 (Deduplicated float tests and unified in floats/mod.rs)
 - #151042 (fix fallback impl for select_unpredictable intrinsic)
 - #151220 (option: Use Option::map in Option::cloned)
 - #151260 (Handle unevaluated ConstKind in in_operand)
 - #151441 (Fix ICE: Don't try to evaluate type_consts when eagerly collecting items)
 - #151465 (codegen: clarify some variable names around function calls)
 - #151469 (llvm: Tolerate dead_on_return attribute changes)
 - #151476 (Avoid `-> ()` in derived functions.)

r? @ghost
rust-bors bot pushed a commit that referenced this pull request Jan 22, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #148206 (Deduplicated float tests and unified in floats/mod.rs)
 - #151042 (fix fallback impl for select_unpredictable intrinsic)
 - #151220 (option: Use Option::map in Option::cloned)
 - #151260 (Handle unevaluated ConstKind in in_operand)
 - #151441 (Fix ICE: Don't try to evaluate type_consts when eagerly collecting items)
 - #151465 (codegen: clarify some variable names around function calls)
 - #151469 (llvm: Tolerate dead_on_return attribute changes)
 - #151476 (Avoid `-> ()` in derived functions.)

r? @ghost
rust-bors bot pushed a commit that referenced this pull request Jan 22, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #151001 (rustdoc: render doc(hidden) as a code attribute)
 - #151042 (fix fallback impl for select_unpredictable intrinsic)
 - #151220 (option: Use Option::map in Option::cloned)
 - #151260 (Handle unevaluated ConstKind in in_operand)
 - #151296 (MGCA: Fix incorrect pretty printing of valtree arrays)
 - #151423 (Move assert_matches to planned stable path)
 - #151441 (Fix ICE: Don't try to evaluate type_consts when eagerly collecting items)
 - #151465 (codegen: clarify some variable names around function calls)
 - #151468 (fix `f16` doctest FIXMEs)
 - #151469 (llvm: Tolerate dead_on_return attribute changes)
 - #151476 (Avoid `-> ()` in derived functions.)

r? @ghost
rust-bors bot pushed a commit that referenced this pull request Jan 22, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #151001 (rustdoc: render doc(hidden) as a code attribute)
 - #151042 (fix fallback impl for select_unpredictable intrinsic)
 - #151220 (option: Use Option::map in Option::cloned)
 - #151260 (Handle unevaluated ConstKind in in_operand)
 - #151296 (MGCA: Fix incorrect pretty printing of valtree arrays)
 - #151423 (Move assert_matches to planned stable path)
 - #151441 (Fix ICE: Don't try to evaluate type_consts when eagerly collecting items)
 - #151465 (codegen: clarify some variable names around function calls)
 - #151468 (fix `f16` doctest FIXMEs)
 - #151469 (llvm: Tolerate dead_on_return attribute changes)
 - #151476 (Avoid `-> ()` in derived functions.)

r? @ghost
rust-bors bot pushed a commit that referenced this pull request Jan 22, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #151001 (rustdoc: render doc(hidden) as a code attribute)
 - #151042 (fix fallback impl for select_unpredictable intrinsic)
 - #151220 (option: Use Option::map in Option::cloned)
 - #151260 (Handle unevaluated ConstKind in in_operand)
 - #151296 (MGCA: Fix incorrect pretty printing of valtree arrays)
 - #151423 (Move assert_matches to planned stable path)
 - #151441 (Fix ICE: Don't try to evaluate type_consts when eagerly collecting items)
 - #151465 (codegen: clarify some variable names around function calls)
 - #151468 (fix `f16` doctest FIXMEs)
 - #151469 (llvm: Tolerate dead_on_return attribute changes)
 - #151476 (Avoid `-> ()` in derived functions.)

r? @ghost
@rust-bors rust-bors bot merged commit 797601b into rust-lang:main Jan 22, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Jan 22, 2026
rust-timer added a commit that referenced this pull request Jan 22, 2026
Rollup merge of #151469 - maurer:dead-on-return, r=nikic

llvm: Tolerate dead_on_return attribute changes

The attribute now has a size parameter and sorts differently. Adjust tests to tolerate this.

llvm/llvm-project#171712

r? durin42

@rustbot label llvm-main
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jan 23, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#151001 (rustdoc: render doc(hidden) as a code attribute)
 - rust-lang/rust#151042 (fix fallback impl for select_unpredictable intrinsic)
 - rust-lang/rust#151220 (option: Use Option::map in Option::cloned)
 - rust-lang/rust#151260 (Handle unevaluated ConstKind in in_operand)
 - rust-lang/rust#151296 (MGCA: Fix incorrect pretty printing of valtree arrays)
 - rust-lang/rust#151423 (Move assert_matches to planned stable path)
 - rust-lang/rust#151441 (Fix ICE: Don't try to evaluate type_consts when eagerly collecting items)
 - rust-lang/rust#151465 (codegen: clarify some variable names around function calls)
 - rust-lang/rust#151468 (fix `f16` doctest FIXMEs)
 - rust-lang/rust#151469 (llvm: Tolerate dead_on_return attribute changes)
 - rust-lang/rust#151476 (Avoid `-> ()` in derived functions.)

r? @ghost
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) 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.

5 participants