Skip to content

Remove dummy loads on offload codegen#152020

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Sa4dUs:offload-remove-dummy-loads
Feb 5, 2026
Merged

Remove dummy loads on offload codegen#152020
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Sa4dUs:offload-remove-dummy-loads

Conversation

@Sa4dUs
Copy link
Contributor

@Sa4dUs Sa4dUs commented Feb 2, 2026

The current logic generates two dummy loads to prevent some globals from being optimized away. This blocks memtransfer loop hoisting optimizations, so it's time to remove them.

r? @ZuseZ4

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 2, 2026
@ZuseZ4 ZuseZ4 self-requested a review February 3, 2026 20:52
@ZuseZ4 ZuseZ4 self-assigned this Feb 3, 2026
@ZuseZ4
Copy link
Member

ZuseZ4 commented Feb 3, 2026

@Sa4dUs Can you rebase? Also, is there a reason this is a draft? If it works I'd land this first to unblock optimizations and leave the alloca/global improvements for a follow-up PR.

@rustbot
Copy link
Collaborator

rustbot commented Feb 4, 2026

Requested reviewer is already assigned to this pull request.

Please choose another assignee.

@Sa4dUs Sa4dUs changed the title [WIP] Remove dummy loads on offload codegen Remove dummy loads on offload codegen Feb 4, 2026
@Sa4dUs Sa4dUs force-pushed the offload-remove-dummy-loads branch from 59c4307 to bea4583 Compare February 4, 2026 14:21
@rust-log-analyzer

This comment has been minimized.

@Sa4dUs Sa4dUs force-pushed the offload-remove-dummy-loads branch from bea4583 to 212c8c3 Compare February 4, 2026 14:27
@Sa4dUs Sa4dUs marked this pull request as ready for review February 4, 2026 15:55
@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 Feb 4, 2026
@ZuseZ4
Copy link
Member

ZuseZ4 commented Feb 4, 2026

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 4, 2026

📌 Commit 212c8c3 has been approved by ZuseZ4

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 Feb 4, 2026
Zalathar added a commit to Zalathar/rust that referenced this pull request Feb 5, 2026
… r=ZuseZ4

Remove dummy loads on offload codegen

The current logic generates two dummy loads to prevent some globals from being optimized away. This blocks memtransfer loop hoisting optimizations, so it's time to remove them.

r? @ZuseZ4
rust-bors bot pushed a commit that referenced this pull request Feb 5, 2026
Rollup of 15 pull requests

Successful merges:

 - #151431 (Add new unstable attribute: `#[export_visibility = ...]`.)
 - #146900 (Add avr_target_feature)
 - #152033 (Rename trait `DepNodeParams` to `DepNodeKey`)
 - #152142 (Convert to inline diagnostics in `rustc_hir_typeck`)
 - #152020 (Remove dummy loads on offload codegen)
 - #152023 (Some `rustc_query_system` cleanups)
 - #152068 (Convert to inline diagnostics in `rustc_resolve`)
 - #152081 (Port depgraph testing attributes to parser)
 - #152090 (Port reexport_test_harness_main to attr parser)
 - #152105 (Convert to inline diagnostics in `rustc_ast_lowering`)
 - #152108 (Convert to inline diagnostics in `rustc_expand`)
 - #152114 (Convert to inline diagnostics in `rustc_mir_transform`)
 - #152115 (Convert to inline diagnostics in `rustc_metadata`)
 - #152116 (Remove rustdoc GUI flaky test)
 - #152128 (Adopt matches-logical-or-141497.rs to LLVM HEAD)

Failed merges:

 - #152070 (Convert to inline diagnostics in `rustc_pattern_analysis`)
 - #152106 (Convert to inline diagnostics in `rustc_ast_passes`)
 - #152109 (Convert to inline diagnostics in `rustc_errors`)
 - #152117 (Convert to inline diagnostics in `rustc_trait_selection`)
 - #152118 (Convert to inline diagnostics in `rustc_codegen_ssa`)
 - #152119 (Convert to inline diagnostics in `rustc_middle`)
 - #152126 (Convert to inline diagnostics in `rustc_mir_build`)
 - #152131 (Port rustc_no_implicit_bounds attribute to parser.)
