Skip to content

Use LLVM option -disable-auto-upgrade-debug-info - #165836

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
nnethercote:disable-auto-upgrade-debug-info
Nov 27, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
nnethercote:disable-auto-upgrade-debug-info

Conversation

@nnethercote

@nnethercote nnethercote commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

It's a compile-time win for builds involving debuginfo and LTO, such as a release build with debuginfo enabled. (ripgrep and bors are two examples of programs that use that configuration.)

r? @nikic

@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 Nov 12, 2026
@nnethercote

Copy link
Copy Markdown
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 12, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 12, 2026
…r=<try>

Use LLVM option `-disable-auto-upgrade-debug-info`
@rust-bors

This comment has been minimized.

@rust-bors

rust-bors Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 4eb0691 (4eb0691e56d690edd07b7bd717516e99a5ee8fec)
Base parent: ee8268e (ee8268e23d0e2e308b52e4f63df69afb69bc61a4)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown

Finished benchmarking commit (4eb0691): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@bors rollup=iffy rustc-perf
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.8% [-1.9%, -1.6%] 3
Improvements ✅
(secondary)
-1.8% [-1.9%, -1.6%] 3
All ❌✅ (primary) -1.8% [-1.9%, -1.6%] 3

Max RSS (memory usage)

Results (primary 2.8%, secondary -3.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.8% [2.1%, 3.4%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.7% [-3.7%, -3.7%] 1
All ❌✅ (primary) 2.8% [2.1%, 3.4%] 2

Cycles

Results (primary -4.1%, secondary -1.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-4.1% [-5.0%, -3.5%] 6
Improvements ✅
(secondary)
-1.7% [-1.7%, -1.7%] 1
All ❌✅ (primary) -4.1% [-5.0%, -3.5%] 6

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 484.606s -> 482.646s (-0.40%)
Artifact size: 406.06 MiB -> 405.94 MiB (-0.03%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 12, 2026
@Kivooeo

Kivooeo commented Nov 12, 2026

Copy link
Copy Markdown
Member

wow, it's a huge improvement!

@nnethercote

Copy link
Copy Markdown
Contributor Author

ripgrep is the only benchmark that sees improvements because it's the only one where release builds enable debuginfo.

@nikic: what do you think of this change? Rust was specifically mentioned as a motivation when this flag was introduced. AIUI, disabling the auto upgrade would remove a level of protection against malformed debuginfo, which might be caused by compiler bugs.

@nikic nikic left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should be fine for our usage.

View changes since this review

@nnethercote
nnethercote force-pushed the disable-auto-upgrade-debug-info branch from 788e0d6 to 40a34d1 Compare November 27, 2026 03:24
@nnethercote
nnethercote marked this pull request as ready for review November 27, 2026 03:25
@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 Nov 27, 2026
@nnethercote

Copy link
Copy Markdown
Contributor Author

I have added a detailed comment that explains how this flag works, why it's ok to use for Rust, and the cases where it makes a difference. Because all of that is not obvious!

//
// Note that Rust was a motivating example in the design of this flag. See
// https://reviews.llvm.org/D143229.
add("-disable-auto-upgrade-debug-info", false);

@nikic nikic Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you please use -auto-upgrade-debug-info=false instead on get_version() >= (24, 0, 0)? The option has been renamed, and while the alias -disable-auto-upgrade-debug-info will still work for a time, we should use the new name.

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok

Comment on lines +155 to +158
// The LTO + debuginfo combination doesn't occur in the standard Rust profiles. It requires
// e.g. debuginfo to be enabled in a release build. (Release builds use thin-local LTO when
// more than one CGU is present.) But when that combination occurs this is a small
// compile-time win. The protection against malformed bitcode is also eliminated in that

@nikic nikic Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
// The LTO + debuginfo combination doesn't occur in the standard Rust profiles. It requires
// e.g. debuginfo to be enabled in a release build. (Release builds use thin-local LTO when
// more than one CGU is present.) But when that combination occurs this is a small
// compile-time win. The protection against malformed bitcode is also eliminated in that
// This is a small compile-time win for release+debuginfo configurations.
// The protection against malformed bitcode is also eliminated in that

I feel like this is spelling out things that are obvious / not really relevant, but I won't insist...

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fair enough

It's a compile-time win for builds involving debuginfo and LTO, such as
a release build with debuginfo enabled. (`ripgrep` and `bors` are two
examples of programs that use that configuration.)
@nnethercote
nnethercote force-pushed the disable-auto-upgrade-debug-info branch from 40a34d1 to 78d4277 Compare November 27, 2026 09:33
@nnethercote

Copy link
Copy Markdown
Contributor Author

I addressed the two comments.

@nikic

nikic commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

@bors r+

@rust-bors

rust-bors Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 78d4277 has been tentatively approved by nikic

It will be put into the queue for this repository once PR CI succeeds.

@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 Nov 27, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 27, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #165836 (Use LLVM option `-disable-auto-upgrade-debug-info`)
 - #164783 (callconv: mips64: match gcc for "alignment" of 16-byte-aligned ZSTs)
 - #166634 (do not lint `drop_bounds`, `dyn_drop`, `trivial_bounds` and const param names on items from external macros)
 - #166649 (abby dsl: minor refactor/cleanup)
 - #164628 (callconv: mips64: handle repr(transparent))
 - #166387 (Remove diagnostics import list)
 - #166564 (miri: support statx syscall)
 - #166583 (abby dsl tests: the passing test should check-pass)
 - #166595 (specify target CPUs in 'powerpc-types.rs' assembly test)
 - #166640 (compiletest: Use an explicit argfile instead of ArgFileCommand)
 - #166646 (Fix reversed argument counts in Fn trait mismatch note)
rust-bors Bot pushed a commit that referenced this pull request Nov 27, 2026
Rollup merge of #165836 - nnethercote:disable-auto-upgrade-debug-info, r=nikic

Use LLVM option `-disable-auto-upgrade-debug-info`

It's a compile-time win for builds involving debuginfo and LTO, such as a release build with debuginfo enabled. (`ripgrep` and `bors` are two examples of programs that use that configuration.)

r? @nikic
@rust-bors
rust-bors Bot merged commit 6cf8e67 into rust-lang:main Nov 27, 2026
14 checks passed
@rustbot rustbot added this to the 1.102.0 milestone Nov 27, 2026
@rust-timer

Copy link
Copy Markdown

Note

This PR was benchmarked as part of triage of its containing rollup: triage URL.

Finished benchmarking commit (d58ffad): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.8% [-2.0%, -1.6%] 3
Improvements ✅
(secondary)
-1.8% [-2.0%, -1.6%] 3
All ❌✅ (primary) -1.8% [-2.0%, -1.6%] 3

Max RSS (memory usage)

Results (primary 2.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.5% [2.5%, 2.5%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.5% [2.5%, 2.5%] 1

Cycles

This perf run didn't have relevant results for this metric.

Binary size

This perf run didn't have relevant results for this metric.

Artifact size: 405.64 MiB -> 405.59 MiB (-0.01%)

mehmettoplu-rs pushed a commit to mehmettoplu-rs/miri that referenced this pull request Nov 28, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#165836 (Use LLVM option `-disable-auto-upgrade-debug-info`)
 - rust-lang/rust#164783 (callconv: mips64: match gcc for "alignment" of 16-byte-aligned ZSTs)
 - rust-lang/rust#166634 (do not lint `drop_bounds`, `dyn_drop`, `trivial_bounds` and const param names on items from external macros)
 - rust-lang/rust#166649 (abby dsl: minor refactor/cleanup)
 - rust-lang/rust#164628 (callconv: mips64: handle repr(transparent))
 - rust-lang/rust#166387 (Remove diagnostics import list)
 - rust-lang/rust#166564 (miri: support statx syscall)
 - rust-lang/rust#166583 (abby dsl tests: the passing test should check-pass)
 - rust-lang/rust#166595 (specify target CPUs in 'powerpc-types.rs' assembly test)
 - rust-lang/rust#166640 (compiletest: Use an explicit argfile instead of ArgFileCommand)
 - rust-lang/rust#166646 (Fix reversed argument counts in Fn trait mismatch note)
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.

5 participants