Skip to content

Commit cc5a1b3

Browse files
committed
llvm-reduce: Add cloning of target MachineFunctionInfo
MIR support is totally unusable for AMDGPU without this, since the set of reserved registers is set from fields here. Add a clone method to MachineFunctionInfo. This is a subtle variant of the copy constructor that is required if there are any MIR constructs that use pointers. Specifically, at minimum fields that reference MachineBasicBlocks or the MachineFunction need to be adjusted to the values in the new function.
1 parent cfe5168 commit cc5a1b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+453
-20
lines changed

llvm/include/llvm/CodeGen/MachineFunction.h

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,22 @@ struct MachineFunctionInfo {
103103
static Ty *create(BumpPtrAllocator &Allocator, MachineFunction &MF) {
104104
return new (Allocator.Allocate<Ty>()) Ty(MF);
105105
}
106+
107+
template <typename Ty>
108+
static Ty *create(BumpPtrAllocator &Allocator, const Ty &MFI) {
109+
return new (Allocator.Allocate<Ty>()) Ty(MFI);
110+
}
111+
112+
/// Make a functionally equivalent copy of this MachineFunctionInfo in \p MF.
113+
/// This requires remapping MachineBasicBlock references from the original
114+
/// parent to values in the new function. Targets may assume that virtual
115+
/// register and frame index values are preserved in the new function.
116+
virtual MachineFunctionInfo *
117+
clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF,
118+
const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)
119+
const {
120+
return nullptr;
121+
}
106122
};
107123

108124
/// Properties which a MachineFunction may have at a given point in time.
@@ -746,6 +762,21 @@ class LLVM_EXTERNAL_VISIBILITY MachineFunction {
746762
return const_cast<MachineFunction*>(this)->getInfo<Ty>();
747763
}
748764

765+
template <typename Ty> Ty *cloneInfo(const Ty &Old) {
766+
assert(!MFInfo);
767+
MFInfo = Ty::template create<Ty>(Allocator, Old);
768+
return static_cast<Ty *>(MFInfo);
769+
}
770+
771+
MachineFunctionInfo *cloneInfoFrom(
772+
const MachineFunction &OrigMF,
773+
const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB) {
774+
assert(!MFInfo && "new function already has MachineFunctionInfo");
775+
if (!OrigMF.MFInfo)
776+
return nullptr;
777+
return OrigMF.MFInfo->clone(Allocator, *this, Src2DstMBB);
778+
}
779+
749780
/// Returns the denormal handling type for the default rounding mode of the
750781
/// function.
751782
DenormalMode getDenormalMode(const fltSemantics &FPType) const;

llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.cpp

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ static bool ShouldSignWithBKey(const Function &F) {
8080
return Key.equals_insensitive("b_key");
8181
}
8282

