Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 0 additions & 13 deletions src/coreclr/jit/gentree.h
Original file line number Diff line number Diff line change
Expand Up @@ -6420,7 +6420,6 @@ struct Statement
, m_lastILOffset(BAD_IL_OFFSET)
, m_stmtID(stmtID)
#endif
, m_compilerAdded(false)
{
}

Expand Down Expand Up @@ -6507,16 +6506,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 @@ -6553,8 +6542,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
Original file line number Diff line number Diff line change
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