Zalathar added a commit to Zalathar/rust that referenced this pull request Feb 5, 2026
… r=ZuseZ4

Remove dummy loads on offload codegen

The current logic generates two dummy loads to prevent some globals from being optimized away. This blocks memtransfer loop hoisting optimizations, so it's time to remove them.

r? @ZuseZ4
Zalathar added a commit to Zalathar/rust that referenced this pull request Feb 5, 2026
… r=ZuseZ4

Remove dummy loads on offload codegen

The current logic generates two dummy loads to prevent some globals from being optimized away. This blocks memtransfer loop hoisting optimizations, so it's time to remove them.

r? @ZuseZ4
rust-bors bot pushed a commit that referenced this pull request Feb 5, 2026
Rollup of 19 pull requests

Successful merges:

 - #146900 (Add avr_target_feature)
 - #150379 (Return `ExitCode` from `rustc_driver::main` instead of calling `process::exit`)
 - #152033 (Rename trait `DepNodeParams` to `DepNodeKey`)
 - #152142 (Convert to inline diagnostics in `rustc_hir_typeck`)
 - #152145 (Disable flaky test `oneshot::recv_timeout_before_send`)
 - #152020 (Remove dummy loads on offload codegen)
 - #152023 (Some `rustc_query_system` cleanups)
 - #152068 (Convert to inline diagnostics in `rustc_resolve`)
 - #152081 (Port depgraph testing attributes to parser)
 - #152090 (Port reexport_test_harness_main to attr parser)
 - #152105 (Convert to inline diagnostics in `rustc_ast_lowering`)
 - #152108 (Convert to inline diagnostics in `rustc_expand`)
 - #152110 (Fix incorrect RSS on systems with non-4K page size)
 - #152111 (bootstrap: exclude hexagon-unknown-qurt from llvm-libunwind default)
 - #152114 (Convert to inline diagnostics in `rustc_mir_transform`)
 - #152115 (Convert to inline diagnostics in `rustc_metadata`)
 - #152116 (Remove rustdoc GUI flaky test)
 - #152118 (Convert to inline diagnostics in `rustc_codegen_ssa`)
 - #152128 (Adopt matches-logical-or-141497.rs to LLVM HEAD)

Failed merges:

 - #152070 (Convert to inline diagnostics in `rustc_pattern_analysis`)
 - #152106 (Convert to inline diagnostics in `rustc_ast_passes`)
 - #152109 (Convert to inline diagnostics in `rustc_errors`)
 - #152117 (Convert to inline diagnostics in `rustc_trait_selection`)
 - #152119 (Convert to inline diagnostics in `rustc_middle`)
 - #152126 (Convert to inline diagnostics in `rustc_mir_build`)
 - #152131 (Port rustc_no_implicit_bounds attribute to parser.)
rust-bors bot pushed a commit that referenced this pull request Feb 5, 2026
…uwer

Rollup of 18 pull requests

Successful merges:

 - #150379 (Return `ExitCode` from `rustc_driver::main` instead of calling `process::exit`)
 - #152033 (Rename trait `DepNodeParams` to `DepNodeKey`)
 - #152142 (Convert to inline diagnostics in `rustc_hir_typeck`)
 - #152145 (Disable flaky test `oneshot::recv_timeout_before_send`)
 - #152020 (Remove dummy loads on offload codegen)
 - #152023 (Some `rustc_query_system` cleanups)
 - #152068 (Convert to inline diagnostics in `rustc_resolve`)
 - #152081 (Port depgraph testing attributes to parser)
 - #152090 (Port reexport_test_harness_main to attr parser)
 - #152105 (Convert to inline diagnostics in `rustc_ast_lowering`)
 - #152108 (Convert to inline diagnostics in `rustc_expand`)
 - #152110 (Fix incorrect RSS on systems with non-4K page size)
 - #152111 (bootstrap: exclude hexagon-unknown-qurt from llvm-libunwind default)
 - #152114 (Convert to inline diagnostics in `rustc_mir_transform`)
 - #152115 (Convert to inline diagnostics in `rustc_metadata`)
 - #152116 (Remove rustdoc GUI flaky test)
 - #152118 (Convert to inline diagnostics in `rustc_codegen_ssa`)
 - #152128 (Adopt matches-logical-or-141497.rs to LLVM HEAD)

