Uh oh!
There was an error while loading. Please reload this page.
Fold arithmetic identities in GVN - #119670
Conversation
rustbot
commented
Jan 6, 2024
r? @wesleywiser (rustbot has picked a reviewer for you, use r? to override) |
rustbot
commented
Jan 6, 2024
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
| let lhs = lhs?; | ||
| let rhs = rhs?; |
There was a problem hiding this comment.
you could do the ? op directly on the method calls above
There was a problem hiding this comment.
Added a comment explaining why it is done this way.
| let lhs = lhs?; | ||
| let rhs = rhs?; |
| // Represent the values as `Ok(bits)` or `Err(VnIndex)`. | ||
| let a = as_bits(lhs).ok_or(lhs); | ||
| let b = as_bits(rhs).ok_or(rhs); |
| (BinOp::Eq, a, b) if (a.is_ok() && b.is_ok()) || a == b => self.insert_bool(a == b), | ||
| (BinOp::Ne, a, b) if (a.is_ok() && b.is_ok()) || a == b => self.insert_bool(a != b), |
There was a problem hiding this comment.
why does it need to be ok for equality? wouldn't it also hold if they are the same VnIndex?
bors
commented
Jan 16, 2024
☔ The latest upstream changes (presumably #119672) made this pull request unmergeable. Please resolve the merge conflicts. |
oli-obk
commented
Jan 16, 2024
@bors r+ |
bors
commented
Jan 16, 2024
cjgillot
commented
Jan 16, 2024
Blessed tests after rebasing. |
bors
commented
Jan 16, 2024
cjgillot
commented
Jan 16, 2024
Perf effect is likely. |
Fold arithmetic identities in GVN Extracted from rust-lang#111344 This PR implements a few arithmetic folds for unary and binary operations. This should take care of the missed optimizations introduced by rust-lang#116012.
bors
commented
Jan 17, 2024
rust-log-analyzer
commented
Jan 17, 2024
bors
commented
Jan 17, 2024
💔 Test failed - checks-actions |
cjgillot
commented
Jan 17, 2024
Failure looks spurious. |
bors
commented
Jan 17, 2024
bors
commented
Jan 17, 2024
☀️ Test successful - checks-actions |
rust-timer
commented
Jan 17, 2024
Finished benchmarking commit (52790a9): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 664.038s -> 665.924s (0.28%) |
ChrisDenton
commented
Jan 31, 2024
Though this is a perf only fix, would T-compiler consider backporting? cc @mati865 |
Extracted from #111344
This PR implements a few arithmetic folds for unary and binary operations.
This should take care of the missed optimizations introduced by #116012.