LLVM 19.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
14using namespace llvm;
15
18 : AMXProgModel(MFI.getAMXProgModel()) {}
19
22}
23
25 BumpPtrAllocator &Allocator, MachineFunction &DestMF,
27 const {
28 return DestMF.cloneInfo<X86MachineFunctionInfo>(*this);
29}
30
32 const yaml::X86MachineFunctionInfo &YamlMFI) {
33 AMXProgModel = YamlMFI.AMXProgModel;
34}
35
36void X86MachineFunctionInfo::anchor() { }
37
39 if (!RestoreBasePointerOffset) {
40 const X86RegisterInfo *RegInfo = static_cast<const X86RegisterInfo *>(
42 unsigned SlotSize = RegInfo->getSlotSize();
43 for (const MCPhysReg *CSR = MF->getRegInfo().getCalleeSavedRegs();
44 unsigned Reg = *CSR; ++CSR) {
45 if (X86::GR64RegClass.contains(Reg) || X86::GR32RegClass.contains(Reg))
46 RestoreBasePointerOffset -= SlotSize;
47 }
48 }
49}
50
IO & YamlIO
Definition: ELFYAML.cpp:1292
static bool contains(SmallPtrSetImpl< ConstantExpr * > &Cache, ConstantExpr *Expr, Constant *C)
Definition: Value.cpp:469
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:66
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Ty * cloneInfo(const Ty &Old)
const MCPhysReg * getCalleeSavedRegs() const
Returns list of callee saved registers.
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
X86MachineFunctionInfo - This class is derived from MachineFunction and contains private X86 target-s...
void setRestoreBasePointer(const MachineFunction *MF)
MachineFunctionInfo * clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF, const DenseMap< MachineBasicBlock *, MachineBasicBlock * > &Src2DstMBB) const override
Make a functionally equivalent copy of this MachineFunctionInfo in MF.
void initializeBaseYamlFields(const yaml::X86MachineFunctionInfo &YamlMFI)
unsigned getSlotSize() const
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
void mappingImpl(yaml::IO &YamlIO) override