diff options
| author | bors <bors@rust-lang.org> | 2024-06-21 02:06:27 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-06-21 02:06:27 +0000 |
| commit | 7a08f84627ff3035de4d66ff3209e5fc93165dcb (patch) | |
| tree | 07032b0a88e108d725287f5f826bcff1e6091ec1 /compiler/rustc_parse/src | |
| parent | a9c8887c7d548abc6c3e87f7d6fa02a0e95880bd (diff) | |
| parent | eac6b2910a5513a3d395814aa20739cabd388723 (diff) | |
| download | rust-7a08f84627ff3035de4d66ff3209e5fc93165dcb.tar.gz rust-7a08f84627ff3035de4d66ff3209e5fc93165dcb.zip | |
Auto merge of #126578 - scottmcm:inlining-bonuses-too, r=davidtwco
Account for things that optimize out in inlining costs This updates the MIR inlining `CostChecker` to have both bonuses and penalties, rather than just penalties. That lets us add bonuses for some things where we want to encourage inlining without risking wrapping into a gigantic cost. For example, `switchInt(const …)` we give an inlining bonus because codegen will actually eliminate the branch (and associated dead blocks) once it's monomorphized, so measuring both sides of the branch gives an unrealistically-high cost to it. Similarly, an `unreachable` terminator gets a small bonus, because whatever branch leads there doesn't actually exist post-codegen.
Diffstat (limited to 'compiler/rustc_parse/src')
0 files changed, 0 insertions, 0 deletions
