summaryrefslogtreecommitdiff
path: root/src/jit/lsra.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/jit/lsra.cpp')
-rw-r--r--src/jit/lsra.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/jit/lsra.cpp b/src/jit/lsra.cpp
index e7c1c839d1..3718ddfb8a 100644
--- a/src/jit/lsra.cpp
+++ b/src/jit/lsra.cpp
@@ -1378,7 +1378,8 @@ void LinearScan::setBlockSequence()
assert(!"Switch with single successor");
}
- for (unsigned succIndex = 0; succIndex < block->NumSucc(compiler); succIndex++)
+ const unsigned numSuccs = block->NumSucc(compiler);
+ for (unsigned succIndex = 0; succIndex < numSuccs; succIndex++)
{
BasicBlock* succ = block->GetSucc(succIndex, compiler);
if (checkForCriticalOutEdge && succ->GetUniquePred(compiler) == nullptr)
@@ -4697,11 +4698,13 @@ void LinearScan::buildIntervals()
{
VarSetOps::DiffD(compiler, expUseSet, nextBlock->bbLiveIn);
}
- AllSuccessorIter succsEnd = block->GetAllSuccs(compiler).end();
- for (AllSuccessorIter succs = block->GetAllSuccs(compiler).begin();
- succs != succsEnd && !VarSetOps::IsEmpty(compiler, expUseSet); ++succs)
+ for (BasicBlock* succ : block->GetAllSuccs(compiler))
{
- BasicBlock* succ = (*succs);
+ if (VarSetOps::IsEmpty(compiler, expUseSet))
+ {
+ break;
+ }
+
if (isBlockVisited(succ))
{
continue;
@@ -9676,10 +9679,12 @@ void LinearScan::resolveEdge(BasicBlock* fromBlock,
// What interval is this register associated with?
// (associated with incoming reg)
- Interval* sourceIntervals[REG_COUNT] = {nullptr};
+ Interval* sourceIntervals[REG_COUNT];
+ memset(&sourceIntervals, 0, sizeof(sourceIntervals));
// Intervals for vars that need to be loaded from the stack
- Interval* stackToRegIntervals[REG_COUNT] = {nullptr};
+ Interval* stackToRegIntervals[REG_COUNT];
+ memset(&stackToRegIntervals, 0, sizeof(stackToRegIntervals));
// Get the starting insertion point for the "to" resolution
GenTreePtr insertionPoint = nullptr;