Uh oh!
There was an error while loading. Please reload this page.
Redefine 'not' to not emit IL directly - #9434
Conversation
What happens if you just use if/then? Pattern matching looks really ugly on bool |
cartermp
commented
Jun 12, 2020
oh poopy, failures |
if/then emits the same IL (and same benchmark results), I can change that |
Hey thanks, that was quick! I thought, since the inline assembly is the same, that something went wrong in the optimizer. But this definitely fixes the general case. Btw, I've meanwhile found that the issue happens with other functions too, but they have to be small, and have to involve |
cartermp
commented
Jun 12, 2020
So running the baseline update tool updates a lot more than just what was failing, and some of what it updates are more than just comments. I'm also curious why some of the IL has more fields than before. |
cartermp
commented
Jun 13, 2020
I think I might just move these tests to the new test suite because it's horrible trying to update anything to do with fsharpqa baselines |
TIHan
commented
Jun 16, 2020
@cartermp Because the IL output is more complex, we should think about ways to reduce it, even if the runtime does folding. |
cartermp
commented
Jun 16, 2020
@TIHan I'm not sure what's up. I don't see that same IL in sharplab's IL viewer, though: https://sharplab.io/#v2:DYLgZgzgNALiCWwA+wCmMAE8B2weowFsBPAOQHtMAKADxAwCNzzgBKDAXizAxoxgAWqbBjABDYBAKpJBGACcArqiA=== Could there be a problem in the tool used to generate baselines? |
baronfel
commented
Jun 16, 2020
Sharplab also depends on FCS for this, and if they are behind or there are codegen updates that haven't been released that could be causing their output to be out of sync with what you expect. |
There was a problem hiding this comment.
This change is probably the source of my woes w.r.t IL baselines, I wonder why though
abelbraaksma
commented
Jun 17, 2020
Strangely, if you look at the function's definition in ilspy, both are equal. Only when used with a small function that compares to (though I admit I don't understand the issue with the baselines, perhaps a test expects the old IL output?) |
cartermp
commented
Jun 17, 2020
git is hard, closing |
Follow-up: I've made a PR with a new attempt in #9715, which uses a slightly different approach than this one, which leads to less changes in the baseline tests (actually, only one). It appears to work now :). |
Fixes#9433
The current implementation of
notgets funky when you pass in a call toisNullfor a reference type. Probably other quirks too. The following benchmark shows the effect:I get these timings against .NET 5:
And these for net48: