LLVM  6.0.0svn
Functions | Variables
X86FrameLowering.cpp File Reference
#include "X86FrameLowering.h"
#include "X86InstrBuilder.h"
#include "X86InstrInfo.h"
#include "X86MachineFunctionInfo.h"
#include "X86Subtarget.h"
#include "X86TargetMachine.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/Analysis/EHPersonalities.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/WinEHFuncInfo.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Function.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/Support/Debug.h"
#include "llvm/Target/TargetOptions.h"
#include <cstdlib>
Include dependency graph for X86FrameLowering.cpp:

Go to the source code of this file.

Functions

static unsigned getSUBriOpcode (unsigned IsLP64, int64_t Imm)
 
static unsigned getADDriOpcode (unsigned IsLP64, int64_t Imm)
 
static unsigned getSUBrrOpcode (unsigned isLP64)
 
static unsigned getADDrrOpcode (unsigned isLP64)
 
static unsigned getANDriOpcode (bool IsLP64, int64_t Imm)
 
static unsigned getLEArOpcode (unsigned IsLP64)
 
static unsigned findDeadCallerSavedReg (MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI, const X86RegisterInfo *TRI, bool Is64Bit)
 findDeadCallerSavedReg - Return a caller-saved register that isn't live when it reaches the "return" instruction. More...
 
static bool isEAXLiveIn (MachineBasicBlock &MBB)
 
static bool flagsNeedToBePreservedBeforeTheTerminators (const MachineBasicBlock &MBB)
 Check if the flags need to be preserved before the terminators. More...
 
static unsigned calculateSetFPREG (uint64_t SPAdjust)
 
static bool isFuncletReturnInstr (MachineInstr &MI)
 
static bool isTailCallOpcode (unsigned Opc)
 
static bool HasNestArgument (const MachineFunction *MF)
 
static unsigned GetScratchRegister (bool Is64Bit, bool IsLP64, const MachineFunction &MF, bool Primary)
 GetScratchRegister - Get a temp register for performing work in the segmented stack and the Erlang/HiPE stack prologue. More...
 
static unsigned getHiPELiteral (NamedMDNode *HiPELiteralsMD, const StringRef LiteralName)
 Lookup an ERTS parameter in the !hipe.literals named metadata node. More...
 

Variables

static const uint64_t kSplitStackAvailable = 256
 

Function Documentation

◆ calculateSetFPREG()

static unsigned calculateSetFPREG ( uint64_t  SPAdjust)
static

◆ findDeadCallerSavedReg()

static unsigned findDeadCallerSavedReg ( MachineBasicBlock MBB,
MachineBasicBlock::iterator MBBI,
const X86RegisterInfo TRI,
bool  Is64Bit 
)
static

◆ flagsNeedToBePreservedBeforeTheTerminators()

static bool flagsNeedToBePreservedBeforeTheTerminators ( const MachineBasicBlock MBB)
static

Check if the flags need to be preserved before the terminators.

This would be the case, if the eflags is live-in of the region composed by the terminators or live-out of that region, without being defined by a terminator.

Definition at line 213 of file X86FrameLowering.cpp.

References MI, llvm::MachineBasicBlock::successors(), and llvm::MachineBasicBlock::terminators().

Referenced by llvm::X86FrameLowering::canUseAsEpilogue(), and llvm::X86FrameLowering::emitSPUpdate().

◆ getADDriOpcode()

static unsigned getADDriOpcode ( unsigned  IsLP64,
int64_t  Imm 
)
static

◆ getADDrrOpcode()

static unsigned getADDrrOpcode ( unsigned  isLP64)
static

Definition at line 124 of file X86FrameLowering.cpp.

Referenced by llvm::X86FrameLowering::emitSPUpdate().

◆ getANDriOpcode()

static unsigned getANDriOpcode ( bool  IsLP64,
int64_t  Imm 
)
static

Definition at line 128 of file X86FrameLowering.cpp.

References llvm::isInt< 8 >().

Referenced by calculateSetFPREG().

◆ getHiPELiteral()

static unsigned getHiPELiteral ( NamedMDNode HiPELiteralsMD,
const StringRef  LiteralName 
)
static

Lookup an ERTS parameter in the !hipe.literals named metadata node.

HiPE provides Erlang Runtime System-internal parameters, such as PCB offsets to fields it needs, through a named metadata node "hipe.literals" containing name-value pairs.

Definition at line 2383 of file X86FrameLowering.cpp.

References llvm::dyn_cast(), llvm::MDNode::getNumOperands(), llvm::NamedMDNode::getNumOperands(), llvm::MDNode::getOperand(), llvm::NamedMDNode::getOperand(), llvm::MDString::getString(), llvm::ConstantInt::getZExtValue(), and llvm::report_fatal_error().

Referenced by llvm::X86FrameLowering::adjustForHiPEPrologue().

◆ getLEArOpcode()

static unsigned getLEArOpcode ( unsigned  IsLP64)
static

◆ GetScratchRegister()

static unsigned GetScratchRegister ( bool  Is64Bit,
bool  IsLP64,
const MachineFunction MF,
bool  Primary 
)
static

GetScratchRegister - Get a temp register for performing work in the segmented stack and the Erlang/HiPE stack prologue.

Depending on platform and the properties of the function either one or two registers will be needed. Set primary to true for the first register, false for the second.

Definition at line 2111 of file X86FrameLowering.cpp.

References llvm::N86::EAX, llvm::N86::EBX, llvm::N86::ECX, llvm::N86::EDI, llvm::N86::EDX, llvm::CallingConv::Fast, llvm::Function::getCallingConv(), llvm::MachineFunction::getFunction(), HasNestArgument(), llvm::CallingConv::HiPE, llvm::report_fatal_error(), and llvm::CallingConv::X86_FastCall.

Referenced by llvm::X86FrameLowering::adjustForHiPEPrologue(), and llvm::X86FrameLowering::adjustForSegmentedStacks().

◆ getSUBriOpcode()

static unsigned getSUBriOpcode ( unsigned  IsLP64,
int64_t  Imm 
)
static

Definition at line 96 of file X86FrameLowering.cpp.

References llvm::isInt< 8 >().

Referenced by llvm::X86FrameLowering::emitSPUpdate().

◆ getSUBrrOpcode()

static unsigned getSUBrrOpcode ( unsigned  isLP64)
static

◆ HasNestArgument()

static bool HasNestArgument ( const MachineFunction MF)
static

◆ isEAXLiveIn()

static bool isEAXLiveIn ( MachineBasicBlock MBB)
static

◆ isFuncletReturnInstr()

static bool isFuncletReturnInstr ( MachineInstr MI)
static

◆ isTailCallOpcode()

static bool isTailCallOpcode ( unsigned  Opc)
static

Definition at line 1529 of file X86FrameLowering.cpp.

Referenced by llvm::X86FrameLowering::emitEpilogue().

Variable Documentation

◆ kSplitStackAvailable

const uint64_t kSplitStackAvailable = 256
static