14#ifndef LLVM_TRANSFORMS_UTILS_CODEEXTRACTOR_H
15#define LLVM_TRANSFORMS_UTILS_CODEEXTRACTOR_H
60 void findSideEffectInfoForBlock(
BasicBlock &BB);
94 const bool AggregateArgs;
143 bool ArgsInZeroAddressSpace;
147 bool VoidReturnWithSingleOutput;
150 Value *FuncRetVal =
nullptr;
176 bool AllowAlloca =
false,
BasicBlock *AllocationBlock =
nullptr,
178 std::string Suffix =
"",
bool ArgsInZeroAddressSpace =
false,
179 bool VoidReturnWithSingleOutput =
true);
201 ValueSet &Inputs, ValueSet &Outputs);
228 const ValueSet &Allocas,
229 bool CollectGlobalInputs =
false);
247 ValueSet &HoistCands,
BasicBlock *&ExitBlock)
const;
274 struct LifetimeMarkerInfo {
275 bool SinkLifeStart =
false;
276 bool HoistLifeEnd =
false;
281 ValueSet ExcludeArgsFromAggregate;
289 void computeExtractedFuncRetVals();
293 Type *getSwitchType();
295 void severSplitPHINodesOfEntry(
BasicBlock *&Header);
296 void severSplitPHINodesOfExits();
297 void splitReturnBlocks();
299 void moveCodeToFunction(
Function *newFunction);
301 void calculateNewCallTerminatorWeights(
308 void normalizeCFGForExtraction(
BasicBlock *&header);
313 constructFunctionDeclaration(
const ValueSet &inputs,
const ValueSet &outputs,
315 ValueSet &StructValues,
StructType *&StructTy);
320 void emitFunctionBody(
const ValueSet &inputs,
const ValueSet &outputs,
321 const ValueSet &StructValues,
Function *newFunction,
323 const ValueSet &SinkingCands,
327 CallInst *emitReplacerCall(
const ValueSet &inputs,
const ValueSet &outputs,
328 const ValueSet &StructValues,
333 std::vector<Value *> &Reloads);
339 CallInst *ReplacerCall,
const ValueSet &outputs,
This file defines the DenseMap class.
This file implements a set that has insertion order iteration characteristics.
This class represents a conversion between pointers from one address space to another.
an instruction to allocate memory on the stack
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
A cache of @llvm.assume calls within a function.
LLVM Basic Block Representation.
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
Analysis providing branch probability information.
This class represents a function call, abstracting a target machine's calling convention.
Implements a dense probed hash-table based set.
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
InsertPoint - A saved insertion point.
A Module instance is used to store all the information related to an LLVM module.
A vector that has set insertion semantics.
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Class to represent struct types.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
This is an optimization pass for GlobalISel generic memory operations.