LLVM  16.0.0git
X86MachineFunctionInfo.cpp
Go to the documentation of this file.
1 //===-- X86MachineFunctionInfo.cpp - X86 machine function info ------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
10 #include "X86RegisterInfo.h"
13 
14 using namespace llvm;
15 
19  const {
20  return DestMF.cloneInfo<X86MachineFunctionInfo>(*this);
21 }
22 
23 void X86MachineFunctionInfo::anchor() { }
24 
26  if (!RestoreBasePointerOffset) {
27  const X86RegisterInfo *RegInfo = static_cast<const X86RegisterInfo *>(
29  unsigned SlotSize = RegInfo->getSlotSize();
30  for (const MCPhysReg *CSR = MF->getRegInfo().getCalleeSavedRegs();
31  unsigned Reg = *CSR; ++CSR) {
32  if (X86::GR64RegClass.contains(Reg) || X86::GR32RegClass.contains(Reg))
33  RestoreBasePointerOffset -= SlotSize;
34  }
35  }
36 }
37 
llvm::X86MachineFunctionInfo::clone
MachineFunctionInfo * clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF, const DenseMap< MachineBasicBlock *, MachineBasicBlock * > &Src2DstMBB) const override
Make a functionally equivalent copy of this MachineFunctionInfo in MF.
Definition: X86MachineFunctionInfo.cpp:16
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
contains
return AArch64::GPR64RegClass contains(Reg)
llvm::X86MachineFunctionInfo::setRestoreBasePointer
void setRestoreBasePointer(const MachineFunction *MF)
Definition: X86MachineFunctionInfo.cpp:25
llvm::X86Disassembler::Reg
Reg
All possible values of the reg field in the ModR/M byte.
Definition: X86DisassemblerDecoder.h:462
llvm::TargetSubtargetInfo::getRegisterInfo
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
Definition: TargetSubtargetInfo.h:127
MachineRegisterInfo.h
X86MachineFunctionInfo.h
llvm::MachineFunction::getRegInfo
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Definition: MachineFunction.h:670
llvm::MachineFunction::getSubtarget
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Definition: MachineFunction.h:660
llvm::BumpPtrAllocatorImpl
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:63
llvm::DenseMap
Definition: DenseMap.h:714
llvm::MachineRegisterInfo::getCalleeSavedRegs
const MCPhysReg * getCalleeSavedRegs() const
Returns list of callee saved registers.
Definition: MachineRegisterInfo.cpp:623
llvm::X86MachineFunctionInfo
X86MachineFunctionInfo - This class is derived from MachineFunction and contains private X86 target-s...
Definition: X86MachineFunctionInfo.h:25
llvm::MachineFunction
Definition: MachineFunction.h:257
TargetSubtargetInfo.h
llvm::MachineFunction::cloneInfo
Ty * cloneInfo(const Ty &Old)
Definition: MachineFunction.h:769
uint16_t
X86RegisterInfo.h
llvm::X86RegisterInfo::getSlotSize
unsigned getSlotSize() const
Definition: X86RegisterInfo.h:158
Allocator
Basic Register Allocator
Definition: RegAllocBasic.cpp:143
llvm::MachineFunctionInfo
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
Definition: MachineFunction.h:95
llvm::X86RegisterInfo
Definition: X86RegisterInfo.h:24