-
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
Update il range in optOptimizeBoolsUpdateTrees #74657
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsPossible fix for #49471 So far I wasn't been able to repro this BasicBlock optimization. So leaving this as draft for now (and hope tests will catch something)
|
For this kind of method IL range seems to be updated correctly static int TestBasicBlocks(int x, int y)
{
if (x == 0 && y == 0)
{
return 0;
}
return 2;
}
=> Before:
After:
|
Should an assert be added somewhere after OptimizeBools? |
Can someone review this please? |
Sorry for the long delay, thanks for the contribution! Looks good to me, could you please check what it returns for: static int TestBasicBlocks(int x, int y) => x == 0 && y == 0; (the case with RETURN) |
@EgorBo Thanks! I changed you example to public static bool TestBasicBlocks2(int x, int y) => x == 0 && y == 0; I hope you meant bool, not int. With PR:
Without:
It seems to be correctly updated to 000..00A For example this is how it looks few phases before:
|
Thanks for your contribution! |
Possible fix for #49471