Skip to content

Commit

Permalink
Do not propagate RHS flags in block morphing (#66291)
Browse files Browse the repository at this point in the history
It is not necessary to copy flags from the source node to the field nodes
when doing a field-by-field copy in block morphing. In fact, it can be a
pessimization in cases where the source node had NO_CSE set, which would
block constant propagation.
  • Loading branch information
SingleAccretion authored Mar 9, 2022
1 parent 853e494 commit 60f593b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/coreclr/jit/morphblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1282,12 +1282,10 @@ GenTree* MorphCopyBlockHelper::CopyFieldByField()
GenTree* srcFld = nullptr;
if (m_srcDoFldAsg)
{
noway_assert(m_srcLclNum != BAD_VAR_NUM);
noway_assert((m_srcLclNum != BAD_VAR_NUM) && (m_srcLclNode != nullptr));
unsigned srcFieldLclNum = m_comp->lvaGetDesc(m_srcLclNum)->lvFieldLclStart + i;
srcFld = m_comp->gtNewLclvNode(srcFieldLclNum, m_comp->lvaGetDesc(srcFieldLclNum)->TypeGet());

noway_assert(m_srcLclNode != nullptr);
srcFld->gtFlags |= m_srcLclNode->gtFlags & ~GTF_NODE_MASK;
srcFld = m_comp->gtNewLclvNode(srcFieldLclNum, m_comp->lvaGetDesc(srcFieldLclNum)->TypeGet());
}
else
{
Expand Down

0 comments on commit 60f593b

Please sign in to comment.