diff options
Diffstat (limited to 'llvm/lib/Target/Mips/Mips16InstrInfo.cpp')
| -rw-r--r-- | llvm/lib/Target/Mips/Mips16InstrInfo.cpp | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/llvm/lib/Target/Mips/Mips16InstrInfo.cpp b/llvm/lib/Target/Mips/Mips16InstrInfo.cpp index 35ef31749f4..0f8fd337c2f 100644 --- a/llvm/lib/Target/Mips/Mips16InstrInfo.cpp +++ b/llvm/lib/Target/Mips/Mips16InstrInfo.cpp @@ -1,4 +1,4 @@ -//===-- Mips16InstrInfo.cpp - Mips16 Instruction Information --------------===// +//===- Mips16InstrInfo.cpp - Mips16 Instruction Information ---------------===// // // The LLVM Compiler Infrastructure // @@ -10,27 +10,38 @@ // This file contains the Mips16 implementation of the TargetInstrInfo class. // //===----------------------------------------------------------------------===// + #include "Mips16InstrInfo.h" -#include "InstPrinter/MipsInstPrinter.h" -#include "MipsMachineFunction.h" -#include "MipsTargetMachine.h" -#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/BitVector.h" +#include "llvm/CodeGen/MachineBasicBlock.h" +#include "llvm/CodeGen/MachineFrameInfo.h" +#include "llvm/CodeGen/MachineFunction.h" +#include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineInstrBuilder.h" -#include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/MachineMemOperand.h" +#include "llvm/CodeGen/MachineOperand.h" #include "llvm/CodeGen/RegisterScavenging.h" +#include "llvm/IR/DebugLoc.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/TargetRegistry.h" +#include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/Target/TargetRegisterInfo.h" +#include <cassert> #include <cctype> +#include <cstdint> +#include <cstdlib> +#include <cstring> +#include <iterator> +#include <vector> using namespace llvm; #define DEBUG_TYPE "mips16-instrinfo" Mips16InstrInfo::Mips16InstrInfo(const MipsSubtarget &STI) - : MipsInstrInfo(STI, Mips::Bimm16), RI() {} + : MipsInstrInfo(STI, Mips::Bimm16) {} const MipsRegisterInfo &Mips16InstrInfo::getRegisterInfo() const { return RI; @@ -71,12 +82,10 @@ void Mips16InstrInfo::copyPhysReg(MachineBasicBlock &MBB, else if ((SrcReg == Mips::HI0) && (Mips::CPU16RegsRegClass.contains(DestReg))) Opc = Mips::Mfhi16, SrcReg = 0; - else if ((SrcReg == Mips::LO0) && (Mips::CPU16RegsRegClass.contains(DestReg))) Opc = Mips::Mflo16, SrcReg = 0; - assert(Opc && "Cannot copy registers"); MachineInstrBuilder MIB = BuildMI(MBB, I, DL, get(Opc)); @@ -190,6 +199,7 @@ static void addSaveRestoreRegs(MachineInstrBuilder &MIB, } } } + // Adjust SP by FrameSize bytes. Save RA, S0, S1 void Mips16InstrInfo::makeFrame(unsigned SP, int64_t FrameSize, MachineBasicBlock &MBB, @@ -256,7 +266,6 @@ void Mips16InstrInfo::restoreFrame(unsigned SP, int64_t FrameSize, // This can only be called at times that we know that there is at least one free // register. // This is clearly safe at prologue and epilogue. -// void Mips16InstrInfo::adjustStackPtrBig(unsigned SP, int64_t Amount, MachineBasicBlock &MBB, MachineBasicBlock::iterator I, @@ -486,7 +495,6 @@ bool Mips16InstrInfo::validImmediate(unsigned Opcode, unsigned Reg, /// We implement the special case of the .space directive taking only an /// integer argument, which is the size in bytes. This is used for creating /// inline code spacing for testing purposes using inline assembly. -/// unsigned Mips16InstrInfo::getInlineAsmLength(const char *Str, const MCAsmInfo &MAI) const { |