83-
AArch64FunctionInfo::AArch64FunctionInfo(MachineFunction &MF) : MF(MF) {
83+
AArch64FunctionInfo::AArch64FunctionInfo(MachineFunction &MF_) : MF(&MF_) {
8484
// If we already know that the function doesn't have a redzone, set
8585
// HasRedZone here.
86-
if (MF.getFunction().hasFnAttribute(Attribute::NoRedZone))
86+
if (MF->getFunction().hasFnAttribute(Attribute::NoRedZone))
8787
HasRedZone = false;
8888

89-
const Function &F = MF.getFunction();
89+
const Function &F = MF->getFunction();
9090
std::tie(SignReturnAddress, SignReturnAddressAll) = GetSignReturnAddress(F);
9191
SignWithBKey = ShouldSignWithBKey(F);
9292

@@ -104,6 +104,15 @@ AArch64FunctionInfo::AArch64FunctionInfo(MachineFunction &MF) : MF(MF) {
104104
BranchTargetEnforcement = BTIEnable.equals_insensitive("true");
105105
}
106106

107+
MachineFunctionInfo *AArch64FunctionInfo::clone(
108+
BumpPtrAllocator &Allocator, MachineFunction &DestMF,
109+
const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)
110+
const {
111+
AArch64FunctionInfo *InfoClone = DestMF.cloneInfo<AArch64FunctionInfo>(*this);
112+
InfoClone->MF = &DestMF;
113+
return InfoClone;
114+
}
115+
107116
bool AArch64FunctionInfo::shouldSignReturnAddress(bool SpillsLR) const {
108117
if (!SignReturnAddress)
109118
return false;
@@ -114,21 +123,21 @@ bool AArch64FunctionInfo::shouldSignReturnAddress(bool SpillsLR) const {
114123

115124
bool AArch64FunctionInfo::shouldSignReturnAddress() const {
116125
return shouldSignReturnAddress(llvm::any_of(
117-
MF.getFrameInfo().getCalleeSavedInfo(),
126+
MF->getFrameInfo().getCalleeSavedInfo(),
118127
[](const auto &Info) { return Info.getReg() == AArch64::LR; }));
119128
}
120129

121130
bool AArch64FunctionInfo::needsDwarfUnwindInfo() const {
122131
if (!NeedsDwarfUnwindInfo)
123-
NeedsDwarfUnwindInfo = MF.needsFrameMoves() &&
124-
!MF.getTarget().getMCAsmInfo()->usesWindowsCFI();
132+
NeedsDwarfUnwindInfo = MF->needsFrameMoves() &&
133+
!MF->getTarget().getMCAsmInfo()->usesWindowsCFI();
125134

126135
return *NeedsDwarfUnwindInfo;
127136
}
128137

129138
bool AArch64FunctionInfo::needsAsyncDwarfUnwindInfo() const {
130139
if (!NeedsAsyncDwarfUnwindInfo) {
131-
const Function &F = MF.getFunction();
140+
const Function &F = MF->getFunction();
132141
// The check got "minsize" is because epilogue unwind info is not emitted
133142
// (yet) for homogeneous epilogues, outlined functions, and functions
134143
// outlined from.

llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class MachineInstr;
3737
/// contains private AArch64-specific information for each MachineFunction.
3838
class AArch64FunctionInfo final : public MachineFunctionInfo {
3939
/// Backreference to the machine function.
40-
MachineFunction &MF;
40+
MachineFunction *MF;
4141

4242
/// Number of bytes of arguments this function has on the stack. If the callee
4343
/// is expected to restore the argument stack this should be a multiple of 16,
@@ -184,6 +184,11 @@ class AArch64FunctionInfo final : public MachineFunctionInfo {
184184
public:
185185
explicit AArch64FunctionInfo(MachineFunction &MF);
186186

187+
MachineFunctionInfo *
188+
clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF,
189+
const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)
190+
const override;
191+
187192
void initializeBaseYamlFields(const yaml::AArch64FunctionInfo &YamlMFI);
188193

189194
unsigned getBytesInStackArgArea() const { return BytesInStackArgArea; }

llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,13 @@ SIMachineFunctionInfo::SIMachineFunctionInfo(const MachineFunction &MF)
195195
}
196196
}
197197

198+
MachineFunctionInfo *SIMachineFunctionInfo::clone(
199+
BumpPtrAllocator &Allocator, MachineFunction &DestMF,
200+
const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)
201+
const {
202+
return DestMF.cloneInfo<SIMachineFunctionInfo>(*this);
203+
}
204+
198205
void SIMachineFunctionInfo::limitOccupancy(const MachineFunction &MF) {
199206
limitOccupancy(getMaxWavesPerEU());
200207
const GCNSubtarget& ST = MF.getSubtarget<GCNSubtarget>();

llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,12 @@ class SIMachineFunctionInfo final : public AMDGPUMachineFunction {
533533

534534
public:
535535
SIMachineFunctionInfo(const MachineFunction &MF);
536+
SIMachineFunctionInfo(const SIMachineFunctionInfo &MFI) = default;
537+
538+
MachineFunctionInfo *
539+
clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF,
540+
const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)
541+
const override;
536542

537543
bool initializeBaseYamlFields(const yaml::SIMachineFunctionInfo &YamlMFI,
538544
const MachineFunction &MF,

llvm/lib/Target/ARC/ARCMachineFunctionInfo.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,10 @@
1111
using namespace llvm;
1212

1313
void ARCFunctionInfo::anchor() {}
14+
15+
MachineFunctionInfo *
16+
ARCFunctionInfo::clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF,
17+
const DenseMap<MachineBasicBlock *, MachineBasicBlock *>
18+
&Src2DstMBB) const {
19+
return DestMF.cloneInfo<ARCFunctionInfo>(*this);
20+
}

llvm/lib/Target/ARC/ARCMachineFunctionInfo.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,13 @@ class ARCFunctionInfo : public MachineFunctionInfo {
3434
explicit ARCFunctionInfo(MachineFunction &MF)
3535
: ReturnStackOffsetSet(false), VarArgsFrameIndex(0),
3636
ReturnStackOffset(-1U), MaxCallStackReq(0) {}
37-
3837
~ARCFunctionInfo() {}
3938

39+
MachineFunctionInfo *
40+
clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF,
41+
const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)
42+
const override;
43+
4044
void setVarArgsFrameIndex(int off) { VarArgsFrameIndex = off; }
4145
int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
4246

llvm/lib/Target/ARM/ARMMachineFunctionInfo.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,10 @@ ARMFunctionInfo::ARMFunctionInfo(MachineFunction &MF)
7373
std::tie(SignReturnAddress, SignReturnAddressAll) =
7474
GetSignReturnAddress(MF.getFunction());
7575
}
76+
77+
MachineFunctionInfo *
78+
ARMFunctionInfo::clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF,
79+
const DenseMap<MachineBasicBlock *, MachineBasicBlock *>
80+
&Src2DstMBB) const {
81+
return DestMF.cloneInfo<ARMFunctionInfo>(*this);
82+
}

llvm/lib/Target/ARM/ARMMachineFunctionInfo.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ class ARMFunctionInfo : public MachineFunctionInfo {
158158

159159
explicit ARMFunctionInfo(MachineFunction &MF);
160160

161+
MachineFunctionInfo *
162+
clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF,
163+
const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)
164+
const override;
165+
161166
bool isThumbFunction() const { return isThumb; }
162167
bool isThumb1OnlyFunction() const { return isThumb && !hasThumb2; }
163168
bool isThumb2Function() const { return isThumb && hasThumb2; }

llvm/lib/Target/AVR/AVRMachineFunctionInfo.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ class AVRMachineFunctionInfo : public MachineFunctionInfo {
6161
MF.getFunction().hasFnAttribute("signal");
6262
}
6363

64+
MachineFunctionInfo *
65+
clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF,
66+
const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)
67+
const override {
68+
return DestMF.cloneInfo<AVRMachineFunctionInfo>(*this);
69+
}
70+
6471
bool getHasSpills() const { return HasSpills; }
6572
void setHasSpills(bool B) { HasSpills = B; }
6673

llvm/lib/Target/CSKY/CSKYMachineFunctionInfo.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ class CSKYMachineFunctionInfo : public MachineFunctionInfo {
3333
public:
3434
CSKYMachineFunctionInfo(MachineFunction &) {}
3535

36+
MachineFunctionInfo *
37+
clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF,
38+
const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)
39+
const override {
40+
return DestMF.cloneInfo<CSKYMachineFunctionInfo>(*this);
41+
}
42+
3643
Register getGlobalBaseReg() const { return GlobalBaseReg; }
3744
void setGlobalBaseReg(Register Reg) { GlobalBaseReg = Reg; }
3845

llvm/lib/Target/Hexagon/HexagonMachineFunctionInfo.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ using namespace llvm;
1313
// pin vtable to this file
1414
void HexagonMachineFunctionInfo::anchor() {}
1515

16+
MachineFunctionInfo *HexagonMachineFunctionInfo::clone(
17+
BumpPtrAllocator &Allocator, MachineFunction &DestMF,
18+
const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)
19+
const {
20+
return DestMF.cloneInfo<HexagonMachineFunctionInfo>(*this);
21+
}

llvm/lib/Target/Hexagon/HexagonMachineFunctionInfo.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ class HexagonMachineFunctionInfo : public MachineFunctionInfo {
4242
HexagonMachineFunctionInfo() = default;
4343

4444
HexagonMachineFunctionInfo(MachineFunction &MF) {}
45+
MachineFunctionInfo *
46+
clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF,
47+
const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)
48+
const override;
4549

4650
unsigned getSRetReturnReg() const { return SRetReturnReg; }
4751
void setSRetReturnReg(unsigned Reg) { SRetReturnReg = Reg; }

llvm/lib/Target/Lanai/LanaiMachineFunctionInfo.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,10 @@
1111
using namespace llvm;
1212

1313
void LanaiMachineFunctionInfo::anchor() {}
14+
15+
MachineFunctionInfo *LanaiMachineFunctionInfo::clone(
16+
BumpPtrAllocator &Allocator, MachineFunction &DestMF,
17+
const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)
18+
const {
19+
return DestMF.cloneInfo<LanaiMachineFunctionInfo>(*this);
20+
}

llvm/lib/Target/Lanai/LanaiMachineFunctionInfo.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ class LanaiMachineFunctionInfo : public MachineFunctionInfo {
4040
public:
4141
explicit LanaiMachineFunctionInfo(MachineFunction &MF)
4242
: VarArgsFrameIndex(0) {}
43+
MachineFunctionInfo *
44+
clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF,
45+
const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)
46+
const override;
4347

4448
Register getSRetReturnReg() const { return SRetReturnReg; }
4549
void setSRetReturnReg(Register Reg) { SRetReturnReg = Reg; }

llvm/lib/Target/LoongArch/LoongArchMachineFunctionInfo.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ class LoongArchMachineFunctionInfo : public MachineFunctionInfo {
3535
public:
3636
LoongArchMachineFunctionInfo(const MachineFunction &MF) {}
3737

38+
MachineFunctionInfo *
39+
clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF,
40+
const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)
41+
const override {
42+
return DestMF.cloneInfo<LoongArchMachineFunctionInfo>(*this);
43+
}
44+
3845
int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
3946
void setVarArgsFrameIndex(int Index) { VarArgsFrameIndex = Index; }
4047

llvm/lib/Target/M68k/M68kMachineFunction.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,10 @@
1818
using namespace llvm;
1919

2020
void M68kMachineFunctionInfo::anchor() {}
21+
22+
MachineFunctionInfo *M68kMachineFunctionInfo::clone(
23+
BumpPtrAllocator &Allocator, MachineFunction &DestMF,
24+
const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)
25+
const {
26+
return DestMF.cloneInfo<M68kMachineFunctionInfo>(*this);
27+
}

llvm/lib/Target/M68k/M68kMachineFunction.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
namespace llvm {
2222

2323
class M68kMachineFunctionInfo : public MachineFunctionInfo {
24-
MachineFunction &MF;
25-
2624
/// Non-zero if the function has base pointer and makes call to
2725
/// llvm.eh.sjlj.setjmp. When non-zero, the value is a displacement from the
2826
/// frame pointer to a slot where the base pointer is stashed.
@@ -68,7 +66,12 @@ class M68kMachineFunctionInfo : public MachineFunctionInfo {
6866
unsigned ArgumentStackSize = 0;
6967

7068
public:
71-
explicit M68kMachineFunctionInfo(MachineFunction &MF) : MF(MF) {}
69+
explicit M68kMachineFunctionInfo() = default;
70+
71+
MachineFunctionInfo *
72+
clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF,
73+
const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)
74+
const override;
7275

7376
bool getRestoreBasePointer() const { return RestoreBasePointerOffset != 0; }
7477
void setRestoreBasePointer(const MachineFunction *MF);

llvm/lib/Target/MSP430/MSP430MachineFunctionInfo.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,10 @@
1111
using namespace llvm;
1212

1313
void MSP430MachineFunctionInfo::anchor() { }
14+
15+
MachineFunctionInfo *MSP430MachineFunctionInfo::clone(
16+
BumpPtrAllocator &Allocator, MachineFunction &DestMF,
17+
const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)
18+
const {
19+
return DestMF.cloneInfo<MSP430MachineFunctionInfo>(*this);
20+
}

llvm/lib/Target/MSP430/MSP430MachineFunctionInfo.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ class MSP430MachineFunctionInfo : public MachineFunctionInfo {
4343
explicit MSP430MachineFunctionInfo(MachineFunction &MF)
4444
: CalleeSavedFrameSize(0), ReturnAddrIndex(0), SRetReturnReg(0) {}
4545

46+
MachineFunctionInfo *
47+
clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF,
48+
const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)
49+
const override;
50+
4651
unsigned getCalleeSavedFrameSize() const { return CalleeSavedFrameSize; }
4752
void setCalleeSavedFrameSize(unsigned bytes) { CalleeSavedFrameSize = bytes; }
4853

llvm/lib/Target/Mips/MipsMachineFunction.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ static cl::opt<bool>
2222
FixGlobalBaseReg("mips-fix-global-base-reg", cl::Hidden, cl::init(true),
2323
cl::desc("Always use $gp as the global base register."));
2424

25+
MachineFunctionInfo *
26+
MipsFunctionInfo::clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF,
27+
const DenseMap<MachineBasicBlock *, MachineBasicBlock *>
28+
&Src2DstMBB) const {
29+
return DestMF.cloneInfo<MipsFunctionInfo>(*this);
30+
}
31+
2532
MipsFunctionInfo::~MipsFunctionInfo() = default;
2633

2734
bool MipsFunctionInfo::globalBaseRegSet() const {

llvm/lib/Target/Mips/MipsMachineFunction.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ class MipsFunctionInfo : public MachineFunctionInfo {
2626
public:
2727
MipsFunctionInfo(MachineFunction &MF) {}
2828

29+
MachineFunctionInfo *
30+
clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF,
31+
const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)
32+
const override;
33+
2934
~MipsFunctionInfo() override;
3035

3136
unsigned getSRetReturnReg() const { return SRetReturnReg; }

llvm/lib/Target/NVPTX/NVPTXMachineFunctionInfo.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ class NVPTXMachineFunctionInfo : public MachineFunctionInfo {
2626
public:
2727
NVPTXMachineFunctionInfo(MachineFunction &MF) {}
2828

29+
MachineFunctionInfo *
30+
clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF,
31+
const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)
32+
const override {
33+
return DestMF.cloneInfo<NVPTXMachineFunctionInfo>(*this);
34+
}
35+
2936
/// Returns the index for the symbol \p Symbol. If the symbol was previously,
3037
/// added, the same index is returned. Otherwise, the symbol is added and the
3138
/// new index is returned.

llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ void PPCFunctionInfo::anchor() {}
2323
PPCFunctionInfo::PPCFunctionInfo(const MachineFunction &MF)
2424
: DisableNonVolatileCR(PPCDisableNonVolatileCR) {}
2525

26+
MachineFunctionInfo *
27+
PPCFunctionInfo::clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF,
28+
const DenseMap<MachineBasicBlock *, MachineBasicBlock *>
29+
&Src2DstMBB) const {
30+
return DestMF.cloneInfo<PPCFunctionInfo>(*this);
31+
}
32+
2633
MCSymbol *PPCFunctionInfo::getPICOffsetSymbol(MachineFunction &MF) const {
2734
const DataLayout &DL = MF.getDataLayout();
2835
return MF.getContext().getOrCreateSymbol(Twine(DL.getPrivateGlobalPrefix()) +

0 commit comments

Comments
 (0)