Uh oh!
There was an error while loading. Please reload this page.
Improve branch optimizer around implied relops - #95234
Conversation
ghost
commented
Nov 25, 2023
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsShould help with cases like: voidTest(intx){if(x>100)if(x>10)// always trueConsole.WriteLine();}Ideally, it should be done in "redundant branch opt" phase, but it seems to be way more complicated so at least let's have it in assertprop for now.
|
Uh oh!
There was an error while loading. Please reload this page.
ffa7d1a to
3f82e12CompareEgorBo
commented
Nov 30, 2023
/azp run runtime-coreclr outerloop, runtime-coreclr jitstress, Fuzzlyn |
|
Azure Pipelines successfully started running 3 pipeline(s). |
PTAL @AndyAyersMS @dotnet/jit-contrib Diffs (not too big but I have some follow-up ideas how to extend them) |
| // BB4: | ||
| // return; | ||
| // Check whether the dominating compare being "false" implies the dominated compare is known |
There was a problem hiding this comment.
The reversal/negation here is a bit tricky, but I think I follow it.
Seems like there's a complementary case where you don't negate the upper relop and then may instead have canInferFromTrue abilities?
There was a problem hiding this comment.
Yeah, basically there are two cases:
canInferFromFalse:
if(x>100){if(x>10){
...}}canInferFromTrue:
if(x>100){
...}if(x>10){
...}I'll check separately the 2nd case (last I tried it added very little diffs)
danmoseley
commented
Dec 1, 2023
How many of those diffs represent places code itself should be cleaned up? Like your example. |
EgorBo
commented
Dec 1, 2023
I inspected a few diffs and they were inlining-related so I wasn't able to find an obvious case that can be cleaned up in C# |
EgorBo
commented
Dec 1, 2023
Hm.. arm failures look related and they're floating point related... soft floats? |
…1 into implied-relop-assertprop
EgorBo
commented
Dec 28, 2023
Since the last review I found a small bug - I replaced |
Should help with cases like:
Ideally, it should be done in "redundant branch opt" phase, but it seems to be way more complicated so at least let's have it in assertprop for now: EgorBo@cdbaac0