Skip to content

Commit 21001dc

Browse files
authored
JIT: Create side effect commas as TYP_VOID in block morph (#85320)
This code could create IR shapes like COMMA struct ... ASG struct dst src After liveness that would sometimes result in COMMA struct ... NOP void which could confuse optimization phases when JitOptRepeat was enabled. The more canonical shape for these side-effecting GT_COMMA nodes has them TYP_VOID typed as shown by gtExtractSideEffList, so do the same in block morph. Fix #85037
1 parent f1a4cdd commit 21001dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/coreclr/jit/morphblock.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ GenTree* MorphInitBlockHelper::Morph()
160160
commaPool = commaPool->gtNext;
161161

162162
assert(comma->OperIs(GT_COMMA));
163-
comma->gtType = m_result->TypeGet();
163+
comma->gtType = TYP_VOID;
164164
comma->AsOp()->gtOp1 = sideEffects;
165165
comma->AsOp()->gtOp2 = m_result;
166166
comma->gtFlags = (sideEffects->gtFlags | m_result->gtFlags) & GTF_ALL_EFFECT;
@@ -169,7 +169,7 @@ GenTree* MorphInitBlockHelper::Morph()
169169
}
170170
else
171171
{
172-
m_result = m_comp->gtNewOperNode(GT_COMMA, m_result->TypeGet(), sideEffects, m_result);
172+
m_result = m_comp->gtNewOperNode(GT_COMMA, TYP_VOID, sideEffects, m_result);
173173
}
174174
INDEBUG(m_result->gtDebugFlags |= GTF_DEBUG_NODE_MORPHED);
175175

0 commit comments

Comments
 (0)