Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reapply cg_llvm: fewer_names in uncached_llvm_type #94107

Merged
merged 1 commit into from
Feb 24, 2022

Conversation

tmiasko
Copy link
Contributor

@tmiasko tmiasko commented Feb 17, 2022

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Feb 17, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 17, 2022
@tmiasko
Copy link
Contributor Author

tmiasko commented Feb 17, 2022

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 17, 2022
@bors
Copy link
Contributor

bors commented Feb 17, 2022

⌛ Trying commit ed18309adaeeeab3a85a45b74d2627bfefbb719d with merge f12f59345fd5621cd34aea2915fff165082cd5d0...

@bors
Copy link
Contributor

bors commented Feb 18, 2022

☀️ Try build successful - checks-actions
Build commit: f12f59345fd5621cd34aea2915fff165082cd5d0 (f12f59345fd5621cd34aea2915fff165082cd5d0)

@rust-timer
Copy link
Collaborator

Queued f12f59345fd5621cd34aea2915fff165082cd5d0 with parent 30b3f35, future comparison URL.

@erikdesjardins
Copy link
Contributor

Thanks for bringing this back!

For posterity, previous attempts: #76030, #88449

This should now be viable to merge because the LLVM issue discovered during the last attempt (#88449 (comment)) was fixed in LLVM 14 (#93577).

Copy link
Member

@davidtwco davidtwco left a comment

Choose a reason for hiding this comment

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

Thanks for reviving this. You don't need to, but I'd appreciate it if you added myself and @erikdesjardins as co-authors to the commit.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f12f59345fd5621cd34aea2915fff165082cd5d0): comparison url.

Summary: This benchmark run shows 63 relevant improvements 🎉 but 14 relevant regressions 😿 to instruction counts.

  • Average relevant regression: 0.3%
  • Average relevant improvement: -7.4%
  • Largest improvement in instruction counts: -61.3% on incr-patched: println builds of webrender-wrench opt
  • Largest regression in instruction counts: 0.3% on full builds of regression-31157 doc

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf +perf-regression

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Feb 18, 2022
@marmeladema
Copy link
Contributor

I rerun my tests and the problem appears indeed to have been fixed:
Against stable

$ cargo run --release
    Finished release [optimized + debuginfo] target(s) in 0.29s
     Running `target/release/bitvec-perf-regression`
instructions:u = 871040161

Against f12f59345fd5621cd34aea2915fff165082cd5d0

$ cargo +f12f59345fd5621cd34aea2915fff165082cd5d0 run --release
    Finished release [optimized + debuginfo] target(s) in 0.01s
     Running `target/release/bitvec-perf-regression`
instructions:u = 870400148

Since the problem has been fixed by LLVM 14 should this change be gated by the LLVM version or postponed until LLVM 14 becomes the oldest supported version? Otherwise people compiling rustc manually with LLVM version < 14 will hit the performance regression right?

@tmiasko tmiasko 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 Feb 19, 2022
compiler/rustc_codegen_llvm/src/type_of.rs Outdated Show resolved Hide resolved
compiler/rustc_codegen_llvm/src/type_of.rs Outdated Show resolved Hide resolved
@tmiasko
Copy link
Contributor Author

tmiasko commented Feb 19, 2022

  • Gated the use of unnamed types on LLVM 14 version check.
  • Dropped test changes src/test/ui/const-generics/issues/issue-75763.rs. This pull request merely hides the bug, and I plan to fix the underlying issue separately.

I would rather avoid including this in next beta, and if I am reading Rust forge correctly, the next promotion is on Monday, so I am marking this as blocked at least until then.

@tmiasko tmiasko added S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 19, 2022
@bors
Copy link
Contributor

bors commented Feb 20, 2022

☔ The latest upstream changes (presumably #94062) made this pull request unmergeable. Please resolve the merge conflicts.

@davidtwco
Copy link
Member

r=me when you're ready to land this

Co-authored-by: Erik Desjardins <erikdesjardins@users.noreply.github.com>
Co-authored-by: Tomasz Miąsko <tomasz.miasko@gmail.com>
@tmiasko
Copy link
Contributor Author

tmiasko commented Feb 22, 2022

@bors r=davidtwco

@bors
Copy link
Contributor

bors commented Feb 22, 2022

📌 Commit 4e41a46 has been approved by davidtwco

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. labels Feb 22, 2022
@bors
Copy link
Contributor

bors commented Feb 24, 2022

⌛ Testing commit 4e41a46 with merge e780264...

@bors
Copy link
Contributor

bors commented Feb 24, 2022

☀️ Test successful - checks-actions
Approved by: davidtwco
Pushing e780264 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 24, 2022
@bors bors merged commit e780264 into rust-lang:master Feb 24, 2022
@rustbot rustbot added this to the 1.61.0 milestone Feb 24, 2022
@tmiasko tmiasko deleted the fewer-types branch February 24, 2022 07:19
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e780264): comparison url.

Summary: This benchmark run shows 59 relevant improvements 🎉 to instruction counts.

  • Average relevant improvement: -7.8%
  • Largest improvement in instruction counts: -61.2% on incr-patched: println builds of webrender-wrench opt

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

@rustbot rustbot removed the perf-regression Performance regression. label Feb 24, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 4, 2023
cg_llvm: stop identifying ADTs in LLVM IR

This is an extension of rust-lang#94107. It may be a minor perf win.

Fixes rust-lang#96242.

Now that we use opaque pointers, ADTs can no longer be recursive, so we
do not need to name them. Previously, this would be necessary if you had
a struct like

```rs
struct Foo(Box<Foo>, u64, u64);
```

which would be represented with something like

```ll
%Foo = type { %Foo*, i64, i64 }
```

which is now just

```ll
{ ptr, i64, i64 }
```

r? `@tmiasko`
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Aug 5, 2023
cg_llvm: stop identifying ADTs in LLVM IR

This is an extension of rust-lang/rust#94107. It may be a minor perf win.

Fixes #96242.

Now that we use opaque pointers, ADTs can no longer be recursive, so we
do not need to name them. Previously, this would be necessary if you had
a struct like

```rs
struct Foo(Box<Foo>, u64, u64);
```

which would be represented with something like

```ll
%Foo = type { %Foo*, i64, i64 }
```

which is now just

```ll
{ ptr, i64, i64 }
```

r? `@tmiasko`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

9 participants