-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Propagate from borrowed locals in CopyProp #143624
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
base: master
Are you sure you want to change the base?
Conversation
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
@bors2 try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Propagate from borrowed locals in CopyProp r? cjgillot
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (1e4b0b7): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking 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. @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)Results (primary 1.9%, secondary 2.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.4%, secondary -3.9%)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: 465.817s -> 464.2s (-0.35%) |
// the class is borrowed. | ||
// We can propagate from a borrowed local into other locals that aren't borrowed, since we know | ||
// that all uses of the other locals are dominated by the definition. This bitset is keyed by | ||
// *class head* and contains whether any member of the class is borrowed. | ||
let mut borrowed_classes = ssa.borrowed_locals().clone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this separate bitset?
// We must not unify two locals that are borrowed. But this is fine if one is borrowed and | ||
// the other is not. This bitset is keyed by *class head* and contains whether any member of | ||
// the class is borrowed. | ||
// We can propagate from a borrowed local into other locals that aren't borrowed, since we know |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you elaborate why we must not propagate if the lhs is borrowed?
r? cjgillot