From cdb3ba71ce550c5a41c84c3678225a39d6f0a414 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Tue, 31 Jul 2012 22:50:19 +0000 Subject: 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 --- lib/Target/Mips/MipsTargetMachine.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'lib/Target/Mips/MipsTargetMachine.cpp') diff --git a/lib/Target/Mips/MipsTargetMachine.cpp b/lib/Target/Mips/MipsTargetMachine.cpp index d16632453b..9480a77c74 100644 --- a/lib/Target/Mips/MipsTargetMachine.cpp +++ b/lib/Target/Mips/MipsTargetMachine.cpp @@ -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() { } -- cgit v1.2.3