Skip to content

Commit b3de022

Browse files
authored
JIT: Always remove commas while splitting (#119275)
There is no reason to keep the commas around, and for some struct IR it results in illegal IR (e.g. when splitting COMMA(op1, FIELD_LIST(...))).
1 parent 8c7b356 commit b3de022

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/coreclr/jit/gentree.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17162,6 +17162,18 @@ bool Compiler::gtSplitTree(BasicBlock* block,
1716217162
}
1716317163
#endif
1716417164

17165+
if ((*use)->OperIs(GT_COMMA))
17166+
{
17167+
// We might as well get rid of the comma while we're at it. This avoids unnecessarily nested trees and
17168+
// also handles splitting some irregular nodes when nested under commas
17169+
// (like COMMA(op1, FIELD_LIST(...))).
17170+
SplitOutUse(UseInfo{&(*use)->AsOp()->gtOp1, *use}, false);
17171+
*use = (*use)->gtGetOp2();
17172+
SplitOutUse(useInf, userIsReturned);
17173+
MadeChanges = true;
17174+
return;
17175+
}
17176+
1716517177
if ((*use)->OperIs(GT_FIELD_LIST, GT_INIT_VAL))
1716617178
{
1716717179
for (GenTree** operandUse : (*use)->UseEdges())

0 commit comments

Comments
 (0)