-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
optRelopImpliesRelop experiments #70616
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsFixes #70373 Minimal repro (the reason why #70373 regressed): bool Test(int a, int b) => a.CompareTo(b) > 0; codegen diff: https://www.diffchecker.com/5vriKD2u Diffs were promising but I am not sure it works as expected so waiting for CI
|
This is a tricky area. We might want to invest first in some kind of test case generator, though there's no guarantee C# source predicates will end up inspiring the same kind of IL predicate or that the JIT won't invert the IL predicates somewhere along the line. You also may (or may not) find table 2 in Mueller and Whalley's Avoiding Conditional Branches by Code Replication useful. (There may be more modern writeups that cover this more broadly; they focus on X RELOP C1 dominating X RELOP C2). |
Right, I'll read the paper and experiment locally |
Fixes #70373
Might also close #65327 if it works
Minimal repro (the reason why #70373 regressed):
codegen diff: https://www.diffchecker.com/5vriKD2u