Skip to content

Commit

Permalink
use insert functions from LinearScan instead of Lowerer
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeHolman committed Sep 22, 2016
1 parent 35a44f6 commit f2be1ed
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
14 changes: 14 additions & 0 deletions lib/Backend/LinearScan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4965,3 +4965,17 @@ IR::Instr* LinearScan::InsertMove(IR::Opnd *dst, IR::Opnd *src, IR::Instr *const

return instrRet;
}

IR::Instr* LinearScan::InsertLea(IR::RegOpnd *dst, IR::Opnd *src, IR::Instr *const insertBeforeInstr)
{
IR::Instr *instrPrev = insertBeforeInstr->m_prev;

IR::Instr *instrRet = Lowerer::InsertLea(dst, src, insertBeforeInstr);

for (IR::Instr *instr = instrPrev->m_next; instr != insertBeforeInstr; instr = instr->m_next)
{
instr->CopyNumber(insertBeforeInstr);
}

return instrRet;
}
1 change: 1 addition & 0 deletions lib/Backend/LinearScan.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,5 +220,6 @@ class LinearScan
#endif

static IR::Instr * InsertMove(IR::Opnd *dst, IR::Opnd *src, IR::Instr *const insertBeforeInstr);
static IR::Instr * InsertLea(IR::RegOpnd *dst, IR::Opnd *src, IR::Instr *const insertBeforeInstr);

};
6 changes: 3 additions & 3 deletions lib/Backend/arm/LinearScanMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,14 @@ LinearScanMD::GenerateBailOut(
// ldimm r0, dataAddr
intptr_t nativeDataAddr = func->GetWorkItem()->GetWorkItemData()->nativeDataAddr;
IR::RegOpnd * r0 = IR::RegOpnd::New(nullptr, RegR0, TyMachPtr, func);
Lowerer::InsertMove(r0, IR::AddrOpnd::New(nativeDataAddr, IR::AddrOpndKindDynamicNativeCodeDataRef, func), instr);
LinearScan::InsertMove(r0, IR::AddrOpnd::New(nativeDataAddr, IR::AddrOpndKindDynamicNativeCodeDataRef, func), instr);

// mov r0, [r0]
Lowerer::InsertMove(r0, IR::IndirOpnd::New(r0, 0, TyMachPtr, func), instr);
LinearScan::InsertMove(r0, IR::IndirOpnd::New(r0, 0, TyMachPtr, func), instr);

// lea r0, [r0 + bailoutRecord_offset]
unsigned int bailoutRecordOffset = NativeCodeData::GetDataTotalOffset(bailOutInfo->bailOutRecord);
Lowerer::InsertLea(
LinearScan::InsertLea(
r0,
IR::IndirOpnd::New(r0, bailoutRecordOffset, TyUint32,
#if DBG
Expand Down

0 comments on commit f2be1ed

Please sign in to comment.