Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Delete references to GT_PHI_ARG/GT_PHI after rat.
  • Loading branch information
Sergey committed May 26, 2021
commit 61808ca1b23d66ef443650d97bd9138f4b806ef0
3 changes: 1 addition & 2 deletions src/coreclr/jit/decomposelongs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,7 @@ GenTree* DecomposeLongs::DecomposeStoreLclVar(LIR::Use& use)

GenTree* tree = use.Def();
GenTree* rhs = tree->gtGetOp1();
if ((rhs->OperGet() == GT_PHI) || (rhs->OperGet() == GT_CALL) ||
((rhs->OperGet() == GT_MUL_LONG) && (rhs->gtFlags & GTF_MUL_64RSLT) != 0))
if (rhs->OperIs(GT_CALL) || (rhs->OperIs(GT_MUL_LONG) && (rhs->gtFlags & GTF_MUL_64RSLT) != 0))
{
// GT_CALLs are not decomposed, so will not be converted to GT_LONG
// GT_STORE_LCL_VAR = GT_CALL are handled in genMultiRegCallStoreToLocal
Expand Down
13 changes: 1 addition & 12 deletions src/coreclr/jit/lir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1548,8 +1548,7 @@ bool LIR::Range::CheckLIR(Compiler* compiler, bool checkUnusedValues) const

SmallHashTable<GenTree*, bool, 32> unusedDefs(compiler->getAllocatorDebugOnly());

bool pastPhis = false;
GenTree* prev = nullptr;
GenTree* prev = nullptr;
for (Iterator node = begin(), end = this->end(); node != end; prev = *node, ++node)
{
// Verify that the node is allowed in LIR.
Expand All @@ -1567,16 +1566,6 @@ bool LIR::Range::CheckLIR(Compiler* compiler, bool checkUnusedValues) const

// TODO: validate catch arg stores

// Check that all phi nodes (if any) occur at the start of the range.
if ((node->OperGet() == GT_PHI_ARG) || (node->OperGet() == GT_PHI) || node->IsPhiDefn())
{
assert(!pastPhis);
}
else
{
pastPhis = true;
}

for (GenTree** useEdge : node->UseEdges())
{
GenTree* def = *useEdge;
Expand Down
5 changes: 1 addition & 4 deletions src/coreclr/jit/lower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2042,9 +2042,6 @@ void Lowering::RehomeArgForFastTailCall(unsigned int lclNum,
continue;
}

// This should not be a GT_PHI_ARG.
assert(treeNode->OperGet() != GT_PHI_ARG);

GenTreeLclVarCommon* lcl = treeNode->AsLclVarCommon();

if (lcl->GetLclNum() != lclNum)
Expand Down Expand Up @@ -3118,7 +3115,7 @@ void Lowering::LowerStoreLocCommon(GenTreeLclVarCommon* lclStore)
}
CheckMultiRegLclVar(lclStore->AsLclVar(), retTypeDesc);
}
if ((lclStore->TypeGet() == TYP_STRUCT) && !srcIsMultiReg && (src->OperGet() != GT_PHI))
if ((lclStore->TypeGet() == TYP_STRUCT) && !srcIsMultiReg)
{
bool convertToStoreObj;
if (src->OperGet() == GT_CALL)
Expand Down
28 changes: 15 additions & 13 deletions src/coreclr/jit/rationalize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,6 @@ void Rationalizer::RewriteAssignment(LIR::Use& use)
{
case GT_LCL_VAR:
case GT_LCL_FLD:
case GT_PHI_ARG:
RewriteAssignmentIntoStoreLclCore(assignment, location, value, locationOp);
BlockRange().Remove(location);
break;
Expand Down Expand Up @@ -949,20 +948,23 @@ PhaseStatus Rationalizer::DoPhase()
assert(statement->GetRootNode() != nullptr);
assert(statement->GetRootNode()->gtNext == nullptr);

BlockRange().InsertAtEnd(LIR::Range(statement->GetTreeList(), statement->GetRootNode()));

// If this statement has correct offset information, change it into an IL offset
// node and insert it into the LIR.
if (statement->GetILOffsetX() != BAD_IL_OFFSET)
if (!statement->IsPhiDefnStmt()) // Note that we get rid of PHI nodes here.
{
assert(!statement->IsPhiDefnStmt());
GenTreeILOffset* ilOffset = new (comp, GT_IL_OFFSET)
GenTreeILOffset(statement->GetILOffsetX() DEBUGARG(statement->GetLastILOffset()));
BlockRange().InsertBefore(statement->GetTreeList(), ilOffset);
}
BlockRange().InsertAtEnd(LIR::Range(statement->GetTreeList(), statement->GetRootNode()));

// If this statement has correct offset information, change it into an IL offset
// node and insert it into the LIR.
if (statement->GetILOffsetX() != BAD_IL_OFFSET)
{
assert(!statement->IsPhiDefnStmt());
GenTreeILOffset* ilOffset = new (comp, GT_IL_OFFSET)
GenTreeILOffset(statement->GetILOffsetX() DEBUGARG(statement->GetLastILOffset()));
BlockRange().InsertBefore(statement->GetTreeList(), ilOffset);
}

m_block = block;
visitor.WalkTree(statement->GetRootNodePointer(), nullptr);
m_block = block;
visitor.WalkTree(statement->GetRootNodePointer(), nullptr);
}
}

block->bbStmtList = nullptr;
Expand Down