LLVM  13.0.0git
Cloning.h
Go to the documentation of this file.
1 //===- Cloning.h - Clone various parts of LLVM programs ---------*- 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 //
9 // This file defines various functions that are used to clone chunks of LLVM
10 // code for various purposes. This varies from copying whole modules into new
11 // modules, to cloning functions with different arguments, to inlining
12 // functions, to copying basic blocks to support loop unrolling or superblock
13 // formation, etc.
14 //
15 //===----------------------------------------------------------------------===//
16 
17 #ifndef LLVM_TRANSFORMS_UTILS_CLONING_H
18 #define LLVM_TRANSFORMS_UTILS_CLONING_H
19 
20 #include "llvm/ADT/SmallVector.h"
21 #include "llvm/ADT/Twine.h"
24 #include "llvm/IR/ValueHandle.h"
26 #include <functional>
27 #include <memory>
28 #include <vector>
29 
30 namespace llvm {
31 
32 class AAResults;
33 class AllocaInst;
34 class BasicBlock;
35 class BlockFrequencyInfo;
36 class CallInst;
37 class CallGraph;
38 class DebugInfoFinder;
39 class DominatorTree;
40 class Function;
41 class Instruction;
42 class InvokeInst;
43 class Loop;
44 class LoopInfo;
45 class Module;
46 class ProfileSummaryInfo;
47 class ReturnInst;
48 class DomTreeUpdater;
49 
50 /// Return an exact copy of the specified module
51 std::unique_ptr<Module> CloneModule(const Module &M);
52 std::unique_ptr<Module> CloneModule(const Module &M, ValueToValueMapTy &VMap);
53 
54 /// Return a copy of the specified module. The ShouldCloneDefinition function
55 /// controls whether a specific GlobalValue's definition is cloned. If the
56 /// function returns false, the module copy will contain an external reference
57 /// in place of the global definition.
58 std::unique_ptr<Module>
60  function_ref<bool(const GlobalValue *)> ShouldCloneDefinition);
61 
62 /// This struct can be used to capture information about code
63 /// being cloned, while it is being cloned.
65  /// This is set to true if the cloned code contains a normal call instruction.
66  bool ContainsCalls = false;
67 
68  /// This is set to true if the cloned code contains a 'dynamic' alloca.
69  /// Dynamic allocas are allocas that are either not in the entry block or they
70  /// are in the entry block but are not a constant size.
71  bool ContainsDynamicAllocas = false;
72 
73  /// All cloned call sites that have operand bundles attached are appended to
74  /// this vector. This vector may contain nulls or undefs if some of the
75  /// originally inserted callsites were DCE'ed after they were cloned.
76  std::vector<WeakTrackingVH> OperandBundleCallSites;
77 
78  ClonedCodeInfo() = default;
79 };
80 
81 /// Return a copy of the specified basic block, but without
82 /// embedding the block into a particular function. The block returned is an
83 /// exact copy of the specified basic block, without any remapping having been
84 /// performed. Because of this, this is only suitable for applications where
85 /// the basic block will be inserted into the same function that it was cloned
86 /// from (loop unrolling would use this, for example).
87 ///
88 /// Also, note that this function makes a direct copy of the basic block, and
89 /// can thus produce illegal LLVM code. In particular, it will copy any PHI
90 /// nodes from the original block, even though there are no predecessors for the
91 /// newly cloned block (thus, phi nodes will have to be updated). Also, this
92 /// block will branch to the old successors of the original block: these
93 /// successors will have to have any PHI nodes updated to account for the new
94 /// incoming edges.
95 ///
96 /// The correlation between instructions in the source and result basic blocks
97 /// is recorded in the VMap map.
98 ///
99 /// If you have a particular suffix you'd like to use to add to any cloned
100 /// names, specify it as the optional third parameter.
101 ///
102 /// If you would like the basic block to be auto-inserted into the end of a
103 /// function, you can specify it as the optional fourth parameter.
104 ///
105 /// If you would like to collect additional information about the cloned
106 /// function, you can specify a ClonedCodeInfo object with the optional fifth
107 /// parameter.
109  const Twine &NameSuffix = "", Function *F = nullptr,
110  ClonedCodeInfo *CodeInfo = nullptr,
111  DebugInfoFinder *DIFinder = nullptr);
112 
113 /// Return a copy of the specified function and add it to that
114 /// function's module. Also, any references specified in the VMap are changed
115 /// to refer to their mapped value instead of the original one. If any of the
116 /// arguments to the function are in the VMap, the arguments are deleted from
117 /// the resultant function. The VMap is updated to include mappings from all of
118 /// the instructions and basicblocks in the function from their old to new
119 /// values. The final argument captures information about the cloned code if
120 /// non-null.
121 ///
122 /// \pre VMap contains no non-identity GlobalValue mappings.
123 ///
125  ClonedCodeInfo *CodeInfo = nullptr);
126 
131  ClonedModule,
132 };
133 
134 /// Clone OldFunc into NewFunc, transforming the old arguments into references
135 /// to VMap values. Note that if NewFunc already has basic blocks, the ones
136 /// cloned into it will be added to the end of the function. This function
137 /// fills in a list of return instructions, and can optionally remap types
138 /// and/or append the specified suffix to all values cloned.
139 ///
140 /// If \p Changes is \a CloneFunctionChangeType::LocalChangesOnly, VMap is
141 /// required to contain no non-identity GlobalValue mappings. Otherwise,
142 /// referenced metadata will be cloned.
143 ///
144 /// If \p Changes is less than \a CloneFunctionChangeType::DifferentModule
145 /// indicating cloning into the same module (even if it's LocalChangesOnly), if
146 /// debug info metadata transitively references a \a DISubprogram, it will be
147 /// cloned, effectively upgrading \p Changes to GlobalChanges while suppressing
148 /// cloning of types and compile units.
149 ///
150 /// If \p Changes is \a CloneFunctionChangeType::DifferentModule, the new
151 /// module's \c !llvm.dbg.cu will get updated with any newly created compile
152 /// units. (\a CloneFunctionChangeType::ClonedModule leaves that work for the
153 /// caller.)
154 ///
155 /// FIXME: Consider simplifying this function by splitting out \a
156 /// CloneFunctionMetadataInto() and expecting / updating callers to call it
157 /// first when / how it's needed.
158 void CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
160  SmallVectorImpl<ReturnInst *> &Returns,
161  const char *NameSuffix = "",
162  ClonedCodeInfo *CodeInfo = nullptr,
163  ValueMapTypeRemapper *TypeMapper = nullptr,
164  ValueMaterializer *Materializer = nullptr);
165 
166 void CloneAndPruneIntoFromInst(Function *NewFunc, const Function *OldFunc,
167  const Instruction *StartingInst,
168  ValueToValueMapTy &VMap, bool ModuleLevelChanges,
169  SmallVectorImpl<ReturnInst *> &Returns,
170  const char *NameSuffix = "",
171  ClonedCodeInfo *CodeInfo = nullptr);
172 
173 /// This works exactly like CloneFunctionInto,
174 /// except that it does some simple constant prop and DCE on the fly. The
175 /// effect of this is to copy significantly less code in cases where (for
176 /// example) a function call with constant arguments is inlined, and those
177 /// constant arguments cause a significant amount of code in the callee to be
178 /// dead. Since this doesn't produce an exactly copy of the input, it can't be
179 /// used for things like CloneFunction or CloneModule.
180 ///
181 /// If ModuleLevelChanges is false, VMap contains no non-identity GlobalValue
182 /// mappings.
183 ///
184 void CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc,
185  ValueToValueMapTy &VMap, bool ModuleLevelChanges,
186  SmallVectorImpl<ReturnInst*> &Returns,
187  const char *NameSuffix = "",
188  ClonedCodeInfo *CodeInfo = nullptr,
189  Instruction *TheCall = nullptr);
190 
191 /// This class captures the data input to the InlineFunction call, and records
192 /// the auxiliary results produced by it.
194 public:
196  CallGraph *cg = nullptr,
198  ProfileSummaryInfo *PSI = nullptr,
199  BlockFrequencyInfo *CallerBFI = nullptr,
200  BlockFrequencyInfo *CalleeBFI = nullptr, bool UpdateProfile = true)
204 
205  /// If non-null, InlineFunction will update the callgraph to reflect the
206  /// changes it makes.
211 
212  /// InlineFunction fills this in with all static allocas that get copied into
213  /// the caller.
215 
216  /// InlineFunction fills this in with callsites that were inlined from the
217  /// callee. This is only filled in if CG is non-null.
219 
220  /// All of the new call sites inlined into the caller.
221  ///
222  /// 'InlineFunction' fills this in by scanning the inlined instructions, and
223  /// only if CG is null. If CG is non-null, instead the value handle
224  /// `InlinedCalls` above is used.
226 
227  /// Update profile for callee as well as cloned version. We need to do this
228  /// for regular inlining, but not for inlining from sample profile loader.
230 
231  void reset() {
232  StaticAllocas.clear();
233  InlinedCalls.clear();
234  InlinedCallSites.clear();
235  }
236 };
237 
238 /// This function inlines the called function into the basic
239 /// block of the caller. This returns false if it is not possible to inline
240 /// this call. The program is still in a well defined state if this occurs
241 /// though.
242 ///
243 /// Note that this only does one level of inlining. For example, if the
244 /// instruction 'call B' is inlined, and 'B' calls 'C', then the call to 'C' now
245 /// exists in the instruction stream. Similarly this will inline a recursive
246 /// function by one level.
247 ///
248 /// Note that while this routine is allowed to cleanup and optimize the
249 /// *inlined* code to minimize the actual inserted code, it must not delete
250 /// code in the caller as users of this routine may have pointers to
251 /// instructions in the caller that need to remain stable.
252 ///
253 /// If ForwardVarArgsTo is passed, inlining a function with varargs is allowed
254 /// and all varargs at the callsite will be passed to any calls to
255 /// ForwardVarArgsTo. The caller of InlineFunction has to make sure any varargs
256 /// are only used by ForwardVarArgsTo.
257 InlineResult InlineFunction(CallBase &CB, InlineFunctionInfo &IFI,
258  AAResults *CalleeAAR = nullptr,
259  bool InsertLifetime = true,
260  Function *ForwardVarArgsTo = nullptr);
261 
262 /// Clones a loop \p OrigLoop. Returns the loop and the blocks in \p
263 /// Blocks.
264 ///
265 /// Updates LoopInfo and DominatorTree assuming the loop is dominated by block
266 /// \p LoopDomBB. Insert the new blocks before block specified in \p Before.
267 /// Note: Only innermost loops are supported.
268 Loop *cloneLoopWithPreheader(BasicBlock *Before, BasicBlock *LoopDomBB,
269  Loop *OrigLoop, ValueToValueMapTy &VMap,
270  const Twine &NameSuffix, LoopInfo *LI,
271  DominatorTree *DT,
272  SmallVectorImpl<BasicBlock *> &Blocks);
273 
274 /// Remaps instructions in \p Blocks using the mapping in \p VMap.
275 void remapInstructionsInBlocks(const SmallVectorImpl<BasicBlock *> &Blocks,
276  ValueToValueMapTy &VMap);
277 
278 /// Split edge between BB and PredBB and duplicate all non-Phi instructions
279 /// from BB between its beginning and the StopAt instruction into the split
280 /// block. Phi nodes are not duplicated, but their uses are handled correctly:
281 /// we replace them with the uses of corresponding Phi inputs. ValueMapping
282 /// is used to map the original instructions from BB to their newly-created
283 /// copies. Returns the split block.
285  BasicBlock *PredBB,
286  Instruction *StopAt,
287  ValueToValueMapTy &ValueMapping,
288  DomTreeUpdater &DTU);
289 
290 /// Updates profile information by adjusting the entry count by adding
291 /// entryDelta then scaling callsite information by the new count divided by the
292 /// old count. VMap is used during inlinng to also update the new clone
294  Function *Callee, int64_t entryDelta,
295  const ValueMap<const Value *, WeakTrackingVH> *VMap = nullptr);
296 
297 /// Find the 'llvm.experimental.noalias.scope.decl' intrinsics in the specified
298 /// basic blocks and extract their scope. These are candidates for duplication
299 /// when cloning.
301  ArrayRef<BasicBlock *> BBs, SmallVectorImpl<MDNode *> &NoAliasDeclScopes);
302 
303 /// Find the 'llvm.experimental.noalias.scope.decl' intrinsics in the specified
304 /// instruction range and extract their scope. These are candidates for
305 /// duplication when cloning.
308  SmallVectorImpl<MDNode *> &NoAliasDeclScopes);
309 
310 /// Duplicate the specified list of noalias decl scopes.
311 /// The 'Ext' string is added as an extension to the name.
312 /// Afterwards, the ClonedScopes contains the mapping of the original scope
313 /// MDNode onto the cloned scope.
314 /// Be aware that the cloned scopes are still part of the original scope domain.
315 void cloneNoAliasScopes(
316  ArrayRef<MDNode *> NoAliasDeclScopes,
317  DenseMap<MDNode *, MDNode *> &ClonedScopes,
318  StringRef Ext, LLVMContext &Context);
319 
320 /// Adapt the metadata for the specified instruction according to the
321 /// provided mapping. This is normally used after cloning an instruction, when
322 /// some noalias scopes needed to be cloned.
323 void adaptNoAliasScopes(
324  llvm::Instruction *I, const DenseMap<MDNode *, MDNode *> &ClonedScopes,
325  LLVMContext &Context);
326 
327 /// Clone the specified noalias decl scopes. Then adapt all instructions in the
328 /// NewBlocks basicblocks to the cloned versions.
329 /// 'Ext' will be added to the duplicate scope names.
330 void cloneAndAdaptNoAliasScopes(ArrayRef<MDNode *> NoAliasDeclScopes,
331  ArrayRef<BasicBlock *> NewBlocks,
332  LLVMContext &Context, StringRef Ext);
333 
334 /// Clone the specified noalias decl scopes. Then adapt all instructions in the
335 /// [IStart, IEnd] (IEnd included !) range to the cloned versions. 'Ext' will be
336 /// added to the duplicate scope names.
337 void cloneAndAdaptNoAliasScopes(ArrayRef<MDNode *> NoAliasDeclScopes,
338  Instruction *IStart, Instruction *IEnd,
339  LLVMContext &Context, StringRef Ext);
340 } // end namespace llvm
341 
342 #endif // LLVM_TRANSFORMS_UTILS_CLONING_H
AssumptionCache.h
llvm
Definition: AllocatorList.h:23
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
llvm::ClonedCodeInfo
This struct can be used to capture information about code being cloned, while it is being cloned.
Definition: Cloning.h:64
ValueMapper.h
llvm::BasicBlock::iterator
InstListType::iterator iterator
Instruction iterators...
Definition: BasicBlock.h:90
llvm::cloneLoopWithPreheader
Loop * cloneLoopWithPreheader(BasicBlock *Before, BasicBlock *LoopDomBB, Loop *OrigLoop, ValueToValueMapTy &VMap, const Twine &NameSuffix, LoopInfo *LI, DominatorTree *DT, SmallVectorImpl< BasicBlock * > &Blocks)
Clones a loop OrigLoop.
Definition: CloneFunction.cpp:798
llvm::Function
Definition: Function.h:61
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1168
llvm::CallGraph
The basic data container for the call graph of a Module of IR.
Definition: CallGraph.h:73
llvm::CloneFunctionChangeType::ClonedModule
@ ClonedModule
llvm::CloneFunctionChangeType::DifferentModule
@ DifferentModule
llvm::updateProfileCallee
void updateProfileCallee(Function *Callee, int64_t entryDelta, const ValueMap< const Value *, WeakTrackingVH > *VMap=nullptr)
Updates profile information by adjusting the entry count by adding entryDelta then scaling callsite i...
Definition: InlineFunction.cpp:1622
llvm::CloneFunctionChangeType::LocalChangesOnly
@ LocalChangesOnly
llvm::InlineFunctionInfo::InlineFunctionInfo
InlineFunctionInfo(CallGraph *cg=nullptr, function_ref< AssumptionCache &(Function &)> GetAssumptionCache=nullptr, ProfileSummaryInfo *PSI=nullptr, BlockFrequencyInfo *CallerBFI=nullptr, BlockFrequencyInfo *CalleeBFI=nullptr, bool UpdateProfile=true)
Definition: Cloning.h:195
llvm::DebugInfoFinder
Utility to find all debug info in a module.
Definition: DebugInfo.h:90
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::InlineFunctionInfo::CallerBFI
BlockFrequencyInfo * CallerBFI
Definition: Cloning.h:210
llvm::InlineFunctionInfo::PSI
ProfileSummaryInfo * PSI
Definition: Cloning.h:209
llvm::BasicBlock
LLVM Basic Block Representation.
Definition: BasicBlock.h:58
Context
LLVMContext & Context
Definition: NVVMIntrRange.cpp:66
llvm::BlockFrequencyInfo
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
Definition: BlockFrequencyInfo.h:37
llvm::InlineFunctionInfo::CG
CallGraph * CG
If non-null, InlineFunction will update the callgraph to reflect the changes it makes.
Definition: Cloning.h:207
Twine.h
llvm::remapInstructionsInBlocks
void remapInstructionsInBlocks(const SmallVectorImpl< BasicBlock * > &Blocks, ValueToValueMapTy &VMap)
Remaps instructions in Blocks using the mapping in VMap.
Definition: CloneFunction.cpp:784
llvm::ClonedCodeInfo::OperandBundleCallSites
std::vector< WeakTrackingVH > OperandBundleCallSites
All cloned call sites that have operand bundles attached are appended to this vector.
Definition: Cloning.h:76
llvm::Instruction
Definition: Instruction.h:45
llvm::CloneAndPruneFunctionInto
void CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc, ValueToValueMapTy &VMap, bool ModuleLevelChanges, SmallVectorImpl< ReturnInst * > &Returns, const char *NameSuffix="", ClonedCodeInfo *CodeInfo=nullptr, Instruction *TheCall=nullptr)
This works exactly like CloneFunctionInto, except that it does some simple constant prop and DCE on t...
Definition: CloneFunction.cpp:775
llvm::ProfileSummaryInfo
Analysis providing profile information.
Definition: ProfileSummaryInfo.h:39
llvm::function_ref
An efficient, type-erasing, non-owning reference to a callable.
Definition: STLExtras.h:168
llvm::cloneAndAdaptNoAliasScopes
void cloneAndAdaptNoAliasScopes(ArrayRef< MDNode * > NoAliasDeclScopes, ArrayRef< BasicBlock * > NewBlocks, LLVMContext &Context, StringRef Ext)
Clone the specified noalias decl scopes.
Definition: CloneFunction.cpp:988
llvm::ClonedCodeInfo::ClonedCodeInfo
ClonedCodeInfo()=default
llvm::CloneBasicBlock
BasicBlock * CloneBasicBlock(const BasicBlock *BB, ValueToValueMapTy &VMap, const Twine &NameSuffix="", Function *F=nullptr, ClonedCodeInfo *CodeInfo=nullptr, DebugInfoFinder *DIFinder=nullptr)
Return a copy of the specified basic block, but without embedding the block into a particular functio...
Definition: CloneFunction.cpp:43
llvm::DuplicateInstructionsInSplitBetween
BasicBlock * DuplicateInstructionsInSplitBetween(BasicBlock *BB, BasicBlock *PredBB, Instruction *StopAt, ValueToValueMapTy &ValueMapping, DomTreeUpdater &DTU)
Split edge between BB and PredBB and duplicate all non-Phi instructions from BB between its beginning...
Definition: CloneFunction.cpp:884
llvm::MipsISD::Ext
@ Ext
Definition: MipsISelLowering.h:156
llvm::InlineFunctionInfo::InlinedCalls
SmallVector< WeakTrackingVH, 8 > InlinedCalls
InlineFunction fills this in with callsites that were inlined from the callee.
Definition: Cloning.h:218
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::adaptNoAliasScopes
void adaptNoAliasScopes(llvm::Instruction *I, const DenseMap< MDNode *, MDNode * > &ClonedScopes, LLVMContext &Context)
Adapt the metadata for the specified instruction according to the provided mapping.
Definition: CloneFunction.cpp:954
llvm::ValueToValueMapTy
ValueMap< const Value *, WeakTrackingVH > ValueToValueMapTy
Definition: MemorySSAUpdater.h:52
InlineCost.h
llvm::cloneNoAliasScopes
void cloneNoAliasScopes(ArrayRef< MDNode * > NoAliasDeclScopes, DenseMap< MDNode *, MDNode * > &ClonedScopes, StringRef Ext, LLVMContext &Context)
Duplicate the specified list of noalias decl scopes.
Definition: CloneFunction.cpp:929
llvm::ISD::BasicBlock
@ BasicBlock
Various leaf nodes.
Definition: ISDOpcodes.h:64
llvm::identifyNoAliasScopesToClone
void identifyNoAliasScopesToClone(ArrayRef< BasicBlock * > BBs, SmallVectorImpl< MDNode * > &NoAliasDeclScopes)
Find the 'llvm.experimental.noalias.scope.decl' intrinsics in the specified basic blocks and extract ...
Definition: CloneFunction.cpp:1025
llvm::AssumptionCache
A cache of @llvm.assume calls within a function.
Definition: AssumptionCache.h:41
llvm::CloneAndPruneIntoFromInst
void CloneAndPruneIntoFromInst(Function *NewFunc, const Function *OldFunc, const Instruction *StartingInst, ValueToValueMapTy &VMap, bool ModuleLevelChanges, SmallVectorImpl< ReturnInst * > &Returns, const char *NameSuffix="", ClonedCodeInfo *CodeInfo=nullptr)
This works like CloneAndPruneFunctionInto, except that it does not clone the entire function.
Definition: CloneFunction.cpp:493
Module
Machine Check Debug Module
Definition: MachineCheckDebugify.cpp:122
llvm::CloneFunction
Function * CloneFunction(Function *F, ValueToValueMapTy &VMap, ClonedCodeInfo *CodeInfo=nullptr)
Return a copy of the specified function and add it to that function's module.
Definition: CloneFunction.cpp:284
llvm::CloneFunctionChangeType::GlobalChanges
@ GlobalChanges
llvm::ValueMap< const Value *, WeakTrackingVH >
ValueHandle.h
llvm::ClonedCodeInfo::ContainsCalls
bool ContainsCalls
This is set to true if the cloned code contains a normal call instruction.
Definition: Cloning.h:66
llvm::InlineFunctionInfo::InlinedCallSites
SmallVector< CallBase *, 8 > InlinedCallSites
All of the new call sites inlined into the caller.
Definition: Cloning.h:225
llvm::InlineFunctionInfo::reset
void reset()
Definition: Cloning.h:231
llvm::CloneFunctionChangeType
CloneFunctionChangeType
Definition: Cloning.h:127
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:80
llvm::InlineFunctionInfo
This class captures the data input to the InlineFunction call, and records the auxiliary results prod...
Definition: Cloning.h:193
llvm::InlineFunctionInfo::StaticAllocas
SmallVector< AllocaInst *, 4 > StaticAllocas
InlineFunction fills this in with all static allocas that get copied into the caller.
Definition: Cloning.h:214
SmallVector.h
llvm::InlineFunctionInfo::UpdateProfile
bool UpdateProfile
Update profile for callee as well as cloned version.
Definition: Cloning.h:229
llvm::CloneModule
std::unique_ptr< Module > CloneModule(const Module &M)
Return an exact copy of the specified module.
Definition: CloneModule.cpp:34
llvm::InlineFunction
InlineResult InlineFunction(CallBase &CB, InlineFunctionInfo &IFI, AAResults *CalleeAAR=nullptr, bool InsertLifetime=true, Function *ForwardVarArgsTo=nullptr)
This function inlines the called function into the basic block of the caller.
Definition: InlineFunction.cpp:1761
llvm::CloneFunctionInto
void CloneFunctionInto(Function *NewFunc, const Function *OldFunc, ValueToValueMapTy &VMap, CloneFunctionChangeType Changes, SmallVectorImpl< ReturnInst * > &Returns, const char *NameSuffix="", ClonedCodeInfo *CodeInfo=nullptr, ValueMapTypeRemapper *TypeMapper=nullptr, ValueMaterializer *Materializer=nullptr)
Clone OldFunc into NewFunc, transforming the old arguments into references to VMap values.
Definition: CloneFunction.cpp:84
BB
Common register allocation spilling lr str ldr sxth r3 ldr mla r4 can lr mov lr str ldr sxth r3 mla r4 and then merge mul and lr str ldr sxth r3 mla r4 It also increase the likelihood the store may become dead bb27 Successors according to LLVM BB
Definition: README.txt:39
llvm::InlineFunctionInfo::GetAssumptionCache
function_ref< AssumptionCache &(Function &)> GetAssumptionCache
Definition: Cloning.h:208
llvm::ClonedCodeInfo::ContainsDynamicAllocas
bool ContainsDynamicAllocas
This is set to true if the cloned code contains a 'dynamic' alloca.
Definition: Cloning.h:71
llvm::InlineFunctionInfo::CalleeBFI
BlockFrequencyInfo * CalleeBFI
Definition: Cloning.h:210
llvm::codeview::PublicSymFlags::Function
@ Function