Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
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
14 changes: 7 additions & 7 deletions src/jit/assertionprop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4999,7 +4999,7 @@ Statement* Compiler::optVNAssertionPropCurStmt(BasicBlock* block, Statement* stm

// Check if propagation removed statements starting from current stmt.
// If so, advance to the next good statement.
Statement* nextStmt = (prev == nullptr) ? block->firstStmt() : prev->getNextStmt();
Statement* nextStmt = (prev == nullptr) ? block->firstStmt() : prev->GetNextStmt();
return nextStmt;
}

Expand Down Expand Up @@ -5041,7 +5041,7 @@ void Compiler::optAssertionPropMain()
if (fgRemoveRestOfBlock)
{
fgRemoveStmt(block, stmt);
stmt = stmt->getNextStmt();
stmt = stmt->GetNextStmt();
continue;
}
else
Expand All @@ -5052,7 +5052,7 @@ void Compiler::optAssertionPropMain()
// Propagation resulted in removal of the remaining stmts, perform it.
if (fgRemoveRestOfBlock)
{
stmt = stmt->getNextStmt();
stmt = stmt->GetNextStmt();
continue;
}

Expand All @@ -5071,7 +5071,7 @@ void Compiler::optAssertionPropMain()
}

// Advance the iterator
stmt = stmt->getNextStmt();
stmt = stmt->GetNextStmt();
}
}

Expand Down Expand Up @@ -5144,7 +5144,7 @@ void Compiler::optAssertionPropMain()
if (fgRemoveRestOfBlock)
{
fgRemoveStmt(block, stmt);
stmt = stmt->getNextStmt();
stmt = stmt->GetNextStmt();
continue;
}

Expand Down Expand Up @@ -5199,8 +5199,8 @@ void Compiler::optAssertionPropMain()

