Skip to content

Commit

Permalink
Copy prop for argument sym at InlineeEnd should check if the copy-pro…
Browse files Browse the repository at this point in the history
…p candidate is live at InlineeStart
  • Loading branch information
rajatd committed May 7, 2018
1 parent c452be1 commit 1ee5250
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/Backend/GlobOptBailOut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,9 @@ GlobOpt::TrackCalls(IR::Instr * instr)
instr->m_func->m_hasInlineArgsOpt = true;
InlineeFrameInfo* frameInfo = InlineeFrameInfo::New(func->m_alloc);
instr->m_func->frameInfo = frameInfo;
frameInfo->floatSyms = currentBlock->globOptData.liveFloat64Syms->CopyNew(this->alloc);
frameInfo->intSyms = currentBlock->globOptData.liveInt32Syms->MinusNew(currentBlock->globOptData.liveLossyInt32Syms, this->alloc);
frameInfo->floatSyms = CurrentBlockData()->liveFloat64Syms->CopyNew(this->alloc);
frameInfo->intSyms = CurrentBlockData()->liveInt32Syms->MinusNew(CurrentBlockData()->liveLossyInt32Syms, this->alloc);
frameInfo->varSyms = CurrentBlockData()->liveVarSyms->CopyNew(this->alloc);
}
break;

Expand Down Expand Up @@ -769,7 +770,8 @@ void GlobOpt::RecordInlineeFrameInfo(IR::Instr* inlineeEnd)
if (value)
{
StackSym * copyPropSym = this->currentBlock->globOptData.GetCopyPropSym(argSym, value);
if (copyPropSym)
if (copyPropSym &&
frameInfo->varSyms->TestEmpty() && frameInfo->varSyms->Test(copyPropSym->m_id))
{
argSym = copyPropSym;
}
Expand Down Expand Up @@ -814,6 +816,8 @@ void GlobOpt::RecordInlineeFrameInfo(IR::Instr* inlineeEnd)
frameInfo->intSyms = nullptr;
JitAdelete(this->alloc, frameInfo->floatSyms);
frameInfo->floatSyms = nullptr;
JitAdelete(this->alloc, frameInfo->varSyms);
frameInfo->varSyms = nullptr;
frameInfo->isRecorded = true;
}

Expand Down
1 change: 1 addition & 0 deletions lib/Backend/InlineeFrameInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ struct InlineeFrameInfo
InlineeFrameRecord* record;
BVSparse<JitArenaAllocator>* floatSyms;
BVSparse<JitArenaAllocator>* intSyms;
BVSparse<JitArenaAllocator>* varSyms;

bool isRecorded;

Expand Down

0 comments on commit 1ee5250

Please sign in to comment.