14#ifndef LLVM_TRANSFORMS_UTILS_CODEEXTRACTOR_H
15#define LLVM_TRANSFORMS_UTILS_CODEEXTRACTOR_H
58 void findSideEffectInfoForBlock(
BasicBlock &BB);
92 const bool AggregateArgs;
133 bool ArgsInZeroAddressSpace;
155 bool AllowAlloca =
false,
BasicBlock *AllocationBlock =
nullptr,
156 std::string Suffix =
"",
bool ArgsInZeroAddressSpace =
false);
176 ValueSet &Inputs, ValueSet &Outputs);
203 const ValueSet &Allocas,
204 bool CollectGlobalInputs =
false)
const;
222 ValueSet &HoistCands,
BasicBlock *&ExitBlock)
const;
238 struct LifetimeMarkerInfo {
239 bool SinkLifeStart =
false;
240 bool HoistLifeEnd =
false;
245 ValueSet ExcludeArgsFromAggregate;
253 void computeExtractedFuncRetVals();
257 Type *getSwitchType();
259 void severSplitPHINodesOfEntry(
BasicBlock *&Header);
260 void severSplitPHINodesOfExits();
261 void splitReturnBlocks();
263 void moveCodeToFunction(
Function *newFunction);
265 void calculateNewCallTerminatorWeights(
272 void normalizeCFGForExtraction(
BasicBlock *&header);
277 constructFunctionDeclaration(
const ValueSet &inputs,
const ValueSet &outputs,
279 ValueSet &StructValues,
StructType *&StructTy);
284 void emitFunctionBody(
const ValueSet &inputs,
const ValueSet &outputs,
285 const ValueSet &StructValues,
Function *newFunction,
287 const ValueSet &SinkingCands,
291 CallInst *emitReplacerCall(
const ValueSet &inputs,
const ValueSet &outputs,
292 const ValueSet &StructValues,
297 std::vector<Value *> &Reloads);
303 BasicBlock *codeReplacer,
const ValueSet &outputs,
This file defines the DenseMap class.
This file implements a set that has insertion order iteration characteristics.
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.
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.