[llvm-commits] [llvm] r70704 - in /llvm/trunk/lib/Target/MSP430: MSP430ISelLowering.cpp MSP430RegisterInfo.cpp
Anton Korobeynikov
asl at math.spbu.ru
Sun May 3 06:00:11 PDT 2009
Author: asl
Date: Sun May 3 08:00:11 2009
New Revision: 70704
URL: http://llvm.org/viewvc/llvm-project?rev=70704&view=rev
Log:
Provide set of reserved registers
Modified:
llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp
llvm/trunk/lib/Target/MSP430/MSP430RegisterInfo.cpp
Modified: llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp?rev=70704&r1=70703&r2=70704&view=diff
==============================================================================
--- llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp Sun May 3 08:00:11 2009
@@ -80,8 +80,8 @@
/// generate load operations for arguments places on the stack.
// FIXME: struct return stuff
// FIXME: varargs
-SDValue MSP430TargetLowering:: LowerCCCArguments(SDValue Op,
- SelectionDAG &DAG) {
+SDValue MSP430TargetLowering::LowerCCCArguments(SDValue Op,
+ SelectionDAG &DAG) {
MachineFunction &MF = DAG.getMachineFunction();
MachineFrameInfo *MFI = MF.getFrameInfo();
MachineRegisterInfo &RegInfo = MF.getRegInfo();
@@ -193,8 +193,8 @@
Chain = DAG.getCopyToReg(Chain, dl, VA.getLocReg(),
Op.getOperand(i*2+1), Flag);
- // guarantee that all emitted copies are
- // stuck together, avoiding something bad
+ // Guarantee that all emitted copies are stuck together,
+ // avoiding something bad.
Flag = Chain.getValue(1);
}
Modified: llvm/trunk/lib/Target/MSP430/MSP430RegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430RegisterInfo.cpp?rev=70704&r1=70703&r2=70704&view=diff
==============================================================================
--- llvm/trunk/lib/Target/MSP430/MSP430RegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/MSP430/MSP430RegisterInfo.cpp Sun May 3 08:00:11 2009
@@ -38,7 +38,19 @@
BitVector
MSP430RegisterInfo::getReservedRegs(const MachineFunction &MF) const {
- assert(0 && "Not implemented yet!");
+ BitVector Reserved(getNumRegs());
+
+ // Mark 4 special registers as reserved.
+ Reserved.set(MSP430::PC);
+ Reserved.set(MSP430::SP);
+ Reserved.set(MSP430::SR);
+ Reserved.set(MSP430::CG);
+
+ // Mark frame pointer as reserved if needed.
+ if (hasFP(MF))
+ Reserved.set(MSP430::FP);
+
+ return Reserved;
}
bool MSP430RegisterInfo::hasFP(const MachineFunction &MF) const {
More information about the llvm-commits
mailing list