-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Preserve value numbers when morphing multiplication into shift. #3067
Conversation
@briansull PTAL |
@dotnet-bot test Windows_NT jitstress1 |
@dotnet-bot test Windows_NT jitstress2 |
void GenTree::SetOper(genTreeOps oper) | ||
void GenTree::SetOper(genTreeOps oper, bool clearVN) | ||
{ | ||
gtOper = oper; |
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.
I don't think we have tried building the JIT without SMALL_TREE_NODES defined in quite sometime.
But you should go ahead and add the if (clearVM) logic here as well as it appears to just be missing.
The instance field gtVNPair is available with and without SMALL_TREE_NODES.
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.
Done.
@briansull I addressed your feedback, PTAL. |
This change fixes a morpher transformation of multiplication to shift to preserve the value number of the tree since the new shift expression will compute the same value as the old multiplication expression. Without that change we were getting asserts in fgMoveOpsLeft, which expects to see value numbers on trees it transforms. Closes #2920.
44dfacc
to
96a998d
Compare
@dotnet-bot retest |
@dotnet-bot test Windows_NT jitstress1 |
@dotnet-bot test Windows_NT jitstress2 |
LGTM |
1 similar comment
LGTM |
Preserve value numbers when morphing multiplication into shift.
The code to change multiplication to shift shouldn't be under LEA_AVAILABLE since the code to process multiplication by power of 2 isn't.
Small correction for #3067.
This change fixes a morpher transformation of multiplication to shift
to preserve the value number of the tree since the new shift expression
will compute the same value as the old multiplication expression.
Without that change we were getting asserts in fgMoveOpsLeft,
which expects to see value numbers on trees it transforms.
Closes #2920.