Arg splat experiment - HIR FnSig impl#157811
Conversation
|
HIR ty lowering was modified cc @fmease This PR changes rustc_public cc @oli-obk, @celinval, @ouz-a, @makai410
cc @rust-lang/rust-analyzer
cc @rust-lang/miri |
|
rustbot has assigned @dingxiangfei2009. Use Why was this reviewer chosen?The reviewer was selected based on:
|
| #[type_foldable(identity)] | ||
| splatted: u16, | ||
|
|
||
| _marker: PhantomData<fn() -> I>, |
There was a problem hiding this comment.
These attributes don't seem to be necessary, but should they be kept anyway?
| _marker: PhantomData<fn() -> I>, | |
| #[type_visitable(ignore)] | |
| #[type_foldable(identity)] | |
| _marker: PhantomData<fn() -> I>, |
This comment has been minimized.
This comment has been minimized.
8a2c568 to
d2417dc
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Arg splat experiment - HIR FnSig impl
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (d8eafa9): comparison URL. Overall result: ❌ regressions - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)This perf run didn't have relevant results for this metric. CyclesResults (secondary -12.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.1%, secondary 0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 519.231s -> 521.837s (0.50%) |
|
Reminder, once the PR becomes ready for a review, use |
|
Inlining doesn't work, so we'll need to do the equivalent of #157954 for FnSig: 1 bit in the FnSig to mark any splatting, then look up the actual splatted argument in the attributes or a side-table.
This might require putting the argument attribute in the cross-crate def_id table, like we do for HIR here: https://github.com/rust-lang/rust/pull/157954/changes#diff-ad0c15bbde97a607d4758ec7eaf88248be5d6b8ae084dfc84127f81e3f7a9bb4R1880 This should improve performance by making FnSig smaller, but it won't be as good a #157954, because there are no spare bits in FnSig currently. Edit: another alternative is just using one byte, and rejecting splatting past the 255th argument. |
View all comments
This PR is part of the argument splatting lang experiment, and FFI overloading / C++ interop project goals:
I've split it from #153697 to make reviewing easier, see that PR for more details.
The PR is the HIR-level FnSig implementation of the feature (next PR will be typecheck):
Once this PR merges, I'll rebase #153697.
There aren't any extra tests in this PR, because it doesn't have any externally visible functionality. The visible functionality and tests are in the rest of #153697.