Skip to content

Add -Z large-data-threshold#150780

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
fzakaria:fzakaria/section-threshold
Jan 23, 2026
Merged

Add -Z large-data-threshold#150780
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
fzakaria:fzakaria/section-threshold

Conversation

@fzakaria
Copy link
Contributor

@fzakaria fzakaria commented Jan 7, 2026

This flag allows specifying the threshold size for placing static data in large data sections when using the medium code model on x86-64.

When using -Ccode-model=medium, data smaller than this threshold uses RIP-relative addressing (32-bit offsets), while larger data uses absolute 64-bit addressing. This allows the compiler to generate more efficient code for smaller data while still supporting data larger than 2GB.

This mirrors the -mlarge-data-threshold flag available in GCC and Clang. The default threshold is 65536 bytes (64KB) if not specified, matching LLVM's default behavior.

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

rustbot commented Jan 7, 2026

r? @jackh726

rustbot has assigned @jackh726.
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

@fzakaria fzakaria force-pushed the fzakaria/section-threshold branch from e5a0509 to 0b694e4 Compare January 7, 2026 19:45
This flag allows specifying the threshold size for placing static data
in large data sections when using the medium code model on x86-64.

When using -Ccode-model=medium, data smaller than this threshold uses
RIP-relative addressing (32-bit offsets), while larger data uses
absolute 64-bit addressing. This allows the compiler to generate more
efficient code for smaller data while still supporting data larger than
2GB.

This mirrors the -mlarge-data-threshold flag available in GCC and Clang.
The default threshold is 65536 bytes (64KB) if not specified, matching
LLVM's default behavior.
@fzakaria fzakaria force-pushed the fzakaria/section-threshold branch from 0b694e4 to 93f2e80 Compare January 7, 2026 19:57
@jackh726
Copy link
Member

@bors r+

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 23, 2026

📌 Commit 93f2e80 has been approved by jackh726

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 23, 2026
rust-bors bot pushed a commit that referenced this pull request Jan 23, 2026
…uwer

Rollup of 5 pull requests

Successful merges:

 - #149639 (inline constant localized typeck constraint computation)
 - #150780 (Add -Z large-data-threshold)
 - #151520 (Rename `HandleCycleError` to `CycleErrorHandling`)
 - #151525 (update enzyme, includes an extra patch to fix MacOS builds in CI)
 - #151527 (Clean up or resolve cfg-related instances of `FIXME(f16_f128)`)

r? @ghost
@rust-bors rust-bors bot merged commit dec8d6e into rust-lang:main Jan 23, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Jan 23, 2026
rust-timer added a commit that referenced this pull request Jan 23, 2026
Rollup merge of #150780 - fzakaria:fzakaria/section-threshold, r=jackh726

Add -Z large-data-threshold

This flag allows specifying the threshold size for placing static data in large data sections when using the medium code model on x86-64.

When using -Ccode-model=medium, data smaller than this threshold uses RIP-relative addressing (32-bit offsets), while larger data uses absolute 64-bit addressing. This allows the compiler to generate more efficient code for smaller data while still supporting data larger than 2GB.

This mirrors the -mlarge-data-threshold flag available in GCC and Clang. The default threshold is 65536 bytes (64KB) if not specified, matching LLVM's default behavior.
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. 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.

3 participants