|
LLVM 24.0.0git
|
#include "X86FrameLowering.h"#include "MCTargetDesc/X86MCTargetDesc.h"#include "X86.h"#include "X86InstrBuilder.h"#include "X86InstrInfo.h"#include "X86MachineFunctionInfo.h"#include "X86Subtarget.h"#include "X86TargetMachine.h"#include "llvm/ADT/Statistic.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/RegisterScavenging.h"#include "llvm/CodeGen/WinEHFuncInfo.h"#include "llvm/IR/DataLayout.h"#include "llvm/IR/EHPersonalities.h"#include "llvm/IR/Function.h"#include "llvm/IR/Module.h"#include "llvm/MC/MCAsmInfo.h"#include "llvm/MC/MCObjectFileInfo.h"#include "llvm/MC/MCSymbol.h"#include "llvm/Support/LEB128.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") | |
| STATISTIC (NumFunctionUsingPush2Pop2, "Number of functions using push2/pop2") | |
| static const TargetRegisterClass * | getCalleeSavedSpillRC (MCRegister Reg, const X86Subtarget &STI, const TargetRegisterInfo &TRI) |
| static unsigned | getSUBriOpcode (bool IsLP64) |
| static unsigned | getADDriOpcode (bool IsLP64) |
| 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 | getPUSHOpcode (const X86Subtarget &ST) |
| static unsigned | getPOPOpcode (const X86Subtarget &ST) |
| static unsigned | getPUSH2Opcode (const X86Subtarget &ST) |
| static unsigned | getPOP2Opcode (const X86Subtarget &ST) |
| static bool | isEAXLiveIn (MachineBasicBlock &MBB) |
| static bool | flagsNeedToBePreservedBeforeTheTerminators (const MachineBasicBlock &MBB) |
| Check if the flags need to be preserved before the terminators. | |
| static unsigned | calculateSetFPREG (uint64_t SPAdjust) |
| static bool | isOpcodeRep (unsigned Opcode) |
| Return true if an opcode is part of the REP group of instructions. | |
| static uint64_t | getUnusedLocalAreaPadding (const MachineFrameInfo &MFI) |
| Returns the number of bytes between the end of the fixed and callee-save area and the first local object, which PEI leaves as padding when it aligns the local objects relative to the incoming stack pointer. | |
| 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. | |
| static unsigned | getHiPELiteral (NamedMDNode *HiPELiteralsMD, const StringRef LiteralName) |
| Lookup an ERTS parameter in the !hipe.literals named metadata node. | |
| static bool | blockEndIsUnreachable (const MachineBasicBlock &MBB, MachineBasicBlock::const_iterator MBBI) |
| static int | computeFPBPAlignmentGap (MachineFunction &MF, const TargetRegisterClass *RC, unsigned NumSpilledRegs) |
| static bool | isFPBPAccess (const MachineInstr &MI, Register FP, Register BP, const TargetRegisterInfo *TRI, bool &AccessFP, bool &AccessBP) |
| static bool | isInvoke (const MachineInstr &MI, bool InsideEHLabels) |
Variables | |
| constexpr uint64_t | MaxSPChunk = (1ULL << 31) - 1 |
| static const uint64_t | kSplitStackAvailable = 256 |
| #define DEBUG_TYPE "x86-fl" |
Definition at line 41 of file X86FrameLowering.cpp.
|
static |
Definition at line 3830 of file X86FrameLowering.cpp.
References llvm::all_of(), MBB, MBBI, and MI.
Referenced by llvm::X86FrameLowering::eliminateCallFramePseudoInstr().
Definition at line 1360 of file X86FrameLowering.cpp.
References uint64_t.
Referenced by llvm::X86FrameLowering::emitEpilogue(), llvm::X86FrameLowering::emitPrologue(), and llvm::X86FrameLowering::getFrameIndexReference().
|
static |
Definition at line 4592 of file X86FrameLowering.cpp.
References llvm::alignTo(), llvm::TargetSubtargetInfo::getFrameLowering(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::TargetFrameLowering::getStackAlign(), llvm::MachineFunction::getSubtarget(), and TRI.
|
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 209 of file X86FrameLowering.cpp.
Referenced by llvm::X86FrameLowering::canUseAsEpilogue().
Definition at line 140 of file X86FrameLowering.cpp.
Referenced by llvm::X86FrameLowering::restoreWin32EHStackPointers().
Definition at line 148 of file X86FrameLowering.cpp.
Referenced by llvm::X86FrameLowering::emitSPUpdate().
Definition at line 152 of file X86FrameLowering.cpp.
References Imm.
|
static |
Definition at line 68 of file X86FrameLowering.cpp.
References contains(), Reg, and TRI.
Referenced by llvm::X86FrameLowering::assignCalleeSavedSpillSlots(), llvm::X86FrameLowering::restoreCalleeSavedRegisters(), and llvm::X86FrameLowering::spillCalleeSavedRegisters().
|
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 3808 of file X86FrameLowering.cpp.
References llvm::dyn_cast(), llvm::dyn_cast_or_null(), llvm::NamedMDNode::getNumOperands(), llvm::NamedMDNode::getOperand(), llvm::MDString::getString(), llvm::ValueAsMetadata::getValue(), llvm::ConstantInt::getZExtValue(), and llvm::report_fatal_error().
Referenced by llvm::X86FrameLowering::adjustForHiPEPrologue().
Definition at line 156 of file X86FrameLowering.cpp.
Referenced by llvm::X86FrameLowering::emitEpilogue().
|
static |
Definition at line 188 of file X86FrameLowering.cpp.
Referenced by llvm::X86FrameLowering::restoreCalleeSavedRegisters().
|
static |
Definition at line 181 of file X86FrameLowering.cpp.
Referenced by llvm::X86FrameLowering::emitEpilogue(), and llvm::X86FrameLowering::restoreCalleeSavedRegisters().
|
static |
Definition at line 185 of file X86FrameLowering.cpp.
Referenced by llvm::X86FrameLowering::spillCalleeSavedRegisters().
|
static |
Definition at line 177 of file X86FrameLowering.cpp.
Referenced by llvm::X86FrameLowering::emitPrologue(), and llvm::X86FrameLowering::spillCalleeSavedRegisters().
|
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 3508 of file X86FrameLowering.cpp.
References 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().
Definition at line 136 of file X86FrameLowering.cpp.
Definition at line 144 of file X86FrameLowering.cpp.
Referenced by llvm::X86FrameLowering::emitSPUpdate().
|
static |
Returns the number of bytes between the end of the fixed and callee-save area and the first local object, which PEI leaves as padding when it aligns the local objects relative to the incoming stack pointer.
Definition at line 1595 of file X86FrameLowering.cpp.
References assert(), llvm::TargetStackID::Default, llvm::MachineFrameInfo::getObjectIndexBegin(), llvm::MachineFrameInfo::getObjectIndexEnd(), llvm::MachineFrameInfo::getObjectOffset(), llvm::MachineFrameInfo::getObjectSize(), llvm::MachineFrameInfo::getStackID(), I, llvm::MachineFrameInfo::isDeadObjectIndex(), llvm::MachineFrameInfo::isFixedObjectIndex(), llvm::MachineFrameInfo::isVariableSizedObjectIndex(), llvm::seq(), and uint64_t.
Referenced by llvm::X86FrameLowering::emitPrologue().
|
static |
Definition at line 3494 of file X86FrameLowering.cpp.
References E(), F, llvm::MachineFunction::getFunction(), and I.
Referenced by llvm::X86FrameLowering::adjustForSegmentedStacks(), and GetScratchRegister().
|
static |
Definition at line 192 of file X86FrameLowering.cpp.
Referenced by llvm::X86FrameLowering::emitPrologue(), and llvm::X86FrameLowering::emitSPUpdate().
|
static |
Definition at line 4754 of file X86FrameLowering.cpp.
Referenced by llvm::X86FrameLowering::spillFPBP().
|
static |
Definition at line 2537 of file X86FrameLowering.cpp.
References llvm_unreachable, and MI.
|
static |
Definition at line 4774 of file X86FrameLowering.cpp.
Referenced by llvm::X86FrameLowering::spillFPBP().
Return true if an opcode is part of the REP group of instructions.
Definition at line 1565 of file X86FrameLowering.cpp.
Referenced by llvm::X86FrameLowering::emitPrologue().
Definition at line 2603 of file X86FrameLowering.cpp.
References Opc.
| STATISTIC | ( | NumFrameExtraProbe | , |
| "Number of extra stack probes generated in prologue" | ) |
| STATISTIC | ( | NumFrameLoopProbe | , |
| "Number of loop stack probes used in prologue" | ) |
| STATISTIC | ( | NumFunctionUsingPush2Pop2 | , |
| "Number of functions using push2/pop2" | ) |
Definition at line 3544 of file X86FrameLowering.cpp.
|
constexpr |
Definition at line 243 of file X86FrameLowering.cpp.
Referenced by llvm::X86FrameLowering::emitSPUpdate().