-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Don't bug
when taking discriminant of generator during dataflow
#69562
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Don't bug
when taking discriminant of generator during dataflow
#69562
Conversation
Alternatively, we could just fall back to the normal |
@bors r+ |
📌 Commit 52ad1e7 has been approved by |
Rollup of 7 pull requests Successful merges: - #69397 (bootstrap: Remove commit hash from LLVM version suffix to avoid rebuilds) - #69549 (Improve MinGW detection when cross compiling ) - #69562 (Don't `bug` when taking discriminant of generator during dataflow) - #69579 (parser: Remove `Parser::prev_span`) - #69580 (use .copied() instead of .map(|x| *x) on iterators) - #69583 (Do not ICE on invalid type node after parse recovery) - #69605 (Use `opt_def_id()` over `def_id()`) Failed merges: r? @ghost
PR rust-lang#69562, which fixed a bug that was causing clippy to ICE, passed the place for the *result* of `Rvalue::Discriminant` instead of the *operand* to `apply_discriminant_switch_effect`. As a result, no effect was applied at all, and we lost the perf benefits from marking inactive enum variants as uninitialized.
This might have caused a compile time regression due to the dataflow changes: https://perf.rust-lang.org/compare.html?start=ee50590803f37abd7ad5f5f4bbd3bb844511fcf5&end=6b2983af1a85d857ae3a9345ac93ba0564ab7a73&stat=instructions:u |
@jonas-schievink See #69676. |
…t, r=oli-obk Pass correct place to `discriminant_switch_effect` PR rust-lang#69562, which fixed a bug that was causing clippy to ICE, mistakenly passed the place holding the *result* of `Rvalue::Discriminant` instead of the place holding its *operand* to `apply_discriminant_switch_effect` as the enum place. As a result, no effect was applied at all, and we lost the perf benefits from marking inactive enum variants as uninitialized. This PR corrects that mistake and adds a regression test to `mir-opt`. I fear that the regression test may prove too brittle; the test schema makes hard to test for the *absence* of certain kinds of MIR without exhaustively matching each basic block. r? @oli-obk
…t, r=oli-obk Pass correct place to `discriminant_switch_effect` PR rust-lang#69562, which fixed a bug that was causing clippy to ICE, mistakenly passed the place holding the *result* of `Rvalue::Discriminant` instead of the place holding its *operand* to `apply_discriminant_switch_effect` as the enum place. As a result, no effect was applied at all, and we lost the perf benefits from marking inactive enum variants as uninitialized. **edit:** The regression test has been split into rust-lang#69744. r? @oli-obk
Pass correct place to `discriminant_switch_effect` PR #69562, which fixed a bug that was causing clippy to ICE, mistakenly passed the place holding the *result* of `Rvalue::Discriminant` instead of the place holding its *operand* to `apply_discriminant_switch_effect` as the enum place. As a result, no effect was applied at all, and we lost the perf benefits from marking inactive enum variants as uninitialized. **edit:** The regression test has been split into #69744. r? @oli-obk
The proper fix for rust-lang/rust-clippy#5239.
Rvalue::Discriminant
is used on generators as well asenum
s. This didn't cause a test failure inrustc
since we don't need to do any dataflow passes until after the generator transform that adds theRvalue::Discriminant
.This required a small refactoring.
diff -w
is beneficial.r? @oli-obk
cc @JohnTitor