// Check if propagation removed statements starting from current stmt.
// If so, advance to the next good statement.
Statement* nextStmt = (prevStmt == nullptr) ? block->firstStmt() : prevStmt->getNextStmt();
stmt = (stmt == nextStmt) ? stmt->getNextStmt() : nextStmt;
Statement* nextStmt = (prevStmt == nullptr) ? block->firstStmt() : prevStmt->GetNextStmt();
stmt = (stmt == nextStmt) ? stmt->GetNextStmt() : nextStmt;
}
optAssertionPropagatedCurrentStmt = false; // clear it back as we are done with stmts.
}
Expand Down
4 changes: 2 additions & 2 deletions src/jit/block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ Statement* BasicBlock::FirstNonPhiDef()
while ((tree->OperGet() == GT_ASG && tree->gtOp.gtOp2->OperGet() == GT_PHI) ||
(tree->OperGet() == GT_STORE_LCL_VAR && tree->gtOp.gtOp1->OperGet() == GT_PHI))
{
stmt = stmt->getNextStmt();
stmt = stmt->GetNextStmt();
if (stmt == nullptr)
{
return nullptr;
Expand All @@ -855,7 +855,7 @@ Statement* BasicBlock::FirstNonPhiDefOrCatchArgAsg()
if ((tree->OperGet() == GT_ASG && tree->gtOp.gtOp2->OperGet() == GT_CATCH_ARG) ||
(tree->OperGet() == GT_STORE_LCL_VAR && tree->gtOp.gtOp1->OperGet() == GT_CATCH_ARG))
{
stmt = stmt->getNextStmt();
stmt = stmt->GetNextStmt();
}
return stmt;
}
Expand Down
2 changes: 1 addition & 1 deletion src/jit/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6860,7 +6860,7 @@ Compiler::NodeToIntMap* Compiler::FindReachableNodesInNodeTestData()

for (BasicBlock* block = fgFirstBB; block != nullptr; block = block->bbNext)
{
for (Statement* stmt = block->FirstNonPhiDef(); stmt != nullptr; stmt = stmt->getNextStmt())
for (Statement* stmt = block->FirstNonPhiDef(); stmt != nullptr; stmt = stmt->GetNextStmt())
{
for (GenTree* tree = stmt->gtStmtList; tree != nullptr; tree = tree->gtNext)
{
Expand Down
2 changes: 1 addition & 1 deletion src/jit/earlyprop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ void Compiler::optEarlyProp()
for (Statement* stmt = block->firstStmt(); stmt != nullptr;)
{
// Preserve the next link before the propagation and morph.
Statement* next = stmt->gtNextStmt;
Statement* next = stmt->GetNextStmt();

compCurStmt = stmt;

Expand Down
20 changes: 10 additions & 10 deletions src/jit/flowgraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ void Compiler::fgInsertStmtAtEnd(BasicBlock* block, Statement* stmt)
{
// There is at least one statement already.
Statement* lastStmt = firstStmt->getPrevStmt();
noway_assert(lastStmt != nullptr && lastStmt->getNextStmt() == nullptr);
noway_assert(lastStmt != nullptr && lastStmt->GetNextStmt() == nullptr);

// Append the statement after the last one.
lastStmt->gtNext = stmt;
Expand Down Expand Up @@ -845,7 +845,7 @@ Statement* Compiler::fgInsertStmtListAfter(BasicBlock* block, Statement* stmtAft
noway_assert(stmtLast);
noway_assert(stmtLast->gtNext == nullptr);

Statement* stmtNext = stmtAfter->getNextStmt();
Statement* stmtNext = stmtAfter->GetNextStmt();

if (stmtNext == nullptr)
{
Expand Down Expand Up @@ -3909,7 +3909,7 @@ bool Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block)
//
// More formally, if control flow targets an instruction, that instruction must be the
// start of a new sequence point.
Statement* nextStmt = newStmt->getNextStmt();
Statement* nextStmt = newStmt->GetNextStmt();
if (nextStmt != nullptr)
{
// Is it possible for gtNext to be NULL?
Expand Down Expand Up @@ -3968,7 +3968,7 @@ bool Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block)
Statement* stmt = top->firstStmt();
while (stmt->gtNext)
{
stmt = stmt->gtNextStmt;
stmt = stmt->GetNextStmt();
}
fgRemoveStmt(top, stmt);
fgInsertStmtAtEnd(bottom, stmt);
Expand Down Expand Up @@ -9438,7 +9438,7 @@ BasicBlock* Compiler::fgSplitBlockAfterStatement(BasicBlock* curr, Statement* st

if (stmt != nullptr)
{
newBlock->bbStmtList = stmt->gtNextStmt;
newBlock->bbStmtList = stmt->GetNextStmt();
if (newBlock->bbStmtList != nullptr)
{
newBlock->bbStmtList->gtPrev = curr->bbStmtList->gtPrev;
Expand Down Expand Up @@ -10044,7 +10044,7 @@ void Compiler::fgRemoveStmt(BasicBlock* block, Statement* stmt)
}
else
{
block->bbStmtList = firstStmt->gtNextStmt;
block->bbStmtList = firstStmt->GetNextStmt();
block->bbStmtList->gtPrev = firstStmt->gtPrev;
}
}
Expand Down Expand Up @@ -22971,7 +22971,7 @@ void Compiler::fgInsertInlineeBlocks(InlineInfo* pInlineInfo)
{
do
{
currentDumpStmt = currentDumpStmt->getNextStmt();
currentDumpStmt = currentDumpStmt->GetNextStmt();

printf("\n");

Expand Down Expand Up @@ -23012,7 +23012,7 @@ void Compiler::fgInsertInlineeBlocks(InlineInfo* pInlineInfo)
// Split statements between topBlock and bottomBlock.
// First figure out bottomBlock_Begin
Statement* bottomBlock_Begin;
bottomBlock_Begin = stmtAfter->gtNextStmt;
bottomBlock_Begin = stmtAfter->GetNextStmt();

if (topBlock->bbStmtList == nullptr)
{
Expand Down Expand Up @@ -23245,7 +23245,7 @@ Statement* Compiler::fgInlinePrependStatements(InlineInfo* inlineInfo)
BasicBlock* block = inlineInfo->iciBlock;
Statement* callStmt = inlineInfo->iciStmt;
IL_OFFSETX callILOffset = callStmt->gtStmtILoffsx;
Statement* postStmt = callStmt->gtNextStmt;
Statement* postStmt = callStmt->GetNextStmt();
Statement* afterStmt = callStmt; // afterStmt is the place where the new statements should be inserted after.
Statement* newStmt = nullptr;
GenTreeCall* call = inlineInfo->iciCall->AsCall();
Expand Down Expand Up @@ -23601,7 +23601,7 @@ Statement* Compiler::fgInlinePrependStatements(InlineInfo* inlineInfo)
// Update any newly added statements with the appropriate context.
InlineContext* context = callStmt->gtInlineContext;
assert(context != nullptr);
for (Statement* addedStmt = callStmt->gtNextStmt; addedStmt != postStmt; addedStmt = addedStmt->gtNextStmt)
for (Statement* addedStmt = callStmt->GetNextStmt(); addedStmt != postStmt; addedStmt = addedStmt->GetNextStmt())
{
assert(addedStmt->gtInlineContext == nullptr);
addedStmt->gtInlineContext = context;
Expand Down
4 changes: 1 addition & 3 deletions src/jit/gentree.h
Original file line number Diff line number Diff line change
Expand Up @@ -5149,16 +5149,14 @@ struct Statement
#endif

public:
__declspec(property(get = getNextStmt)) Statement* gtNextStmt;

__declspec(property(get = getPrevStmt)) Statement* gtPrevStmt;

Statement* gtNext;
Statement* gtPrev;

bool compilerAdded;

Statement* getNextStmt()
Statement* GetNextStmt()
{
if (gtNext == nullptr)
{
Expand Down
2 changes: 1 addition & 1 deletion src/jit/importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1505,7 +1505,7 @@ GenTree* Compiler::impGetStructAddr(GenTree* structVal,
else
{
// Insert after the oldLastStmt before the first inserted for op2.
beforeStmt = oldLastStmt->getNextStmt();
beforeStmt = oldLastStmt->GetNextStmt();
}

impInsertTreeBefore(structVal->gtOp.gtOp1, impCurStmtOffs, beforeStmt);
Expand Down
34 changes: 17 additions & 17 deletions src/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7596,12 +7596,12 @@ GenTree* Compiler::fgMorphPotentialTailCall(GenTreeCall* call)
assert(treeWithCall == call);
}
#endif
Statement* nextMorphStmt = fgMorphStmt->gtNextStmt;
Statement* nextMorphStmt = fgMorphStmt->GetNextStmt();
// Remove all stmts after the call.
while (nextMorphStmt != nullptr)
{
Statement* stmtToRemove = nextMorphStmt;
nextMorphStmt = stmtToRemove->gtNextStmt;
nextMorphStmt = stmtToRemove->GetNextStmt();
fgRemoveStmt(compCurBB, stmtToRemove);
}

Expand Down Expand Up @@ -15566,7 +15566,7 @@ bool Compiler::fgMorphBlockStmt(BasicBlock* block, Statement* stmt DEBUGARG(cons
}

// Or this is the last statement of a conditional branch that was just folded?
if (!removedStmt && (stmt->getNextStmt() == nullptr) && !fgRemoveRestOfBlock)
if (!removedStmt && (stmt->GetNextStmt() == nullptr) && !fgRemoveRestOfBlock)
{
if (fgFoldConditional(block))
{
Expand Down Expand Up @@ -15649,7 +15649,7 @@ void Compiler::fgMorphStmts(BasicBlock* block, bool* lnot, bool* loadw)

Statement* stmt = block->firstStmt();
GenTree* prev = nullptr;
for (; stmt != nullptr; prev = stmt->gtStmtExpr, stmt = stmt->gtNextStmt)
for (; stmt != nullptr; prev = stmt->gtStmtExpr, stmt = stmt->GetNextStmt())
{
if (fgRemoveRestOfBlock)
{
Expand Down Expand Up @@ -15697,7 +15697,7 @@ void Compiler::fgMorphStmts(BasicBlock* block, bool* lnot, bool* loadw)
morph = stmt->gtStmtExpr;
noway_assert(compTailCallUsed);
noway_assert((morph->gtOper == GT_CALL) && morph->AsCall()->IsTailCall());
noway_assert(stmt->gtNextStmt == nullptr);
noway_assert(stmt->GetNextStmt() == nullptr);

GenTreeCall* call = morph->AsCall();
// Could either be
Expand All @@ -15721,7 +15721,7 @@ void Compiler::fgMorphStmts(BasicBlock* block, bool* lnot, bool* loadw)

noway_assert(compTailCallUsed);
noway_assert((tree->gtOper == GT_CALL) && tree->AsCall()->IsTailCall());
noway_assert(stmt->gtNextStmt == nullptr);
noway_assert(stmt->GetNextStmt() == nullptr);

GenTreeCall* call = morph->AsCall();

Expand Down Expand Up @@ -15984,7 +15984,7 @@ void Compiler::fgMorphBlocks()

// This block must be ending with a GT_RETURN
noway_assert(lastStmt != nullptr);
noway_assert(lastStmt->getNextStmt() == nullptr);
noway_assert(lastStmt->GetNextStmt() == nullptr);
noway_assert(ret != nullptr);

// GT_RETURN must have non-null operand as the method is returning the value assigned to
Expand Down Expand Up @@ -16021,7 +16021,7 @@ void Compiler::fgMorphBlocks()
{
// This block ends with a GT_RETURN
noway_assert(lastStmt != nullptr);
noway_assert(lastStmt->getNextStmt() == nullptr);
noway_assert(lastStmt->GetNextStmt() == nullptr);

// Must be a void GT_RETURN with null operand; delete it as this block branches to oneReturn
// block
Expand Down Expand Up @@ -18763,7 +18763,7 @@ bool Compiler::fgMorphCombineSIMDFieldAssignments(BasicBlock* block, Statement*
var_types simdType = getSIMDTypeForSize(simdSize);
int assignmentsCount = simdSize / genTypeSize(baseType) - 1;
int remainingAssignments = assignmentsCount;
Statement* curStmt = stmt->getNextStmt();
Statement* curStmt = stmt->GetNextStmt();
Statement* lastStmt = stmt;

while (curStmt != nullptr && remainingAssignments > 0)
Expand All @@ -18786,7 +18786,7 @@ bool Compiler::fgMorphCombineSIMDFieldAssignments(BasicBlock* block, Statement*
prevRHS = curRHS;

lastStmt = curStmt;
curStmt = curStmt->getNextStmt();
curStmt = curStmt->GetNextStmt();
}

if (remainingAssignments > 0)
Expand All @@ -18810,7 +18810,7 @@ bool Compiler::fgMorphCombineSIMDFieldAssignments(BasicBlock* block, Statement*

for (int i = 0; i < assignmentsCount; i++)
{
fgRemoveStmt(block, stmt->getNextStmt());
fgRemoveStmt(block, stmt->GetNextStmt());
}

GenTree* copyBlkDst = createAddressNodeForSIMDInit(originalLHS, simdSize);
Expand Down Expand Up @@ -18879,7 +18879,7 @@ Statement* SkipNopStmts(Statement* stmt)
{
while ((stmt != nullptr) && !stmt->IsNothingNode())
{
stmt = stmt->gtNextStmt;
stmt = stmt->GetNextStmt();
}
return stmt;
}
Expand All @@ -18904,7 +18904,7 @@ bool Compiler::fgCheckStmtAfterTailCall()
// the call.
Statement* callStmt = fgMorphStmt;

Statement* nextMorphStmt = callStmt->gtNextStmt;
Statement* nextMorphStmt = callStmt->GetNextStmt();

#if !defined(FEATURE_CORECLR) && defined(_TARGET_AMD64_)
// Legacy Jit64 Compat:
Expand Down Expand Up @@ -18946,7 +18946,7 @@ bool Compiler::fgCheckStmtAfterTailCall()
}
noway_assert(isSideEffectFree);

nextMorphStmt = popStmt->gtNextStmt;
nextMorphStmt = popStmt->GetNextStmt();
}

// Next skip any GT_NOP nodes after the pop
Expand All @@ -18969,7 +18969,7 @@ bool Compiler::fgCheckStmtAfterTailCall()
GenTree* retExpr = retStmt->gtStmtExpr;
noway_assert(retExpr->gtOper == GT_RETURN);

nextMorphStmt = retStmt->gtNextStmt;
nextMorphStmt = retStmt->GetNextStmt();
}
else
{
Expand All @@ -18991,7 +18991,7 @@ bool Compiler::fgCheckStmtAfterTailCall()
unsigned dstLclNum = moveExpr->gtGetOp1()->AsLclVarCommon()->gtLclNum;
callResultLclNumber = dstLclNum;

nextMorphStmt = moveStmt->gtNextStmt;
nextMorphStmt = moveStmt->GetNextStmt();
}
if (nextMorphStmt != nullptr)
#endif
Expand All @@ -19009,7 +19009,7 @@ bool Compiler::fgCheckStmtAfterTailCall()

noway_assert(callResultLclNumber == treeWithLcl->AsLclVarCommon()->gtLclNum);

nextMorphStmt = retStmt->gtNextStmt;
nextMorphStmt = retStmt->GetNextStmt();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/jit/optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4016,7 +4016,7 @@ static Statement* optFindLoopTermTest(BasicBlock* bottom)
#ifdef DEBUG
while (testStmt->gtNext != nullptr)
{
testStmt = testStmt->getNextStmt();
testStmt = testStmt->GetNextStmt();
}

assert(testStmt == result);
Expand Down
4 changes: 2 additions & 2 deletions src/jit/valuenum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5820,7 +5820,7 @@ void Compiler::fgValueNumberBlock(BasicBlock* blk)

// First: visit phi's. If "newVNForPhis", give them new VN's. If not,
// first check to see if all phi args have the same value.
for (; (stmt != nullptr) && stmt->IsPhiDefnStmt(); stmt = stmt->getNextStmt())
for (; (stmt != nullptr) && stmt->IsPhiDefnStmt(); stmt = stmt->GetNextStmt())
{
GenTree* asg = stmt->gtStmtExpr;
assert(asg->OperIs(GT_ASG));
Expand Down Expand Up @@ -5985,7 +5985,7 @@ void Compiler::fgValueNumberBlock(BasicBlock* blk)
}

// Now iterate over the remaining statements, and their trees.
for (; stmt != nullptr; stmt = stmt->getNextStmt())
for (; stmt != nullptr; stmt = stmt->GetNextStmt())
{
#ifdef DEBUG
if (verbose)
Expand Down