-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
JIT: workaround for unreliable change detection in fgReorderBlocks #48516
Conversation
This method costs trees, which can in turn modify the IR by swapping operands. As a result the bool value returned doesn't properly reflect whether any changes happened. This impacts proper reporting phase status by `optOptimizeLayout'. Since phase status just gates post-phase dumps and checks, we'll just claim this phase always modifies IR. Fixes dotnet#48495.
cc @dotnet/jit-contrib |
Looks like the preceding phase (invert loops) may have the same problem, given #48494. So will look to extend this fix to cover that case too. |
Kind of on the fence here. On the one had it would be nice to be able to cost trees without side effecting them; on the other hand an accurate costing (at least as accurate as it is ever going to be) more or less entails opportunistic swapping (and address mode marking). So three options to pursue... I have chosen the simplest for now:
|
I suppose there is a fourth option:
I'm more in favor of having phases be deliberate in what they change, so decided not to pursue this one. None of this is crucial for now, but at some point we may want to report finer-grained phase status and relying on to guide release behaviors. |
I somewhat prefer the 3rd:
|
// it has no impact on a release build. | ||
// | ||
madeChanges = true; | ||
|
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.
You could also add an additional state MODIFIED_TREE here instead of using MODIFIED_EVERYTHING
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.
Right -- I originally had finer-grained status in mind, but wasn't quite sure what the right breakout should be, so just have everything/nothing for now.
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 OK
/azp run runtime-coreclr outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
Great, thank you! It would be great if you could run this change through the shiproom and push it to Preview 2 that's just forked. |
Sure. |
I'm fairly sure the outerloop failures are unrelated to this change. But I'm reluctant to merge with things looking this red. Lots of instances of And some pal test failures on Linux, dups of #48496. And a jit-format failure on Linux, looks like jit-format is crashing; the patch artifact is a zero sized file. |
Local run of jit-format on linux was clean. |
Looked again at the failures and don't see anything related. So am going to merge after all. |
This method costs trees, which can in turn modify the IR by swapping operands.
As a result the bool value returned doesn't properly reflect whether any
changes happened.
This impacts proper reporting phase status by `optOptimizeLayout'. Since phase
status just gates post-phase dumps and checks, we'll just claim this phase
always modifies IR.
Fixes #48495.