Failed merges:

 - #152070 (Convert to inline diagnostics in `rustc_pattern_analysis`)
 - #152106 (Convert to inline diagnostics in `rustc_ast_passes`)
 - #152109 (Convert to inline diagnostics in `rustc_errors`)
 - #152117 (Convert to inline diagnostics in `rustc_trait_selection`)
 - #152119 (Convert to inline diagnostics in `rustc_middle`)
 - #152126 (Convert to inline diagnostics in `rustc_mir_build`)
 - #152131 (Port rustc_no_implicit_bounds attribute to parser.)
@rust-bors rust-bors bot merged commit b66ead8 into rust-lang:main Feb 5, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 5, 2026
rust-timer added a commit that referenced this pull request Feb 5, 2026
Rollup merge of #152020 - Sa4dUs:offload-remove-dummy-loads, r=ZuseZ4

Remove dummy loads on offload codegen

The current logic generates two dummy loads to prevent some globals from being optimized away. This blocks memtransfer loop hoisting optimizations, so it's time to remove them.

r? @ZuseZ4
@ZuseZ4 ZuseZ4 added the F-gpu_offload `#![feature(gpu_offload)]` label Feb 5, 2026
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Feb 6, 2026
…uwer

Rollup of 18 pull requests

Successful merges:

 - rust-lang/rust#150379 (Return `ExitCode` from `rustc_driver::main` instead of calling `process::exit`)
 - rust-lang/rust#152033 (Rename trait `DepNodeParams` to `DepNodeKey`)
 - rust-lang/rust#152142 (Convert to inline diagnostics in `rustc_hir_typeck`)
 - rust-lang/rust#152145 (Disable flaky test `oneshot::recv_timeout_before_send`)
 - rust-lang/rust#152020 (Remove dummy loads on offload codegen)
 - rust-lang/rust#152023 (Some `rustc_query_system` cleanups)
 - rust-lang/rust#152068 (Convert to inline diagnostics in `rustc_resolve`)
 - rust-lang/rust#152081 (Port depgraph testing attributes to parser)
 - rust-lang/rust#152090 (Port reexport_test_harness_main to attr parser)
 - rust-lang/rust#152105 (Convert to inline diagnostics in `rustc_ast_lowering`)
 - rust-lang/rust#152108 (Convert to inline diagnostics in `rustc_expand`)
 - rust-lang/rust#152110 (Fix incorrect RSS on systems with non-4K page size)
 - rust-lang/rust#152111 (bootstrap: exclude hexagon-unknown-qurt from llvm-libunwind default)
 - rust-lang/rust#152114 (Convert to inline diagnostics in `rustc_mir_transform`)
 - rust-lang/rust#152115 (Convert to inline diagnostics in `rustc_metadata`)
 - rust-lang/rust#152116 (Remove rustdoc GUI flaky test)
 - rust-lang/rust#152118 (Convert to inline diagnostics in `rustc_codegen_ssa`)
 - rust-lang/rust#152128 (Adopt matches-logical-or-141497.rs to LLVM HEAD)

Failed merges:

 - rust-lang/rust#152070 (Convert to inline diagnostics in `rustc_pattern_analysis`)
 - rust-lang/rust#152106 (Convert to inline diagnostics in `rustc_ast_passes`)
 - rust-lang/rust#152109 (Convert to inline diagnostics in `rustc_errors`)
 - rust-lang/rust#152117 (Convert to inline diagnostics in `rustc_trait_selection`)
 - rust-lang/rust#152119 (Convert to inline diagnostics in `rustc_middle`)
 - rust-lang/rust#152126 (Convert to inline diagnostics in `rustc_mir_build`)
 - rust-lang/rust#152131 (Port rustc_no_implicit_bounds attribute to parser.)
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. F-gpu_offload `#![feature(gpu_offload)]` 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.

4 participants