Repository navigation
Avoid unnecessary MIR traversals in CheckPackedRef lint - #165342
Conversation
instead tracking it through the whole traversal even if the lint is never fired
We only need to traverse CFG for this lint, so we can iterate over basic blocks directly.
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
|
r? @JohnTitor rustbot has assigned @JohnTitor. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Let's try whether this has some visible impact. @bors try @rust-timer queue profiles=Check |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Avoid unnecessary MIR traversals in CheckPackedRef lint
This comment has been minimized.
This comment has been minimized.
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
Finished benchmarking commit (0a5d231): comparison URL. Overall result: no relevant changes - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)This perf run didn't have relevant results for this metric. CyclesResults (primary -2.6%)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: 488.585s -> 488.643s (0.01%) |
|
❌ Cannot approve commit edf718d, because CI currently fails on this PR. Use |
|
@bors r+ force |
…=JohnTitor Avoid unnecessary MIR traversals in CheckPackedRef lint I noticed there's some inlining noise happening around this lint - `CheckPackedRef::run_lint` may or may not get inlined into the parent, and that decision seems to flip based on unrelated changes. I decided to look into it and found two simplifications, more details in the individual commits. I kinda hope that eliminating all the unnecessary visitor traversal will make the lint more straightforward to optimize and maybe reduce some of the noise we get from it in our benchmarks, but that is not straightforward to verify.
…uwer Rollup of 20 pull requests Successful merges: - #149245 (Make inline attributes apply to the generated `poll` in async fn) - #163495 (Parallelize AST -> HIR lowering) - #164304 ([perf] Reuse CanonicalVarKinds if no new variables were added) - #165109 (Avoid building a region map when erasing bound regions) - #163393 (std: Use getexecpath() for current_exe() on OpenBSD) - #163625 (Add a lint helper attribute namespace ) - #164414 (Add `let_underscore_drop_guard` lint.) - #165342 (Avoid unnecessary MIR traversals in CheckPackedRef lint) - #165351 (delegation: insert probing adjustments before args check adjustments) - #165358 (Reenable some cg_gcc tests that were disabled) - #165377 (Make `no_implicit_prelude` not suppress tool attributes) - #165397 (Add codegen test for unused match arms removed after inlining) - #165398 (Rework parallel reproducibility tests) - #162608 (Avoid oscillating line wrapping due to symbol indices) - #164241 (make the safety documentation consistent in Ptr module) - #165029 (Use `MalformedLintAttributeInput` in more places) - #165203 (AIX: Implement TLS destructor guard in std and update dynamic-loading-cdylib test) - #165230 (Fix rigidity assertion ICE) - #165293 (unstable-book: update default-visibility.md to link to tracking issue) - #165374 (Refactorings in preparation for the move trait)
…=JohnTitor Avoid unnecessary MIR traversals in CheckPackedRef lint I noticed there's some inlining noise happening around this lint - `CheckPackedRef::run_lint` may or may not get inlined into the parent, and that decision seems to flip based on unrelated changes. I decided to look into it and found two simplifications, more details in the individual commits. I kinda hope that eliminating all the unnecessary visitor traversal will make the lint more straightforward to optimize and maybe reduce some of the noise we get from it in our benchmarks, but that is not straightforward to verify.
…uwer Rollup of 21 pull requests Successful merges: - #165416 (fix unsoundness when compiling `[diverging_const; 0]`) - #149245 (Make inline attributes apply to the generated `poll` in async fn) - #163495 (Parallelize AST -> HIR lowering) - #164304 ([perf] Reuse CanonicalVarKinds if no new variables were added) - #165109 (Avoid building a region map when erasing bound regions) - #163393 (std: Use getexecpath() for current_exe() on OpenBSD) - #163625 (Add a lint helper attribute namespace ) - #164414 (Add `let_underscore_drop_guard` lint.) - #165342 (Avoid unnecessary MIR traversals in CheckPackedRef lint) - #165351 (delegation: insert probing adjustments before args check adjustments) - #165358 (Reenable some cg_gcc tests that were disabled) - #165377 (Make `no_implicit_prelude` not suppress tool attributes) - #165397 (Add codegen test for unused match arms removed after inlining) - #165398 (Rework parallel reproducibility tests) - #162608 (Avoid oscillating line wrapping due to symbol indices) - #164241 (make the safety documentation consistent in Ptr module) - #165029 (Use `MalformedLintAttributeInput` in more places) - #165203 (AIX: Implement TLS destructor guard in std and update dynamic-loading-cdylib test) - #165230 (Fix rigidity assertion ICE) - #165293 (unstable-book: update default-visibility.md to link to tracking issue) - #165374 (Refactorings in preparation for the move trait)
…=JohnTitor Avoid unnecessary MIR traversals in CheckPackedRef lint I noticed there's some inlining noise happening around this lint - `CheckPackedRef::run_lint` may or may not get inlined into the parent, and that decision seems to flip based on unrelated changes. I decided to look into it and found two simplifications, more details in the individual commits. I kinda hope that eliminating all the unnecessary visitor traversal will make the lint more straightforward to optimize and maybe reduce some of the noise we get from it in our benchmarks, but that is not straightforward to verify.
…uwer Rollup of 20 pull requests Successful merges: - #149245 (Make inline attributes apply to the generated `poll` in async fn) - #163495 (Parallelize AST -> HIR lowering) - #164304 ([perf] Reuse CanonicalVarKinds if no new variables were added) - #165109 (Avoid building a region map when erasing bound regions) - #163393 (std: Use getexecpath() for current_exe() on OpenBSD) - #163625 (Add a lint helper attribute namespace ) - #164414 (Add `let_underscore_drop_guard` lint.) - #165342 (Avoid unnecessary MIR traversals in CheckPackedRef lint) - #165351 (delegation: insert probing adjustments before args check adjustments) - #165358 (Reenable some cg_gcc tests that were disabled) - #165377 (Make `no_implicit_prelude` not suppress tool attributes) - #165397 (Add codegen test for unused match arms removed after inlining) - #165398 (Rework parallel reproducibility tests) - #162608 (Avoid oscillating line wrapping due to symbol indices) - #164241 (make the safety documentation consistent in Ptr module) - #165029 (Use `MalformedLintAttributeInput` in more places) - #165203 (AIX: Implement TLS destructor guard in std and update dynamic-loading-cdylib test) - #165230 (Fix rigidity assertion ICE) - #165293 (unstable-book: update default-visibility.md to link to tracking issue) - #165374 (Refactorings in preparation for the move trait)
…uwer Rollup of 22 pull requests Successful merges: - #149245 (Make inline attributes apply to the generated `poll` in async fn) - #164304 ([perf] Reuse CanonicalVarKinds if no new variables were added) - #165109 (Avoid building a region map when erasing bound regions) - #163393 (std: Use getexecpath() for current_exe() on OpenBSD) - #163625 (Add a lint helper attribute namespace ) - #164414 (Add `let_underscore_drop_guard` lint.) - #165342 (Avoid unnecessary MIR traversals in CheckPackedRef lint) - #165351 (delegation: insert probing adjustments before args check adjustments) - #165358 (Reenable some cg_gcc tests that were disabled) - #165377 (Make `no_implicit_prelude` not suppress tool attributes) - #165397 (Add codegen test for unused match arms removed after inlining) - #165398 (Rework parallel reproducibility tests) - #162232 (Replace `builtin #` with `k#`) - #162608 (Avoid oscillating line wrapping due to symbol indices) - #164241 (make the safety documentation consistent in Ptr module) - #164258 (clarify when `Vec::into_boxed_slice()` is in-place) - #165029 (Use `MalformedLintAttributeInput` in more places) - #165203 (AIX: Implement TLS destructor guard in std and update dynamic-loading-cdylib test) - #165230 (Fix rigidity assertion ICE) - #165293 (unstable-book: update default-visibility.md to link to tracking issue) - #165374 (Refactorings in preparation for the move trait) - #165421 (another Enzyme submodule update for nested autodiff)
Rollup merge of #165342 - panstromek:check-packed-ref-cln, r=JohnTitor Avoid unnecessary MIR traversals in CheckPackedRef lint I noticed there's some inlining noise happening around this lint - `CheckPackedRef::run_lint` may or may not get inlined into the parent, and that decision seems to flip based on unrelated changes. I decided to look into it and found two simplifications, more details in the individual commits. I kinda hope that eliminating all the unnecessary visitor traversal will make the lint more straightforward to optimize and maybe reduce some of the noise we get from it in our benchmarks, but that is not straightforward to verify.
…uwer Rollup of 22 pull requests Successful merges: - rust-lang/rust#149245 (Make inline attributes apply to the generated `poll` in async fn) - rust-lang/rust#164304 ([perf] Reuse CanonicalVarKinds if no new variables were added) - rust-lang/rust#165109 (Avoid building a region map when erasing bound regions) - rust-lang/rust#163393 (std: Use getexecpath() for current_exe() on OpenBSD) - rust-lang/rust#163625 (Add a lint helper attribute namespace ) - rust-lang/rust#164414 (Add `let_underscore_drop_guard` lint.) - rust-lang/rust#165342 (Avoid unnecessary MIR traversals in CheckPackedRef lint) - rust-lang/rust#165351 (delegation: insert probing adjustments before args check adjustments) - rust-lang/rust#165358 (Reenable some cg_gcc tests that were disabled) - rust-lang/rust#165377 (Make `no_implicit_prelude` not suppress tool attributes) - rust-lang/rust#165397 (Add codegen test for unused match arms removed after inlining) - rust-lang/rust#165398 (Rework parallel reproducibility tests) - rust-lang/rust#162232 (Replace `builtin #` with `k#`) - rust-lang/rust#162608 (Avoid oscillating line wrapping due to symbol indices) - rust-lang/rust#164241 (make the safety documentation consistent in Ptr module) - rust-lang/rust#164258 (clarify when `Vec::into_boxed_slice()` is in-place) - rust-lang/rust#165029 (Use `MalformedLintAttributeInput` in more places) - rust-lang/rust#165203 (AIX: Implement TLS destructor guard in std and update dynamic-loading-cdylib test) - rust-lang/rust#165230 (Fix rigidity assertion ICE) - rust-lang/rust#165293 (unstable-book: update default-visibility.md to link to tracking issue) - rust-lang/rust#165374 (Refactorings in preparation for the move trait) - rust-lang/rust#165421 (another Enzyme submodule update for nested autodiff)
I noticed there's some inlining noise happening around this lint -
CheckPackedRef::run_lintmay or may not get inlined into the parent, and that decision seems to flip based on unrelated changes. I decided to look into it and found two simplifications, more details in the individual commits.I kinda hope that eliminating all the unnecessary visitor traversal will make the lint more straightforward to optimize and maybe reduce some of the noise we get from it in our benchmarks, but that is not straightforward to verify.