Repository navigation
Canonicalize operands for commutative binary ops - #163373
Conversation
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
|
r? @jieyouxu rustbot has assigned @jieyouxu. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
7771c64 to
8530d03
Compare
This comment has been minimized.
This comment has been minimized.
|
r? mir-opt |
4718942 to
8530d03
Compare
|
I think we could have a canonicalization format which would benefit other passes. For instance, if there is a place and a constant, the first one should be constant. Rules:
When one operand is a constant and the other is a place, we only need to consider |
|
@dianqk do you think we should implement it in new pass instead of the GVN pass? |
How about adding this to InstSimplify, along with a helper function similar to An MCP isn't required in my case, but we should document it in the |
8530d03 to
88b906f
Compare
|
@rustbot author |
88b906f to
ea48d3d
Compare
This comment has been minimized.
This comment has been minimized.
ea48d3d to
5b5ecfd
Compare
This comment has been minimized.
This comment has been minimized.
5b5ecfd to
6d881b9
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Update:
For now,
@rustbot ready |
|
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+ |
Canonicalize operands for commutative binary ops Fixes rust-lang#162220
Rollup of 10 pull requests Successful merges: - #161698 (Fix rmeta-link metadata not being read on AIX) - #163373 (Canonicalize operands for commutative binary ops) - #164016 (Tighten (absence of) return attribute checks in `some-abis-do-extend-params-to-32-bits.rs`) - #164424 (diagnostic: skip wrong loops when explaining borrow errors) - #138744 (Add methods to TCP and UDP sockets to modify hop limit) - #162444 (Make `std::fs::{File, ReadDir, DirEntry}` always `needs_drop` even when unsupported.) - #163862 (Collect all limit attributes during TyCtxt creation) - #164213 (make the safety documentation consistent in task::LocalWaker) - #164356 (Add missing full stop) - #164374 (core: hint: fix `unlikely`'s example polarity typo)
Rollup of 10 pull requests Successful merges: - #161698 (Fix rmeta-link metadata not being read on AIX) - #163373 (Canonicalize operands for commutative binary ops) - #164016 (Tighten (absence of) return attribute checks in `some-abis-do-extend-params-to-32-bits.rs`) - #164424 (diagnostic: skip wrong loops when explaining borrow errors) - #138744 (Add methods to TCP and UDP sockets to modify hop limit) - #162444 (Make `std::fs::{File, ReadDir, DirEntry}` always `needs_drop` even when unsupported.) - #163862 (Collect all limit attributes during TyCtxt creation) - #164213 (make the safety documentation consistent in task::LocalWaker) - #164356 (Add missing full stop) - #164374 (core: hint: fix `unlikely`'s example polarity typo)
Canonicalize operands for commutative binary ops Fixes rust-lang#162220
…uwer Rollup of 11 pull requests Successful merges: - #162809 (Remap local def ids for deterministic metadata encoding) - #163373 (Canonicalize operands for commutative binary ops) - #164016 (Tighten (absence of) return attribute checks in `some-abis-do-extend-params-to-32-bits.rs`) - #164259 (std: make SOLID `sockaddr_storage` large enough for IPv6) - #164424 (diagnostic: skip wrong loops when explaining borrow errors) - #138744 (Add methods to TCP and UDP sockets to modify hop limit) - #162444 (Make `std::fs::{File, ReadDir, DirEntry}` always `needs_drop` even when unsupported.) - #163862 (Collect all limit attributes during TyCtxt creation) - #164213 (make the safety documentation consistent in task::LocalWaker) - #164356 (Add missing full stop) - #164374 (core: hint: fix `unlikely`'s example polarity typo)
View all comments
Fixes #162220