Skip to content

Commit

Permalink
Delete Statement::m_compilerAdded . (#64506)
Browse files Browse the repository at this point in the history
  • Loading branch information
sandreenko committed Feb 4, 2022
1 parent 078eb57 commit 59e643b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
13 changes: 0 additions & 13 deletions src/coreclr/jit/gentree.h
Expand Up @@ -6428,7 +6428,6 @@ struct Statement
, m_lastILOffset(BAD_IL_OFFSET)
, m_stmtID(stmtID)
#endif
, m_compilerAdded(false)
{
}

Expand Down Expand Up @@ -6515,16 +6514,6 @@ struct Statement
m_prev = prevStmt;
}

bool IsCompilerAdded() const
{
return m_compilerAdded;
}

void SetCompilerAdded()
{
m_compilerAdded = true;
}

bool IsPhiDefnStmt() const
{
return m_rootNode->IsPhiDefn();
Expand Down Expand Up @@ -6561,8 +6550,6 @@ struct Statement
IL_OFFSET m_lastILOffset; // The instr offset at the end of this statement.
unsigned m_stmtID;
#endif

bool m_compilerAdded; // Was the statement created by optimizer?
};

// StatementList: adapter class for forward iteration of the statement linked list using range-based `for`,
Expand Down
12 changes: 3 additions & 9 deletions src/coreclr/jit/optimizer.cpp
Expand Up @@ -1159,7 +1159,7 @@ bool Compiler::optExtractInitTestIncr(
noway_assert(initStmt != nullptr && (initStmt->GetNextStmt() == nullptr));

// If it is a duplicated loop condition, skip it.
if (initStmt->IsCompilerAdded())
if (initStmt->GetRootNode()->OperIs(GT_JTRUE))
{
bool doGetPrev = true;
#ifdef DEBUG
Expand Down Expand Up @@ -3771,10 +3771,9 @@ PhaseStatus Compiler::optUnrollLoops()
Statement* incrStmt = testStmt->GetPrevStmt();
noway_assert(incrStmt != nullptr);

if (initStmt->IsCompilerAdded())
if (initStmt->GetRootNode()->OperIs(GT_JTRUE))
{
// Must be a duplicated loop condition.
noway_assert(initStmt->GetRootNode()->gtOper == GT_JTRUE);

dupCond = true;
initStmt = initStmt->GetPrevStmt();
Expand Down Expand Up @@ -4601,8 +4600,6 @@ bool Compiler::optInvertWhileLoop(BasicBlock* block)
{
clonedStmt->SetDebugInfo(stmt->GetDebugInfo());
}

clonedStmt->SetCompilerAdded();
}

assert(foundCondTree);
Expand Down Expand Up @@ -5835,12 +5832,9 @@ void Compiler::optPerformHoistExpr(GenTree* origExpr, BasicBlock* exprBb, unsign
preHead->bbFlags |= (exprBb->bbFlags & (BBF_HAS_IDX_LEN | BBF_HAS_NULLCHECK));

Statement* hoistStmt = gtNewStmt(hoist);
hoistStmt->SetCompilerAdded();

/* simply append the statement at the end of the preHead's list */

// Simply append the statement at the end of the preHead's list.
Statement* firstStmt = preHead->firstStmt();

if (firstStmt != nullptr)
{
/* append after last statement */
Expand Down

0 comments on commit 59e643b

Please sign in to comment.