-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Fix OperIsSimple assert in lower #96615
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
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue Details@dotnet/jit-contrib It seems that in lower we have a worrisome pattern to handle nodes like this: // Returns:
// A pointer to the next node to evaluate. On no operation, returns nullptr.
//
GenTree* LowerFoo(GenTree* tree)
{
if (someValidation)
return nullptr;
return newNode->gtNext;
} and then caller assumes that This is exactly what happens with #96612 The correct pattern should be bool TryLowerFoo(GenTree* node, GenTree** next)
... I'll inspect more function for this pattern separately.
|
/azp run runtime-coreclr pgo, runtime-coreclr libraries-pgo, runtime-coreclr pgostress |
Azure Pipelines successfully started running 3 pipeline(s). |
src/coreclr/jit/lowerarmarch.cpp
Outdated
JITDUMP("Conversion was legal. Result:\n") | ||
DISPTREERANGE(BlockRange(), tree) | ||
JITDUMP("\n") |
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.
Why remove the semicolons? It looks odd to have statements without semicolons, even if the macro expansion allows it.
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.
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.
We should probably change the definition of JITDUMP
to follow the coding conventions -- they call out to use do/while pattern, among other things to explicitly require semicolons at uses: https://github.com/dotnet/runtime/blob/main/docs/coding-guidelines/clr-jit-coding-conventions.md#1433-multi-statement-macro-functions
/azp run runtime-coreclr pgo, runtime-coreclr libraries-pgo, runtime-coreclr pgostress |
Azure Pipelines successfully started running 3 pipeline(s). |
Closes #96612
@dotnet/jit-contrib It seems that in lower we have a worrisome pattern to handle nodes like this:
and then caller assumes that
nullptr
means nothing was handled. Which is not true - it could be handled and it's just thatgtNext
is nullptr.This is exactly what happens with #96612
TryLowerAndOrToCCMP
converts a binary op toGT_SECC
and returns nullptr and thenContainBinaryNode
fails because node is no longer a simple op.The correct pattern should be
I'll inspect more functions for this pattern separately.