Skip to content

Commit

Permalink
Load/Store constant offset propagation across basic blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
drmortalwombat committed Sep 21, 2021
1 parent 603b62b commit 9ec846c
Showing 1 changed file with 35 additions and 10 deletions.
45 changes: 35 additions & 10 deletions oscar64/InterCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2692,23 +2692,48 @@ void InterCodeBasicBlock::PerformMachineSpecificValueUsageCheck(const GrowingIns

if (!mVisited)
{
mVisited = true;

GrowingInstructionPtrArray ltvalue(tvalue);

tvalid.Clear();
GrowingInstructionPtrArray ltvalue(tvalue);

if (mNumEntries != 1)
if (mLoopHead)
{
ltvalue.Clear();
else
}
#if 0
else if (mNumEntries > 1)
{
lvalues.FlushAll();
ltvalue.Clear();
}
#endif
else if (mNumEntries > 0)
{
for (i = 0; i < tvalue.Size(); i++)
if (mNumEntered > 0)
{
for (int i = 0; i < ltvalue.Size(); i++)
{
if (mMergeTValues[i] != ltvalue[i])
ltvalue[i] = nullptr;
}
}

mNumEntered++;

if (mNumEntered < mNumEntries)
{
if (ltvalue[i])
tvalid += i;
mMergeTValues = ltvalue;
return;
}
}

mVisited = true;

tvalid.Clear();
for (i = 0; i < ltvalue.Size(); i++)
{
if (ltvalue[i])
tvalid += i;
}

for (i = 0; i < mInstructions.Size(); i++)
{
CheckValueUsage(mInstructions[i], ltvalue);
Expand Down

0 comments on commit 9ec846c

Please sign in to comment.