Uh oh!
There was an error while loading. Please reload this page.
JIT: experimental changes to redundant branch opts - #88527
Conversation
Recognize a particular case where a control flow pattern involving two BBJ_COND blocks with relops that test the same VNs can be simplified to a single relop in the dominating block. As part of this, teach VN about some of the rudiments of boolean simplification (DeMorgan's laws) and how to simplify some NOT / AND / OR expressions involving relops. Addresses some of the cases in dotnet#81220.
ghost
commented
Jul 7, 2023
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsRecognize a particular case where a control flow pattern involving two BBJ_COND blocks with relops that test the same VNs can be simplified to a single relop in the dominating block. As part of this, teach VN about some of the rudiments of boolean simplification (DeMorgan's laws) and how to simplify some NOT / AND / OR expressions involving relops. Addresses some of the cases in #81220. [This is an updated version of #83859]
|
Will this also fix #88025 (comment)? |
AndyAyersMS
commented
Jul 12, 2023
Failure looks similar to #88579 (timeout in remote executor) |
AndyAyersMS
commented
Jul 12, 2023
No, it doesn't fix that case (though it does a ton of flow graph simplification). Seems like for that we could try running a late tail merge...? That should be fairly cheap, let me see what happens. |
AndyAyersMS
commented
Jul 12, 2023
Well, not quite that simple, we are left with this sort of thing after running opts and fg cleanup: As you can see this should all collapse to returning zero, but tail merging is hindered by the no-longer relevant PHI and the fact that the zero in BB22 needs to propagate through a few intermediate assignments. You might wonder why we didn't realize that A more heavy-weight optimizer might rebuild SSA/VN after RBO, or run multiple passes of optimization, but that's not something we would do lightly... |
ghost
commented
Aug 13, 2023
Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it. |
Recognize a particular case where a control flow pattern involving two BBJ_COND blocks with relops that test the same VNs can be simplified to a single relop in the dominating block.
As part of this, teach VN about some of the rudiments of boolean simplification (DeMorgan's laws) and how to simplify some NOT / AND / OR expressions involving relops.
Addresses some of the cases in #81220.
[This is an updated version of #83859]