Skip to content

Commit

Permalink
Do not propagate RHS flags in block morphing
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 committed Mar 7, 2022
1 parent 44ec3c9 commit e0e9659
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 e0e9659

Please sign in to comment.