LLVM 24.0.0git
HexagonMachineFunctionInfo.cpp
Go to the documentation of this file.
1//= HexagonMachineFunctionInfo.cpp - Hexagon machine function info *- C++ -*-=//
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
12
13using namespace llvm;
14
15// pin vtable to this file
16void HexagonMachineFunctionInfo::anchor() {}
17
20 : SRetReturnReg(Other.SRetReturnReg),
21 StackAlignBaseReg(Other.StackAlignBaseReg),
22 VarArgsFrameIndex(Other.VarArgsFrameIndex),
23 RegSavedAreaStartFrameIndex(Other.RegSavedAreaStartFrameIndex),
24 FirstNamedArgFrameIndex(Other.FirstNamedArgFrameIndex),
25 LastNamedArgFrameIndex(Other.LastNamedArgFrameIndex),
26 HasClobberLR(Other.HasClobberLR), HasEHReturn(Other.HasEHReturn),
27 PacketInfo(Other.PacketInfo) {
28 DenseMap<int, int> ClonedIndices;
29 const MachineFrameInfo &OtherMFI = Other.VTCMFrameInfo;
30 for (int I = OtherMFI.getObjectIndexBegin(), E = OtherMFI.getObjectIndexEnd();
31 I != E; ++I) {
32 if (OtherMFI.isDeadObjectIndex(I))
33 continue;
34 int NewI = VTCMFrameInfo.CreateStackObject(
35 OtherMFI.getObjectSize(I), OtherMFI.getObjectAlign(I),
36 OtherMFI.isSpillSlotObjectIndex(I), OtherMFI.getObjectAllocation(I));
37 VTCMFrameInfo.setObjectOffset(NewI, OtherMFI.getObjectOffset(I));
38 ClonedIndices[I] = NewI;
39 }
40 VTCMFrameInfo.setStackSize(OtherMFI.getStackSize());
41 for (const auto &[From, To] : Other.VTCMMap)
42 VTCMMap[From] = ClonedIndices.lookup(To);
43}
44
51
53 const TargetRegisterInfo &TRI) {
55 if (Reg.isValid()) {
57 OS << printReg(Reg, &TRI);
58 }
59 return Dest;
60}
61
65
69
for(const MachineOperand &MO :llvm::drop_begin(OldMI.operands(), Desc.getNumOperands()))
#define I(x, y, z)
Definition MD5.cpp:57
Register Reg
Register const TargetRegisterInfo * TRI
static yaml::StringValue regToString(Register Reg, const TargetRegisterInfo &TRI)
ValueT lookup(const_arg_type_t< KeyT > Val) const
Return the entry for the specified key, or a default constructed value if no such entry exists.
Definition DenseMap.h:793
Hexagon target-specific information for each MachineFunction.
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::HexagonFunctionInfo &YamlMFI)
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
uint64_t getStackSize() const
Return the number of bytes that must be allocated to hold all of the fixed size frame objects.
int getObjectIndexEnd() const
Return one past the maximum frame object index.
int getObjectIndexBegin() const
Return the minimum frame object index.
Ty * cloneInfo(const Ty &Old)
Wrapper class representing virtual and physical registers.
Definition Register.h:20
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
A raw_ostream that writes to an std::string.
This is an optimization pass for GlobalISel generic memory operations.
@ Other
Any other memory.
Definition ModRef.h:68
BumpPtrAllocatorImpl<> BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
Definition Allocator.h:391
LLVM_ABI Printable printReg(Register Reg, const TargetRegisterInfo *TRI=nullptr, unsigned SubIdx=0, const MachineRegisterInfo *MRI=nullptr)
Prints virtual and physical registers with or without a TRI instance.
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
Hexagon-specific MachineFunction properties for YAML serialization.
void mappingImpl(yaml::IO &YamlIO) override
This class should be specialized by any type that needs to be converted to/from a YAML mapping.
Definition YAMLTraits.h:63
A wrapper around std::string which contains a source range that's being set during parsing.