Add type-check to offload intrinisc calls - #158693
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
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 r+ rollup |
Add type-check to offload intrinisc calls As discussed in [zulip](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/.E2.9C.94.20Inferring.20return.20type.20from.20a.20function.20passed.20to.20an.20intr.2E.2E.2E), in order to support sufficiently generic kernel functions, we need to move away from checking arguments and return types solely via traits on the intrinsic declaration. Instead, these validation checks are now performed during the type-checking phase. r? @ZuseZ4
…uwer Rollup of 18 pull requests Successful merges: - #159898 (Add intrinsic-test alias and set sample rate) - #158247 (hermit/fs: Return `unsupported()` instead of `from_raw_os_error(22)`) - #158649 (Hermit: fix `readdir()` ) - #158693 (Add type-check to offload intrinisc calls) - #159049 (Avoid ICE in From/TryFrom cast suggestion when encountering HRTBs) - #159411 ([rustdoc] Correctly handle output options with --show-coverage) - #160053 (test: add test suite for the 85681 issue) - #160087 (Add regression test for nested associated-type projection ICE) - #160090 (rustc_resolve: Further reduce mutability in resolver) - #160099 (Resolver: split module resolutions into local and external resolutions) - #160106 (Add suggestions for `must_implement_one_of`) - #160117 (Remove unnecessary format usage) - #160134 (Work around Wine bug 60084 by calling WSAStartup at most once) - #160139 (iter: specialize Take::count using advance_by) - #160142 (bootstrap: remove use-lld config alias) - #160148 (Rename `errors.rs` file to `diagnostics.rs` (15/N)) - #160151 (Mark a doctest as requiring unwinding) - #160166 (Use correct feature gates for `f16`/`f128` `From` impls)
Rollup of 20 pull requests Successful merges: - #157669 (cfi: add diag mode support) - #158247 (hermit/fs: Return `unsupported()` instead of `from_raw_os_error(22)`) - #158649 (Hermit: fix `readdir()` ) - #158693 (Add type-check to offload intrinisc calls) - #159049 (Avoid ICE in From/TryFrom cast suggestion when encountering HRTBs) - #159411 ([rustdoc] Correctly handle output options with --show-coverage) - #160053 (test: add test suite for the 85681 issue) - #160087 (Add regression test for nested associated-type projection ICE) - #160090 (rustc_resolve: Further reduce mutability in resolver) - #160099 (Resolver: split module resolutions into local and external resolutions) - #160101 (Add missing `needs-unwind` annotation to `add-spawn-hook-reentrancy-159923` test) - #160106 (Add suggestions for `must_implement_one_of`) - #160117 (Remove unnecessary format usage) - #160134 (Work around Wine bug 60084 by calling WSAStartup at most once) - #160139 (iter: specialize Take::count using advance_by) - #160142 (bootstrap: remove use-lld config alias) - #160148 (Rename `errors.rs` file to `diagnostics.rs` (15/N)) - #160151 (Mark a doctest as requiring unwinding) - #160166 (Use correct feature gates for `f16`/`f128` `From` impls) - #160178 (Remove unused `va_start` intrinsic)
Rollup of 20 pull requests Successful merges: - #157669 (cfi: add diag mode support) - #158247 (hermit/fs: Return `unsupported()` instead of `from_raw_os_error(22)`) - #158649 (Hermit: fix `readdir()` ) - #158693 (Add type-check to offload intrinisc calls) - #159049 (Avoid ICE in From/TryFrom cast suggestion when encountering HRTBs) - #159411 ([rustdoc] Correctly handle output options with --show-coverage) - #160053 (test: add test suite for the 85681 issue) - #160087 (Add regression test for nested associated-type projection ICE) - #160090 (rustc_resolve: Further reduce mutability in resolver) - #160099 (Resolver: split module resolutions into local and external resolutions) - #160101 (Add missing `needs-unwind` annotation to `add-spawn-hook-reentrancy-159923` test) - #160106 (Add suggestions for `must_implement_one_of`) - #160117 (Remove unnecessary format usage) - #160134 (Work around Wine bug 60084 by calling WSAStartup at most once) - #160139 (iter: specialize Take::count using advance_by) - #160142 (bootstrap: remove use-lld config alias) - #160148 (Rename `errors.rs` file to `diagnostics.rs` (15/N)) - #160151 (Mark a doctest as requiring unwinding) - #160166 (Use correct feature gates for `f16`/`f128` `From` impls) - #160178 (Remove unused `va_start` intrinsic)
Rollup merge of #158693 - Sa4dUs:offload-typeck, r=ZuseZ4 Add type-check to offload intrinisc calls As discussed in [zulip](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/.E2.9C.94.20Inferring.20return.20type.20from.20a.20function.20passed.20to.20an.20intr.2E.2E.2E), in order to support sufficiently generic kernel functions, we need to move away from checking arguments and return types solely via traits on the intrinsic declaration. Instead, these validation checks are now performed during the type-checking phase. r? @ZuseZ4
|
@rust-timer build 13870f3 |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (13870f3): 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 rustc-perf Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -0.2%, secondary 0.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -0.3%, secondary -1.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 491.471s -> 491.257s (-0.04%) |
|
A little bit of extra work is expected and ok, but 0.3% still feels a tad higher than what I'd have expected just from checking functions for whether they have an attribute applied to them. @Sa4dUs can you check if there's any work that we should gate better on the offload flags? @rustbot perf-regression |
As discussed in zulip, in order to support sufficiently generic kernel functions, we need to move away from checking arguments and return types solely via traits on the intrinsic declaration. Instead, these validation checks are now performed during the type-checking phase.
r? @ZuseZ4