LLVM
17.0.0git
|
#include "X86FrameLowering.h"
#include "MCTargetDesc/X86MCTargetDesc.h"
#include "X86InstrBuilder.h"
#include "X86InstrInfo.h"
#include "X86MachineFunctionInfo.h"
#include "X86Subtarget.h"
#include "X86TargetMachine.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/EHPersonalities.h"
#include "llvm/CodeGen/LivePhysRegs.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/MCObjectFileInfo.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/Support/Debug.h"
#include "llvm/Target/TargetOptions.h"
#include <cstdlib>
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "x86-fl" |
Functions | |
STATISTIC (NumFrameLoopProbe, "Number of loop stack probes used in prologue") | |
STATISTIC (NumFrameExtraProbe, "Number of extra stack probes generated in prologue") | |
static unsigned | getSUBriOpcode (bool IsLP64, int64_t Imm) |
static unsigned | getADDriOpcode (bool IsLP64, int64_t Imm) |
static unsigned | getSUBrrOpcode (bool IsLP64) |
static unsigned | getADDrrOpcode (bool IsLP64) |
static unsigned | getANDriOpcode (bool IsLP64, int64_t Imm) |
static unsigned | getLEArOpcode (bool IsLP64) |
static unsigned | getMOVriOpcode (bool Use64BitReg, int64_t Imm) |
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... | |
static bool | blockEndIsUnreachable (const MachineBasicBlock &MBB, MachineBasicBlock::const_iterator MBBI) |
Variables | |
static const uint64_t | kSplitStackAvailable = 256 |
#define DEBUG_TYPE "x86-fl" |
Definition at line 39 of file X86FrameLowering.cpp.
|
static |
Definition at line 3168 of file X86FrameLowering.cpp.
References llvm::all_of(), llvm::MachineBasicBlock::end(), MBB, MBBI, MI, and llvm::MachineBasicBlock::successors().
Referenced by llvm::X86FrameLowering::eliminateCallFramePseudoInstr().
|
static |
Definition at line 1191 of file X86FrameLowering.cpp.
References llvm::min().
Referenced by llvm::X86FrameLowering::emitEpilogue(), llvm::X86FrameLowering::emitPrologue(), and llvm::X86FrameLowering::getFrameIndexReference().
|
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 182 of file X86FrameLowering.cpp.
References MBB, MI, llvm::MachineBasicBlock::successors(), and llvm::MachineBasicBlock::terminators().
Referenced by llvm::X86FrameLowering::canUseAsEpilogue().
|
static |
Definition at line 119 of file X86FrameLowering.cpp.
References llvm::RISCVMatInt::Imm.
Referenced by llvm::X86FrameLowering::restoreWin32EHStackPointers().
|
static |
Definition at line 135 of file X86FrameLowering.cpp.
Referenced by llvm::X86FrameLowering::emitSPUpdate().
|
static |
Definition at line 139 of file X86FrameLowering.cpp.
References llvm::RISCVMatInt::Imm.
|
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 3148 of file X86FrameLowering.cpp.
References llvm::numbers::e, llvm::NamedMDNode::getNumOperands(), and i.
Referenced by llvm::X86FrameLowering::adjustForHiPEPrologue().
|
static |
Definition at line 150 of file X86FrameLowering.cpp.
Referenced by llvm::X86FrameLowering::emitEpilogue().
|
static |
Definition at line 154 of file X86FrameLowering.cpp.
References llvm::RISCVMatInt::Imm.
Referenced by llvm::X86FrameLowering::adjustForSegmentedStacks(), llvm::X86FrameLowering::emitPrologue(), and llvm::X86FrameLowering::emitSPUpdate().
|
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 2872 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(), llvm::CallingConv::Tail, and llvm::CallingConv::X86_FastCall.
Referenced by llvm::X86FrameLowering::adjustForHiPEPrologue(), and llvm::X86FrameLowering::adjustForSegmentedStacks().
|
static |
Definition at line 107 of file X86FrameLowering.cpp.
References llvm::RISCVMatInt::Imm.
|
static |
Definition at line 131 of file X86FrameLowering.cpp.
Referenced by llvm::X86FrameLowering::emitSPUpdate().
|
static |
Definition at line 2857 of file X86FrameLowering.cpp.
References E, F, llvm::MachineFunction::getFunction(), and I.
Referenced by llvm::X86FrameLowering::adjustForSegmentedStacks(), and GetScratchRegister().
|
static |
Definition at line 165 of file X86FrameLowering.cpp.
References AH, llvm::AArch64CC::AL, llvm::N86::EAX, llvm::MachineBasicBlock::liveins(), and MBB.
Referenced by llvm::X86FrameLowering::emitPrologue(), and llvm::X86FrameLowering::emitSPUpdate().
|
static |
Definition at line 2096 of file X86FrameLowering.cpp.
References llvm::ISD::CATCHRET, llvm::ISD::CLEANUPRET, llvm_unreachable, and MI.
Referenced by llvm::X86FrameLowering::emitEpilogue(), and llvm::X86FrameLowering::restoreCalleeSavedRegisters().
|
static |
Definition at line 2162 of file X86FrameLowering.cpp.
Referenced by llvm::X86FrameLowering::emitEpilogue().
Definition at line 2907 of file X86FrameLowering.cpp.
Referenced by llvm::X86FrameLowering::adjustForSegmentedStacks().