Add definitions of two subclasses of MipsFrameLowering, Mips16FrameLowering and

MipsSEFrameLowering.

Implement MipsSEFrameLowering::hasReservedCallFrame. Call frames will not be
reserved if there is a call with a large call frame or there are variable sized
objects on the stack.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161090 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Akira Hatanaka
2012-07-31 22:50:19 +00:00
parent d7122b8d3c
commit cdb3ba71ce
10 changed files with 416 additions and 220 deletions

View File

@ -12,9 +12,11 @@
//===----------------------------------------------------------------------===//
#include "MipsTargetMachine.h"
#include "MipsSEInstrInfo.h"
#include "Mips16InstrInfo.h"
#include "Mips.h"
#include "Mips16FrameLowering.h"
#include "Mips16InstrInfo.h"
#include "MipsSEFrameLowering.h"
#include "MipsSEInstrInfo.h"
#include "llvm/PassManager.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/Support/TargetRegistry.h"
@ -39,6 +41,18 @@ static const MipsInstrInfo *genInstrInfo(MipsTargetMachine &TM) {
return II;
}
static const MipsFrameLowering *genFrameLowering(MipsTargetMachine &TM,
const MipsSubtarget &ST) {
const MipsFrameLowering *FL;
if (TM.getSubtargetImpl()->inMips16Mode())
FL = new Mips16FrameLowering(ST);
else
FL = new MipsSEFrameLowering(ST);
return FL;
}
// DataLayout --> Big-endian, 32-bit pointer/ABI/alignment
// The stack is always 8 byte aligned
// On function prologue, the stack is created by decrementing
@ -62,7 +76,7 @@ MipsTargetMachine(const Target &T, StringRef TT,
"E-p:64:64:64-i8:8:32-i16:16:32-i64:64:64-f128:128:128-n32" :
"E-p:32:32:32-i8:8:32-i16:16:32-i64:64:64-n32")),
InstrInfo(genInstrInfo(*this)),
FrameLowering(Subtarget),
FrameLowering(genFrameLowering(*this, Subtarget)),
TLInfo(*this), TSInfo(*this), JITInfo() {
}