-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Clean up some mir transform passes #75503
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
Conversation
I noticed a few places where there were intermediates being created in MIR optimization passes, so I removed them.
6405cf0
to
510c3ae
Compare
TerminatorKind::FalseUnwind { real_target, unwind } | ||
if predicate(real_target) && unwind.map_or(true, &predicate) => | ||
{ | ||
TerminatorKind::Unreachable |
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.
I also added these, not sure if they're viable or not.
baf7f1e
to
ff6bd95
Compare
I realize this is a lot of changes, and I can split it into separate PRs, but curious whether this sort of change would be accepted. (And also open to accepting in current form) |
f34c767
to
5e9d088
Compare
@bors r+ rollup=never Yea I don't think this'll have measurable perf implications, but let's not roll it up to be sure |
📌 Commit 5e9d088b23743145ee0b54557627f29f7ec962e3 has been approved by |
Ah I just pushed the change to convert from |
Also convert `uninhabited_enum_branching` `Cow<[u128]>::to_mut`
@bors r+ |
📌 Commit fd63bf7 has been approved by |
☀️ Test successful - checks-actions, checks-azure |
I noticed a few places where there were intermediates being created
in MIR optimization passes, so I removed them.
I also changed some
Some(..)
into just..
and wrapSome(..)
at the function end, doing early returns forNone
.I was generally looking for some easy optimizations in theses passes, and hopefully these should improve the runtime of these passes by a tinnnyyyyy bit.
r? @oli-obk