mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-28 06:58:19 +00:00
If a function has liveins, and if the target requested that they be plopped
into particular vregs, emit copies into the entry MBB. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23331 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f2cded73c4
commit
fa57702388
@ -24,6 +24,7 @@
|
|||||||
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
||||||
#include "llvm/CodeGen/SelectionDAG.h"
|
#include "llvm/CodeGen/SelectionDAG.h"
|
||||||
#include "llvm/CodeGen/SSARegMap.h"
|
#include "llvm/CodeGen/SSARegMap.h"
|
||||||
|
#include "llvm/Target/MRegisterInfo.h"
|
||||||
#include "llvm/Target/TargetData.h"
|
#include "llvm/Target/TargetData.h"
|
||||||
#include "llvm/Target/TargetFrameInfo.h"
|
#include "llvm/Target/TargetFrameInfo.h"
|
||||||
#include "llvm/Target/TargetInstrInfo.h"
|
#include "llvm/Target/TargetInstrInfo.h"
|
||||||
@ -1115,6 +1116,20 @@ LowerArguments(BasicBlock *BB, SelectionDAGLowering &SDL,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Next, if the function has live ins that need to be copied into vregs,
|
||||||
|
// emit the copies now, into the top of the block.
|
||||||
|
MachineFunction &MF = SDL.DAG.getMachineFunction();
|
||||||
|
if (MF.livein_begin() != MF.livein_end()) {
|
||||||
|
SSARegMap *RegMap = MF.getSSARegMap();
|
||||||
|
const MRegisterInfo &MRI = *MF.getTarget().getRegisterInfo();
|
||||||
|
for (MachineFunction::livein_iterator LI = MF.livein_begin(),
|
||||||
|
E = MF.livein_end(); LI != E; ++LI)
|
||||||
|
if (LI->second)
|
||||||
|
MRI.copyRegToReg(*MF.begin(), MF.begin()->end(), LI->second,
|
||||||
|
LI->first, RegMap->getRegClass(LI->second));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Finally, if the target has anything special to do, allow it to do so.
|
||||||
EmitFunctionEntryCode(F, SDL.DAG.getMachineFunction());
|
EmitFunctionEntryCode(F, SDL.DAG.getMachineFunction());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user