1//===-- M68kFrameLowering.cpp - M68k Frame Information ----------*- C++ -*-===// 3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4// See https://llvm.org/LICENSE.txt for license information. 5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7//===----------------------------------------------------------------------===// 10/// This file contains the M68k implementation of TargetFrameLowering class. 12//===----------------------------------------------------------------------===// 36#define DEBUG_TYPE "m68k-frame" 40TII(*STI.getInstrInfo()),
TRI(STI.getRegisterInfo()) {
51TRI->hasStackRealignment(MF);
54// FIXME Make sure no other factors prevent us from reserving call frame 63 (
hasFP(MF) && !TRI->hasStackRealignment(MF)) ||
73// NOTE: this only has a subset of the full frame index logic. In 74// particular, the FI < 0 and AfterFPPop logic is handled in 75// M68kRegisterInfo::eliminateFrameIndex, but not here. Possibly 76// (probably?) it should be moved into here. 82// We can't calculate offset from frame pointer if the stack is realigned, 83// so enforce usage of stack/base pointer. The base pointer is used when we 84// have dynamic allocas in addition to dynamic realignment. 87elseif (TRI->hasStackRealignment(MF))
92// Offset will hold the offset from the stack pointer at function entry to the 94// We need to factor in additional offsets applied during the prologue to the 95// frame, base, and stack pointer depending on which is used. 101// TODO: Support tail calls 103assert(HasFP &&
"VLAs and dynamic stack realign, but no FP?!");
112if (TRI->hasStackRealignment(MF)) {
128// Skip the RETADDR move area 130if (TailCallReturnAddrDelta < 0)
131Offset -= TailCallReturnAddrDelta;
136/// Return a caller-saved register that isn't live 137/// when it reaches the "return" instruction. We can then pop a stack object 138/// to this register without worry about clobbering it. 151switch (
MBBI->getOpcode()) {
154case TargetOpcode::PATCHABLE_RET:
158for (
unsigned i = 0, e =
MBBI->getNumOperands(); i != e; ++i) {
169for (
auto CS : AvailableRegs)
181 return RegMask.PhysReg == Reg;
186M68kFrameLowering::calculateMaxStackAlign(
constMachineFunction &MF)
const{
192 MaxAlign = (StackAlign > MaxAlign) ? StackAlign : MaxAlign;
193elseif (MaxAlign < SlotSize)
204unsigned AndOp = M68k::AND32di;
205unsigned MovOp = M68k::MOV32rr;
207// This function is normally used with SP which is Address Register, but AND, 208// or any other logical instructions in M68k do not support ARs so we need 209// to use a temp Data Register to perform the op. 210unsigned Tmp = M68k::D0;
221// The CCR implicit def is dead. 222MI->getOperand(3).setIsDead();
233unsigned Opcode =
I->getOpcode();
236uint64_t Amount =
I->getOperand(0).getImm();
237uint64_t InternalAmt = (IsDestroy || Amount) ?
I->getOperand(1).getImm() : 0;
240if (!ReserveCallFrame) {
241// If the stack pointer can be changed after prologue, turn the 242// adjcallstackup instruction into a 'sub %SP, <amt>' and the 243// adjcallstackdown instruction into 'add %SP, <amt>' 245// We need to keep the stack aligned properly. To do this, we round the 246// amount of space needed for the outgoing arguments up to the next 247// alignment boundary. 249 Amount =
alignTo(Amount, StackAlign);
253// If we have any exception handlers in this function, and we adjust 254// the SP before calls, we may need to indicate this to the unwinder 255// using GNU_ARGS_SIZE. Note that this may be necessary even when 256// Amount == 0, because the preceding function may have set a non-0 258// TODO: We don't need to reset this between subsequent functions, 259// if it didn't change. 262if (HasDwarfEHHandlers && !IsDestroy &&
271// Factor out the amount that gets handled inside the sequence 272// (Pushes of argument for frame setup, callee pops for frame destroy) 273 Amount -= InternalAmt;
275// TODO: This is needed only if we require precise CFA. 276// If this is a callee-pop calling convention, emit a CFA adjust for 277// the amount the callee popped. 282// Add Amount to SP to destroy a frame, or subtract to setup. 283 int64_t StackAdjustment = IsDestroy ? Amount : -Amount;
284 int64_t CfaAdjustment = -StackAdjustment;
286if (StackAdjustment) {
287// Merge with any previous or following adjustment instruction. Note: the 288// instructions merged with here do not have CFI, so their stack 289// adjustments do not feed into CfaAdjustment. 293if (StackAdjustment) {
294 BuildStackAdjustment(
MBB,
I,
DL, StackAdjustment,
false);
299// If we don't have FP, but need to generate unwind information, 300// we need to set the correct CFA offset after the stack adjustment. 301// How much we adjust the CFA offset depends on whether we're emitting 302// CFI only for EH purposes or for debugging. EH only requires the CFA 303// offset to be correct at each call site, while for debugging we want 304// it to be more precise. 306// TODO: When not using precise CFA, we also need to adjust for the 318if (IsDestroy && InternalAmt) {
319// If we are performing frame pointer elimination and if the callee pops 320// something off the stack pointer, add it back. We do this until we have 321// more advanced stack pointer tracking ability. 322// We are not tracking the stack pointer adjustment by the callee, so make 323// sure we restore the stack pointer immediately after the call, there may 324// be spill code inserted between the CALL and ADJCALLSTACKUP instructions. 327while (CI !=
B && !std::prev(CI)->isCall())
329 BuildStackAdjustment(
MBB, CI,
DL, -InternalAmt,
/*InEpilogue=*/false);
335/// Emit a series of instructions to increment / decrement the stack pointer by 339 int64_t NumBytes,
bool InEpilogue)
const{
340bool IsSub = NumBytes < 0;
348// Rather than emit a long series of instructions for large offsets, 349// load the offset into a register and do one sub/add 358unsigned Opc = M68k::MOV32ri;
360 Opc = IsSub ? M68k::SUB32ar : M68k::ADD32ar;
365MI->getOperand(3).setIsDead();
// The CCR implicit def is dead. 374MBB,
MBBI,
DL, IsSub ? -ThisVal : ThisVal, InEpilogue);
386bool MergeWithPrevious)
const{
393 MergeWithPrevious ? nullptr : std::next(
MBBI);
394unsigned Opc = PI->getOpcode();
397if (!MergeWithPrevious && NI !=
MBB.
end() &&
398 NI->getOpcode() == TargetOpcode::CFI_INSTRUCTION) {
399// Don't merge with the next instruction if it has CFI. 403if (Opc == M68k::ADD32ai && PI->getOperand(0).getReg() == StackPtr) {
404assert(PI->getOperand(1).getReg() == StackPtr);
405Offset += PI->getOperand(2).getImm();
407if (!MergeWithPrevious)
409 }
elseif (Opc == M68k::SUB32ai && PI->getOperand(0).getReg() == StackPtr) {
410assert(PI->getOperand(1).getReg() == StackPtr);
411Offset -= PI->getOperand(2).getImm();
413if (!MergeWithPrevious)
423assert(
Offset != 0 &&
"zero offset stack adjustment requested");
425// TODO can `lea` be used to adjust stack? 429unsigned Opc = IsSub ? M68k::SUB32ai : M68k::ADD32ai;
434// FIXME Update CCR as well. For now we just 435// conservatively say CCR implicit def is dead 436MI->getOperand(3).setIsDead();
450void M68kFrameLowering::emitPrologueCalleeSavedFrameMoves(
457// Add callee saved registers to move list. 463for (
constauto &
I : CSI) {
467unsigned DwarfReg =
MRI->getDwarfRegNum(Reg,
true);
476"MF used frame lowering for wrong subtarget");
481uint64_t MaxAlign = calculateMaxStackAlign(MF);
// Desired stack alignment. 483bool HasFP =
hasFP(MF);
486constunsigned MachineFramePtr =
FramePtr;
489// Debug location must be unknown since the first debug location is used 490// to determine the end of the prologue. 493// Add RETADDR move area to callee saved frame size. 496if (TailCallReturnAddrDelta < 0) {
498 TailCallReturnAddrDelta);
501// Insert stack pointer adjustment for later moving of return addr. Only 502// applies to tail call optimized functions where the callee argument stack 503// size is bigger than the callers. 504if (TailCallReturnAddrDelta < 0) {
505 BuildStackAdjustment(
MBB,
MBBI,
DL, TailCallReturnAddrDelta,
510// Mapping for machine moves: 513// SRC: VirtualFP => DW_CFA_def_cfa_offset 514// ELSE => DW_CFA_def_cfa 517// DST: Register => DW_CFA_def_cfa_register 520// OFFSET < 0 => DW_CFA_offset_extended_sf 521// REG < 64 => DW_CFA_offset + Reg 522// ELSE => DW_CFA_offset_extended 525int stackGrowth = -SlotSize;
528// Calculate required stack adjustment. 529uint64_t FrameSize = StackSize - SlotSize;
530// If required, include space for extra hidden slot for stashing base 533 FrameSize += SlotSize;
537// Callee-saved registers are pushed on stack before the stack is realigned. 538if (TRI->hasStackRealignment(MF))
539 NumBytes =
alignTo(NumBytes, MaxAlign);
541// Get the offset of the stack slot for the FP register, which is 542// guaranteed to be the last slot by processFunctionBeforeFrameFinalized. 543// Update the frame offset adjustment. 552// Mark the place where FP was saved. 553// Define the current CFA rule to use the provided offset. 558// Change the rule for the FramePtr to be an "offset" rule. 559int DwarfFramePtr = TRI->getDwarfRegNum(MachineFramePtr,
true);
567// Mark effective beginning of when frame pointer becomes valid. 568// Define the current CFA to use the FP register. 569unsigned DwarfFramePtr = TRI->getDwarfRegNum(MachineFramePtr,
true);
574// Mark the FramePtr as live-in in every block. Don't do this again for 577 EveryMBB.addLiveIn(MachineFramePtr);
582// Skip the callee-saved push instructions. 583bool PushedRegs =
false;
587MBBI->getOpcode() == M68k::PUSH32r) {
591if (!HasFP && NeedsDwarfCFI) {
592// Mark callee-saved push instruction. 593// Define the current CFA rule to use the provided offset. 601// Realign stack after we pushed callee-saved registers (so that we'll be 602// able to calculate their offsets from the frame pointer). 603if (TRI->hasStackRealignment(MF)) {
604assert(HasFP &&
"There should be a frame pointer if stack is realigned.");
605 BuildStackAlignAND(
MBB,
MBBI,
DL, StackPtr, MaxAlign);
608// If there is an SUB32ri of SP immediately before this instruction, merge 609// the two. This can be the case when tail call elimination is enabled and 610// the callee has more arguments then the caller. 613// Adjust stack pointer: ESP -= numbytes. 617unsigned SPOrEstablisher = StackPtr;
619// If we need a base pointer, set it up here. It's whatever the value 620// of the stack pointer is at this point. Any variable size objects 621// will be allocated after this, so we can still use the base pointer 622// to reference locals. 624// Update the base pointer with the current stack pointer. 629// Stash value of base pointer. Saving SP instead of FP shortens 630// dependence chain. Used by SjLj EH. 631unsigned Opm = M68k::MOV32ja;
640if (((!HasFP && NumBytes) || PushedRegs) && NeedsDwarfCFI) {
641// Mark end of stack pointer adjustment. 642if (!HasFP && NumBytes) {
643// Define the current CFA rule to use the provided offset. 650// Emit DWARF info specifying the offsets of the callee-saved registers. 652 emitPrologueCalleeSavedFrameMoves(
MBB,
MBBI,
DL);
655// TODO Interrupt handlers 656// M68k Interrupt handling function cannot assume anything about the 657// direction flag (DF in CCR register). Clear this flag by creating "cld" 658// instruction in each prologue of interrupt handler function. The "cld" 659// instruction should only in these cases: 660// 1. The interrupt handling function uses any of the "rep" instructions. 661// 2. Interrupt handling function calls another function. 665return Opc == M68k::TCRETURNj || Opc == M68k::TCRETURNq;
673 std::optional<unsigned> RetOpcode;
675 RetOpcode =
MBBI->getOpcode();
682// Get the number of bytes to allocate from the FrameInfo. 684uint64_t MaxAlign = calculateMaxStackAlign(MF);
689// Calculate required stack adjustment. 690uint64_t FrameSize = StackSize - SlotSize;
691 NumBytes = FrameSize - CSSize;
693// Callee-saved registers were pushed on stack before the stack was 695if (TRI->hasStackRealignment(MF))
696 NumBytes =
alignTo(FrameSize, MaxAlign);
699 NumBytes = StackSize - CSSize;
702// Skip the callee-saved pop instructions. 705unsigned Opc = PI->getOpcode();
708 Opc != M68k::DBG_VALUE && !PI->isTerminator())
718// If there is an ADD32ri or SUB32ri of SP immediately before this 719// instruction, merge the two instructions. 723// If dynamic alloca is used, then reset SP to point to the last callee-saved 724// slot before popping them off! Same applies for the case, when stack was 725// realigned. Don't do this if this was a funclet epilogue, since the funclets 726// will not do realignment or dynamic stack allocation. 728if (TRI->hasStackRealignment(MF))
732// 'move %FramePtr, SP' will not be recognized as an epilogue sequence. 733// However, we may use this sequence if we have a frame pointer because the 734// effects of the prologue can safely be undone. 736unsigned Opc = M68k::LEA32p;
747 }
elseif (
hasFP(MF)) {
752// Adjust stack pointer back: SP += numbytes. 758// Add the return addr area delta back since we are not tail calling. 760assert(
Offset >= 0 &&
"TCDelta should never be positive");
764// Check for possible merge with preceding ADD instruction. 781if (TailCallReturnAddrDelta < 0) {
782// create RETURNADDR area 792 TailCallReturnAddrDelta - SlotSize,
true);
795// Spill the BasePtr if it's used. 803 std::vector<CalleeSavedInfo> &CSI)
const{
810// emitPrologue always spills frame register the first thing. 811 SpillSlotOffset -= SlotSize;
814// Since emitPrologue and emitEpilogue will handle spilling and restoring of 815// the frame register, we can delete it from CSI list and not have to worry 816// about avoiding it later. 818for (
unsigned i = 0, e = CSI.size(); i < e; ++i) {
819if (
TRI->regsOverlap(CSI[i].getReg(),
FPReg)) {
820 CSI.erase(CSI.begin() + i);
838for (
constauto &
Info : CSI) {
839 FI = std::max(FI,
Info.getFrameIdx());
841unsigned Shift =
MRI.getSpillRegisterOrder(Reg);
850// Append implicit registers and mem locations 853for (
constauto &
Info : CSI) {
873for (
constauto &
Info : CSI) {
874 FI = std::max(FI,
Info.getFrameIdx());
876unsigned Shift =
MRI.getSpillRegisterOrder(Reg);
884// Append implicit registers and mem locations 885for (
constauto &
Info : CSI) {
unsigned const MachineRegisterInfo * MRI
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
MachineBasicBlock MachineBasicBlock::iterator MBBI
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Analysis containing CSE Info
const HexagonInstrInfo * TII
static bool isRegLiveIn(MachineBasicBlock &MBB, unsigned Reg)
static bool isTailCallOpcode(unsigned Opc)
static unsigned findDeadCallerSavedReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI, const M68kRegisterInfo *TRI)
Return a caller-saved register that isn't live when it reaches the "return" instruction.
This file contains the M68k declaration of TargetFrameLowering class.
This file exposes functions that may be used with BuildMI from the MachineInstrBuilder....
This file contains the M68k implementation of the TargetInstrInfo class.
This file declares the M68k specific subclass of MachineFunctionInfo.
This file declares the M68k specific subclass of TargetSubtargetInfo.
unsigned const TargetRegisterInfo * TRI
static constexpr Register FPReg
Remove Loads Into Fake Uses
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallSet class.
static const unsigned FramePtr
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
bool hasFPImpl(const MachineFunction &MF) const override
Return true if the specified function should have a dedicated frame pointer register.
void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs, RegScavenger *RS=nullptr) const override
This method determines which of the registers reported by TargetRegisterInfo::getCalleeSavedRegs() sh...
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override
Insert epilog code into the function.
void emitSPUpdate(MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI, int64_t NumBytes, bool InEpilogue) const
Emit a series of instructions to increment / decrement the stack pointer by a constant value.
bool assignCalleeSavedSpillSlots(MachineFunction &MF, const TargetRegisterInfo *TRI, std::vector< CalleeSavedInfo > &CSI) const override
Allows target to override spill slot assignment logic.
bool spillCalleeSavedRegisters(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, ArrayRef< CalleeSavedInfo > CSI, const TargetRegisterInfo *TRI) const override
Issues instruction(s) to spill all callee saved registers and returns true if it isn't possible / pro...
bool hasReservedCallFrame(const MachineFunction &MF) const override
Under normal circumstances, when a frame pointer is not required, we reserve argument space for call ...
M68kFrameLowering(const M68kSubtarget &sti, Align Alignment)
int mergeSPUpdates(MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI, bool doMergeWithPrevious) const
Check the instruction before/after the passed instruction.
StackOffset getFrameIndexReference(const MachineFunction &MF, int FI, Register &FrameReg) const override
This method should return the base register and offset used to reference a frame index location.
MachineBasicBlock::iterator eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const override
This method is called during prolog/epilog code insertion to eliminate call frame setup and destroy p...
void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override
Insert prolog code into the function.
bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, MutableArrayRef< CalleeSavedInfo > CSI, const TargetRegisterInfo *TRI) const override
Issues instruction(s) to restore all callee saved registers and returns true if it isn't possible / p...
bool canSimplifyCallFramePseudos(const MachineFunction &MF) const override
If there is a reserved call frame, the call frame pseudos can be simplified.
bool needsFrameIndexResolution(const MachineFunction &MF) const override
int getRestoreBasePointerOffset() const
unsigned getCalleeSavedFrameSize() const
bool getRestoreBasePointer() const
void setCalleeSavedFrameSize(unsigned bytes)
bool getHasPushSequences() const
int getTCReturnAddrDelta() const
Register getFrameRegister(const MachineFunction &MF) const override
unsigned getBaseRegister() const
bool hasBasePointer(const MachineFunction &MF) const
unsigned getStackRegister() const
unsigned getSlotSize() const
getSlotSize - Stack slot size in bytes.
const M68kRegisterInfo * getRegisterInfo() const override
static MCCFIInstruction createDefCfaRegister(MCSymbol *L, unsigned Register, SMLoc Loc={})
.cfi_def_cfa_register modifies a rule for computing CFA.
static MCCFIInstruction createGnuArgsSize(MCSymbol *L, int64_t Size, SMLoc Loc={})
A special wrapper for .cfi_escape that indicates GNU_ARGS_SIZE.
static MCCFIInstruction createOffset(MCSymbol *L, unsigned Register, int64_t Offset, SMLoc Loc={})
.cfi_offset Previous value of Register is saved at offset Offset from CFA.
static MCCFIInstruction cfiDefCfaOffset(MCSymbol *L, int64_t Offset, SMLoc Loc={})
.cfi_def_cfa_offset modifies a rule for computing CFA.
static MCCFIInstruction createAdjustCfaOffset(MCSymbol *L, int64_t Adjustment, SMLoc Loc={})
.cfi_adjust_cfa_offset Same as .cfi_def_cfa_offset, but Offset is a relative value that is added/subt...
const MCRegisterInfo * getRegisterInfo() const
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode.
MCRegAliasIterator enumerates all registers aliasing Reg.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
iterator_range< livein_iterator > liveins() const
iterator getFirstTerminator()
Returns an iterator to the first terminator instruction of this basic block.
DebugLoc findDebugLoc(instr_iterator MBBI)
Find the next valid DebugLoc starting at MBBI, skipping any debug instructions.
void addLiveIn(MCRegister PhysReg, LaneBitmask LaneMask=LaneBitmask::getAll())
Adds the specified register as a live in.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
instr_iterator erase(instr_iterator I)
Remove an instruction from the instruction list and delete it.
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
int CreateFixedObject(uint64_t Size, int64_t SPOffset, bool IsImmutable, bool isAliased=false)
Create a new object at a fixed location on the stack.
bool hasVarSizedObjects() const
This method may be called any time after instruction selection is complete to determine if the stack ...
uint64_t getStackSize() const
Return the number of bytes that must be allocated to hold all of the fixed size frame objects.
bool hasCalls() const
Return true if the current function has any function calls.
bool isFrameAddressTaken() const
This method may be called any time after instruction selection is complete to determine if there is a...
Align getMaxAlign() const
Return the alignment in bytes that this function must be aligned to, which is greater than the defaul...
Align getObjectAlign(int ObjectIdx) const
Return the alignment of the specified stack object.
const std::vector< CalleeSavedInfo > & getCalleeSavedInfo() const
Returns a reference to call saved info vector for the current function.
bool hasStackObjects() const
Return true if there are any stack objects in this function.
int CreateFixedSpillStackObject(uint64_t Size, int64_t SPOffset, bool IsImmutable=false)
Create a spill slot at a fixed location on the stack.
int64_t getObjectOffset(int ObjectIdx) const
Return the assigned stack offset of the specified object from the incoming stack pointer.
void setOffsetAdjustment(int64_t Adj)
Set the correction for frame offsets.
unsigned addFrameInst(const MCCFIInstruction &Inst)
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
bool needsFrameMoves() const
True if this function needs frame moves for debug or exceptions.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
MCContext & getContext() const
bool callsEHReturn() const
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Function & getFunction()
Return the LLVM function that this machine code represents.
const std::vector< LandingPadInfo > & getLandingPads() const
Return a reference to the landing pad info for the current function.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
const MachineInstrBuilder & addCFIIndex(unsigned CFIIndex) const
const MachineInstrBuilder & setMIFlag(MachineInstr::MIFlag Flag) const
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
Representation of each machine instruction.
MachineOperand class - Representation of each machine instruction operand.
bool isReg() const
isReg - Tests if this is a MO_Register operand.
Register getReg() const
getReg - Returns the register number.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
bool isLiveIn(Register Reg) const
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
Wrapper class representing virtual and physical registers.
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
StackOffset holds a fixed and a scalable offset in bytes.
int64_t getFixed() const
Returns the fixed component of the stack.
Information about stack frame layout on the target.
unsigned getStackAlignment() const
getStackAlignment - This method returns the number of bytes to which the stack pointer must be aligne...
bool hasFP(const MachineFunction &MF) const
hasFP - Return true if the specified function should have a dedicated frame pointer register.
virtual void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs, RegScavenger *RS=nullptr) const
This method determines which of the registers reported by TargetRegisterInfo::getCalleeSavedRegs() sh...
int getOffsetOfLocalArea() const
getOffsetOfLocalArea - This method returns the offset of the local area from the stack pointer on ent...
unsigned getCallFrameDestroyOpcode() const
bool DisableFramePointerElim(const MachineFunction &MF) const
DisableFramePointerElim - This returns true if frame pointer elimination optimization should be disab...
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
static const MachineInstrBuilder & addMemOperand(const MachineInstrBuilder &MIB, int FI, int Offset=0)
static const MachineInstrBuilder & addFrameReference(const MachineInstrBuilder &MIB, int FI, int Offset=0)
addFrameReference - This function is used to add a reference to the base of an abstract object on the...
static const MachineInstrBuilder & addRegIndirectWithDisp(const MachineInstrBuilder &MIB, Register Reg, bool IsKill, int Offset)
addRegIndirectWithDisp - This function is used to add a memory reference of the form (Offset,...
@ Implicit
Not emitted register (e.g. carry, or temporary result).
@ Kill
The last use of a register.
Reg
All possible values of the reg field in the ModR/M byte.
This is an optimization pass for GlobalISel generic memory operations.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
@ DwarfCFI
DWARF-like instruction based exceptions.
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
This struct is a compact representation of a valid (non-zero power of two) alignment.
uint64_t value() const
This is a hole in the type system and should not be abused.
Pair of physical register and lane mask.