-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Workaround for compiler.hpp (1848) - Assertion failed 'lvRefCnt' #18292
Conversation
ci example: Windows_NT x64 Checked Innerloop Build and Test |
PTAL @dotnet/jit-contrib |
@dotnet-bot test Windows_NT x64 Checked jitstress2 |
Our ambition is to remove all incremental ref count maintenance -- in part because of issues like this -- in the not too distant future. So if this is some kind of artificial bug case, perhaps we can just hold off fixing it for now? |
Going to re-trigger the formatting tests to make sure my recent jitutils update is OK. @dotnet-bot test Windows_NT x64 Formatting |
Yep, looks to be ok:
|
Yes, it is an artificial bug case, however, I think it can be recreated with C# code.
Do we have an issue to track that ambition?
I do not see why we should hold it. |
Could somebody pls take a look, @dotnet/jit-contrib ? |
Issue for incremental ref count removal is #13280. The change you made looks ok but it rreallly needs a comment saying why things must be done in this particular order as it's not obvious. I wonder how many other places we may have similar ordering issues and haven't hit the right test case yet? I'm also surprised we don't hit other asserts when trying to remove trees twice. Seems like we should be calling |
It was my first idea :-), but it appeared that you can't do it, because we use Yes, I think it would be a good idea to separate |
Sounds reasonable, I will think how to describe it better. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks Good
I have added 2 comments to explain it better. I think we should add a separate issue to better check and assert flowGraph transformations. For example in the existing code when
on the second iteration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the comment. Looks good.
…net/coreclr#18292) * add test * clean fgRemoveStmt a bit * fix the issue (more like a workaround). Commit migrated from dotnet/coreclr@16169a8
The description is in #18291.
The fix is to replace
JTRUE
relop
before morph the list of its side effects. In this case when we havefgRemoveRestOfBlock
and callfgRemoveStmt
it removes updatedJTRUE
and this part works correct.The problem that
optVNConstantPropCurStmt
could receive a statement that was already removed still exists.