mirror of
https://github.com/RPCSX/llvm.git
synced 2025-04-08 19:22:03 +00:00
Mips ISelLowering cleanup : Removed old LowerCALL and FORMAL_ARGS helpers, they
aren't used anyway, they also used to broke compiling when fastcc was specified for a function, but not anymore. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54316 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ea9d4d6ab0
commit
f7f3b50cd8
@ -556,34 +556,19 @@ LowerConstantPool(SDValue Op, SelectionDAG &DAG)
|
|||||||
// CALL Calling Convention Implementation
|
// CALL Calling Convention Implementation
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
/// Mips custom CALL implementation
|
|
||||||
SDValue MipsTargetLowering::
|
|
||||||
LowerCALL(SDValue Op, SelectionDAG &DAG)
|
|
||||||
{
|
|
||||||
unsigned CallingConv = cast<ConstantSDNode>(Op.getOperand(1))->getValue();
|
|
||||||
|
|
||||||
// By now, only CallingConv::C implemented
|
|
||||||
switch (CallingConv) {
|
|
||||||
default:
|
|
||||||
assert(0 && "Unsupported calling convention");
|
|
||||||
case CallingConv::Fast:
|
|
||||||
case CallingConv::C:
|
|
||||||
return LowerCCCCallTo(Op, DAG, CallingConv);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// LowerCCCCallTo - functions arguments are copied from virtual
|
/// LowerCCCCallTo - functions arguments are copied from virtual
|
||||||
/// regs to (physical regs)/(stack frame), CALLSEQ_START and
|
/// regs to (physical regs)/(stack frame), CALLSEQ_START and
|
||||||
/// CALLSEQ_END are emitted.
|
/// CALLSEQ_END are emitted.
|
||||||
/// TODO: isVarArg, isTailCall.
|
/// TODO: isVarArg, isTailCall.
|
||||||
SDValue MipsTargetLowering::
|
SDValue MipsTargetLowering::
|
||||||
LowerCCCCallTo(SDValue Op, SelectionDAG &DAG, unsigned CC)
|
LowerCALL(SDValue Op, SelectionDAG &DAG)
|
||||||
{
|
{
|
||||||
MachineFunction &MF = DAG.getMachineFunction();
|
MachineFunction &MF = DAG.getMachineFunction();
|
||||||
|
|
||||||
SDValue Chain = Op.getOperand(0);
|
SDValue Chain = Op.getOperand(0);
|
||||||
SDValue Callee = Op.getOperand(4);
|
SDValue Callee = Op.getOperand(4);
|
||||||
bool isVarArg = cast<ConstantSDNode>(Op.getOperand(2))->getValue() != 0;
|
bool isVarArg = cast<ConstantSDNode>(Op.getOperand(2))->getValue() != 0;
|
||||||
|
unsigned CC = DAG.getMachineFunction().getFunction()->getCallingConv();
|
||||||
|
|
||||||
MachineFrameInfo *MFI = MF.getFrameInfo();
|
MachineFrameInfo *MFI = MF.getFrameInfo();
|
||||||
|
|
||||||
@ -786,34 +771,20 @@ LowerCallResult(SDValue Chain, SDValue InFlag, SDNode *TheCall,
|
|||||||
// FORMAL_ARGUMENTS Calling Convention Implementation
|
// FORMAL_ARGUMENTS Calling Convention Implementation
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
/// Mips custom FORMAL_ARGUMENTS implementation
|
/// LowerFORMAL_ARGUMENTS - transform physical registers into
|
||||||
SDValue MipsTargetLowering::
|
|
||||||
LowerFORMAL_ARGUMENTS(SDValue Op, SelectionDAG &DAG)
|
|
||||||
{
|
|
||||||
unsigned CC = cast<ConstantSDNode>(Op.getOperand(1))->getValue();
|
|
||||||
switch(CC)
|
|
||||||
{
|
|
||||||
default:
|
|
||||||
assert(0 && "Unsupported calling convention");
|
|
||||||
case CallingConv::C:
|
|
||||||
return LowerCCCArguments(Op, DAG);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// LowerCCCArguments - transform physical registers into
|
|
||||||
/// virtual registers and generate load operations for
|
/// virtual registers and generate load operations for
|
||||||
/// arguments places on the stack.
|
/// arguments places on the stack.
|
||||||
/// TODO: isVarArg
|
/// TODO: isVarArg
|
||||||
SDValue MipsTargetLowering::
|
SDValue MipsTargetLowering::
|
||||||
LowerCCCArguments(SDValue Op, SelectionDAG &DAG)
|
LowerFORMAL_ARGUMENTS(SDValue Op, SelectionDAG &DAG)
|
||||||
{
|
{
|
||||||
SDValue Root = Op.getOperand(0);
|
SDValue Root = Op.getOperand(0);
|
||||||
MachineFunction &MF = DAG.getMachineFunction();
|
MachineFunction &MF = DAG.getMachineFunction();
|
||||||
MachineFrameInfo *MFI = MF.getFrameInfo();
|
MachineFrameInfo *MFI = MF.getFrameInfo();
|
||||||
MipsFunctionInfo *MipsFI = MF.getInfo<MipsFunctionInfo>();
|
MipsFunctionInfo *MipsFI = MF.getInfo<MipsFunctionInfo>();
|
||||||
|
|
||||||
bool isVarArg = cast<ConstantSDNode>(Op.getOperand(2))->getValue() != 0;
|
bool isVarArg = cast<ConstantSDNode>(Op.getOperand(2))->getValue() != 0;
|
||||||
unsigned CC = DAG.getMachineFunction().getFunction()->getCallingConv();
|
unsigned CC = DAG.getMachineFunction().getFunction()->getCallingConv();
|
||||||
|
|
||||||
unsigned StackReg = MF.getTarget().getRegisterInfo()->getFrameRegister(MF);
|
unsigned StackReg = MF.getTarget().getRegisterInfo()->getFrameRegister(MF);
|
||||||
|
|
||||||
|
@ -83,8 +83,6 @@ namespace llvm {
|
|||||||
const MipsSubtarget *Subtarget;
|
const MipsSubtarget *Subtarget;
|
||||||
|
|
||||||
// Lower Operand helpers
|
// Lower Operand helpers
|
||||||
SDValue LowerCCCArguments(SDValue Op, SelectionDAG &DAG);
|
|
||||||
SDValue LowerCCCCallTo(SDValue Op, SelectionDAG &DAG, unsigned CC);
|
|
||||||
SDNode *LowerCallResult(SDValue Chain, SDValue InFlag, SDNode*TheCall,
|
SDNode *LowerCallResult(SDValue Chain, SDValue InFlag, SDNode*TheCall,
|
||||||
unsigned CallingConv, SelectionDAG &DAG);
|
unsigned CallingConv, SelectionDAG &DAG);
|
||||||
bool IsGlobalInSmallSection(GlobalValue *GV);
|
bool IsGlobalInSmallSection(GlobalValue *GV);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user