LLVM  16.0.0git
Functions | Variables
Thumb1FrameLowering.cpp File Reference
#include "Thumb1FrameLowering.h"
#include "ARMBaseInstrInfo.h"
#include "ARMBaseRegisterInfo.h"
#include "ARMMachineFunctionInfo.h"
#include "ARMSubtarget.h"
#include "Thumb1InstrInfo.h"
#include "ThumbRegisterInfo.h"
#include "Utils/ARMBaseInfo.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/LivePhysRegs.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/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
#include "llvm/CodeGen/TargetOpcodes.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDwarf.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include <bitset>
#include <cassert>
#include <iterator>
#include <vector>
Include dependency graph for Thumb1FrameLowering.cpp:

Go to the source code of this file.

Functions

static void emitPrologueEpilogueSPUpdate (MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI, const TargetInstrInfo &TII, const DebugLoc &dl, const ThumbRegisterInfo &MRI, int NumBytes, unsigned ScratchReg, unsigned MIFlags)
 
static void emitCallSPUpdate (MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI, const TargetInstrInfo &TII, const DebugLoc &dl, const ThumbRegisterInfo &MRI, int NumBytes, unsigned MIFlags=MachineInstr::NoFlags)
 
static void findTemporariesForLR (const BitVector &GPRsNoLRSP, const BitVector &PopFriendly, const LivePhysRegs &UsedRegs, unsigned &PopReg, unsigned &TmpReg, MachineRegisterInfo &MRI)
 
static void splitLowAndHighRegs (const std::set< Register > &Regs, std::set< Register > &LowRegs, std::set< Register > &HighRegs)
 
template<typename It >
It getNextOrderedReg (It OrderedStartIt, It OrderedEndIt, const std::set< Register > &RegSet)
 
static void pushRegsToStack (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const TargetInstrInfo &TII, const std::set< Register > &RegsToSave, const std::set< Register > &CopyRegs)
 
static void popRegsFromStack (MachineBasicBlock &MBB, MachineBasicBlock::iterator &MI, const TargetInstrInfo &TII, const std::set< Register > &RegsToRestore, const std::set< Register > &AvailableCopyRegs, bool IsVarArg, bool HasV5Ops)
 

Variables

static const SmallVector< RegisterOrderedLowRegs
 
static const SmallVector< RegisterOrderedHighRegs
 
static const SmallVector< RegisterOrderedCopyRegs
 

Function Documentation

◆ emitCallSPUpdate()

static void emitCallSPUpdate ( MachineBasicBlock MBB,
MachineBasicBlock::iterator MBBI,
const TargetInstrInfo TII,
const DebugLoc dl,
const ThumbRegisterInfo MRI,
int  NumBytes,
unsigned  MIFlags = MachineInstr::NoFlags 
)
static

◆ emitPrologueEpilogueSPUpdate()

static void emitPrologueEpilogueSPUpdate ( MachineBasicBlock MBB,
MachineBasicBlock::iterator MBBI,
const TargetInstrInfo TII,
const DebugLoc dl,
const ThumbRegisterInfo MRI,
int  NumBytes,
unsigned  ScratchReg,
unsigned  MIFlags 
)
static

◆ findTemporariesForLR()

static void findTemporariesForLR ( const BitVector GPRsNoLRSP,
const BitVector PopFriendly,
const LivePhysRegs UsedRegs,
unsigned &  PopReg,
unsigned &  TmpReg,
MachineRegisterInfo MRI 
)
static

◆ getNextOrderedReg()

template<typename It >
It getNextOrderedReg ( It  OrderedStartIt,
It  OrderedEndIt,
const std::set< Register > &  RegSet 
)

Definition at line 861 of file Thumb1FrameLowering.cpp.

References llvm::find_if().

Referenced by popRegsFromStack(), and pushRegsToStack().

◆ popRegsFromStack()

static void popRegsFromStack ( MachineBasicBlock MBB,
MachineBasicBlock::iterator MI,
const TargetInstrInfo TII,
const std::set< Register > &  RegsToRestore,
const std::set< Register > &  AvailableCopyRegs,
bool  IsVarArg,
bool  HasV5Ops 
)
static

◆ pushRegsToStack()

static void pushRegsToStack ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
const TargetInstrInfo TII,
const std::set< Register > &  RegsToSave,
const std::set< Register > &  CopyRegs 
)
static

◆ splitLowAndHighRegs()

static void splitLowAndHighRegs ( const std::set< Register > &  Regs,
std::set< Register > &  LowRegs,
std::set< Register > &  HighRegs 
)
static

Definition at line 846 of file Thumb1FrameLowering.cpp.

References contains(), and llvm_unreachable.

Referenced by popRegsFromStack(), and pushRegsToStack().

Variable Documentation

◆ OrderedCopyRegs

const SmallVector<Register> OrderedCopyRegs
static
Initial value:
= {
ARM::R0, ARM::R1, ARM::R2, ARM::R3, ARM::R4,
ARM::R5, ARM::R6, ARM::R7, ARM::LR}

Definition at line 842 of file Thumb1FrameLowering.cpp.

Referenced by popRegsFromStack(), and pushRegsToStack().

◆ OrderedHighRegs

const SmallVector<Register> OrderedHighRegs
static
Initial value:
= {ARM::R8, ARM::R9,
ARM::R10, ARM::R11}

Definition at line 840 of file Thumb1FrameLowering.cpp.

Referenced by popRegsFromStack(), and pushRegsToStack().

◆ OrderedLowRegs

const SmallVector<Register> OrderedLowRegs
static
Initial value:
= {ARM::R4, ARM::R5, ARM::R6,
ARM::R7, ARM::LR}

Definition at line 838 of file Thumb1FrameLowering.cpp.

Referenced by popRegsFromStack(), and pushRegsToStack().

R4
#define R4(n)
R2
#define R2(n)
R6
#define R6(n)