Skip to content

Conversation

@jdonszelmann
Copy link
Contributor

@jdonszelmann jdonszelmann commented Sep 8, 2025

Supersedes #140010
Tracking issue: #125418

Getting started:

#![feature(eii)]

#[eii(eii1)]
pub fn decl1(x: u64) 
// body optional (it's the default)
{
    println!("default {x}");
}

// in another crate, maybe
#[eii1]
pub fn decl2(x: u64) {
    println!("explicit {x}");
}

fn main() {
    decl1(4);
}
  • tiny perf regression, underlying issue makes multiple things in the compiler slow, not just EII, planning to solve those separately.
  • No codegen_gcc support, they don't have bindings for weak symbols yet but could
  • No windows support yet for weak definitions

This PR merges the implementation of EII for just llvm + not windows, doesn't yet contain like a new panic handler implementation or alloc handler. With this implementation, it would support implementing the panic handler in terms of EII already since it requires no default implementation so no weak symbols

The PR has been open in various forms for about a year now, but I feel that having some implementation merged to build upon

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) 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-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 8, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@jdonszelmann
Copy link
Contributor Author

@bors2 try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Sep 9, 2025
[DONT MERGE] externally implementable items
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 9, 2025
@rust-bors
Copy link

rust-bors bot commented Sep 9, 2025

☀️ Try build successful (CI)
Build commit: d5a6633 (d5a66337e06d3b77a1ab8f6793055535195c3ae9, parent: 364da5d88d772fa40fb20353443595385443ac25)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d5a6633): comparison URL.

Overall result: ❌ regressions - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@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.3% [0.1%, 1.5%] 19
Regressions ❌
(secondary)
0.4% [0.1%, 1.0%] 44
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.0% [-0.1%, -0.0%] 4
All ❌✅ (primary) 0.3% [0.1%, 1.5%] 19

Max RSS (memory usage)

Results (primary 1.7%, secondary 3.9%)

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

mean range count
Regressions ❌
(primary)
1.7% [0.6%, 2.3%] 6
Regressions ❌
(secondary)
4.7% [1.1%, 11.2%] 16
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.1% [-2.9%, -1.2%] 2
All ❌✅ (primary) 1.7% [0.6%, 2.3%] 6

Cycles

Results (primary 3.1%, secondary -1.3%)

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

mean range count
Regressions ❌
(primary)
3.1% [3.1%, 3.1%] 1
Regressions ❌
(secondary)
3.2% [2.5%, 3.6%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.8% [-4.1%, -2.0%] 9
All ❌✅ (primary) 3.1% [3.1%, 3.1%] 1

Binary size

Results (primary 0.0%, secondary 0.1%)

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

mean range count
Regressions ❌
(primary)
0.0% [0.0%, 0.1%] 93
Regressions ❌
(secondary)
0.1% [0.0%, 0.3%] 61
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [0.0%, 0.1%] 93

Bootstrap: 468.052s -> 471.14s (0.66%)
Artifact size: 387.52 MiB -> 390.25 MiB (0.71%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Sep 9, 2025
@jdonszelmann
Copy link
Contributor Author

Well, shit. I think I know some fixes but I hoped this wouldn't happen

@bors
Copy link
Collaborator

bors commented Dec 12, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 12, 2025
@jdonszelmann
Copy link
Contributor Author

jdonszelmann commented Dec 13, 2025

@bors try jobs auto

let's do a full ci build before attempting the merge. I think this is all, just making sure :

@rust-bors
Copy link

rust-bors bot commented Dec 13, 2025

Unknown argument "jobs:". Run @bors2 help to see available commands.

@rust-lang rust-lang deleted a comment from rust-bors bot Dec 13, 2025
@jdonszelmann
Copy link
Contributor Author

@bors try jobs=auto

rust-bors bot added a commit that referenced this pull request Dec 13, 2025
Externally implementable items

try-job: auto
@rust-bors

This comment has been minimized.

@jdonszelmann
Copy link
Contributor Author

ah, there we go...

@rust-bors

This comment was marked as outdated.

@rust-log-analyzer

This comment was marked as off-topic.

@jdonszelmann
Copy link
Contributor Author

nope, still not. well let's at least test mingw

@bors try jobs=x86_64-mingw-1

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Dec 13, 2025
Externally implementable items

try-job: x86_64-mingw-1
@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Dec 13, 2025

☀️ Try build successful (CI)
Build commit: ac3a540 (ac3a540eefa022a9ca61a06b34b6511a694457c8, parent: eb171a227f9e5de5d376b6edb56b174bc8235fb3)

@jdonszelmann
Copy link
Contributor Author

Well, fixed mingw, just a warning remaining...

@jdonszelmann
Copy link
Contributor Author

ah forgot to bless a test

@jdonszelmann
Copy link
Contributor Author

@rustbot review
let's try once more... nothing really changed except that I now explicitly exclude windows targets. I knew windows didn't work, but somehow I never actually remembered to exclude windows from running tests...

windows now passes (see try build). I guess it's time for another attempt at big ci

@jdonszelmann
Copy link
Contributor Author

@bors r=lcnr,oli-obk

@bors
Copy link
Collaborator

bors commented Dec 13, 2025

📌 Commit 065e4c1 has been approved by lcnr,oli-obk

It is now in the queue for this repository.

@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-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 13, 2025
@bors
Copy link
Collaborator

bors commented Dec 14, 2025

⌛ Testing commit 065e4c1 with merge 3f4dc1e...

bors added a commit that referenced this pull request Dec 14, 2025
Externally implementable items

Supersedes #140010
Tracking issue: #125418

Getting started:

```rust
#![feature(eii)]

#[eii(eii1)]
pub fn decl1(x: u64)
// body optional (it's the default)
{
    println!("default {x}");
}

// in another crate, maybe
#[eii1]
pub fn decl2(x: u64) {
    println!("explicit {x}");
}

fn main() {
    decl1(4);
}
```

- tiny perf regression, underlying issue makes multiple things in the compiler slow, not just EII, planning to solve those separately.
- No codegen_gcc support, they don't have bindings for weak symbols yet but could
- No windows support yet for weak definitions

This PR merges the implementation of EII for just llvm + not windows, doesn't yet contain like a new panic handler implementation or alloc handler. With this implementation, it would support implementing the panic handler in terms of EII already since it requires no default implementation so no weak symbols

The PR has been open in various forms for about a year now, but I feel that having some implementation merged to build upon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. perf-regression Performance regression. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.