Skip to content

Optimization issues with inlined il + generated IL #9753

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

Open
KevinRansom opened this issue Jul 22, 2020 · 1 comment
Open

Optimization issues with inlined il + generated IL #9753

KevinRansom opened this issue Jul 22, 2020 · 1 comment
Labels
Area-Compiler-Optimization The F# optimizer, release code gen etc. Feature Request
Milestone

Comments

@KevinRansom
Copy link
Member

While working on this PR: #9715

@abelbraaksma identified optimization issues when combining inline il with other generated code

#9715

@KevinRansom, @cartermp, When working with this fix I noticed some other cases where incorrect boolean optimizations are done. I'm still analyzing that, but this fix produces better IL for the majority of cases.

The optimizer is split in optimizing inline IL and normal code. When it is mixed, esp wrt booleans, it goes wrong and dead IL code is created. What's worse, when combined with null checks, the code didn't eliminate the not, but created code that was many times slower.

This simple fix takes care of all that. Yes, there are now other cases, but the way this fix was done ensures that the new cases are very limited, and that existing optimizations with comparison operators continue to work.

I intend to investigate further for optimizations of boolean expressions, esp boolean negation. But that should go in its own issue. I'll report that separately, as it's a much wider issue than this one (and may end up being wip for some time).

Originally posted by @abelbraaksma in #9715 (comment)

@abelbraaksma
Copy link
Contributor

abelbraaksma commented Jul 22, 2020

Glad I just saw this, as I was typing a new post as well 😆.

The issue appears to be slightly less worrying as I thought, but it'll take some time to weed out the details and to see what's really going on here.

This is a follow-up to issue #9433.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compiler-Optimization The F# optimizer, release code gen etc. Feature Request
Projects
Status: New
Development

No branches or pull requests

4 participants