|
LLVM
7.0.0
|
#include "llvm/Transforms/Utils/CodeExtractor.h"#include "llvm/ADT/ArrayRef.h"#include "llvm/ADT/DenseMap.h"#include "llvm/ADT/Optional.h"#include "llvm/ADT/STLExtras.h"#include "llvm/ADT/SetVector.h"#include "llvm/ADT/SmallPtrSet.h"#include "llvm/ADT/SmallVector.h"#include "llvm/Analysis/BlockFrequencyInfo.h"#include "llvm/Analysis/BlockFrequencyInfoImpl.h"#include "llvm/Analysis/BranchProbabilityInfo.h"#include "llvm/Analysis/LoopInfo.h"#include "llvm/IR/Argument.h"#include "llvm/IR/Attributes.h"#include "llvm/IR/BasicBlock.h"#include "llvm/IR/CFG.h"#include "llvm/IR/Constant.h"#include "llvm/IR/Constants.h"#include "llvm/IR/DataLayout.h"#include "llvm/IR/DerivedTypes.h"#include "llvm/IR/Dominators.h"#include "llvm/IR/Function.h"#include "llvm/IR/GlobalValue.h"#include "llvm/IR/InstrTypes.h"#include "llvm/IR/Instruction.h"#include "llvm/IR/Instructions.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/Intrinsics.h"#include "llvm/IR/LLVMContext.h"#include "llvm/IR/MDBuilder.h"#include "llvm/IR/Module.h"#include "llvm/IR/Type.h"#include "llvm/IR/User.h"#include "llvm/IR/Value.h"#include "llvm/IR/Verifier.h"#include "llvm/Pass.h"#include "llvm/Support/BlockFrequency.h"#include "llvm/Support/BranchProbability.h"#include "llvm/Support/Casting.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/Debug.h"#include "llvm/Support/ErrorHandling.h"#include "llvm/Support/raw_ostream.h"#include "llvm/Transforms/Utils/BasicBlockUtils.h"#include <cassert>#include <cstdint>#include <iterator>#include <map>#include <set>#include <utility>#include <vector>Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "code-extractor" |
Typedefs | |
| using | ProfileCount = Function::ProfileCount |
Functions | |
| static bool | isBlockValidForExtraction (const BasicBlock &BB, const SetVector< BasicBlock *> &Result, bool AllowVarArgs, bool AllowAlloca) |
| Test whether a block is valid for extraction. More... | |
| static SetVector< BasicBlock * > | buildExtractionBlockSet (ArrayRef< BasicBlock *> BBs, DominatorTree *DT, bool AllowVarArgs, bool AllowAlloca) |
| Build a set of blocks to extract if the input blocks are viable. More... | |
| static bool | definedInRegion (const SetVector< BasicBlock *> &Blocks, Value *V) |
| definedInRegion - Return true if the specified value is defined in the extracted region. More... | |
| static bool | definedInCaller (const SetVector< BasicBlock *> &Blocks, Value *V) |
| definedInCaller - Return true if the specified value is defined in the function being code extracted, but not in the region being extracted. More... | |
| static BasicBlock * | getCommonExitBlock (const SetVector< BasicBlock *> &Blocks) |
Variables | |
| static cl::opt< bool > | AggregateArgsOpt ("aggregate-extracted-args", cl::Hidden, cl::desc("Aggregate arguments to code-extracted functions")) |
| #define DEBUG_TYPE "code-extractor" |
Definition at line 71 of file CodeExtractor.cpp.
| using ProfileCount = Function::ProfileCount |
Definition at line 69 of file CodeExtractor.cpp.
|
static |
Build a set of blocks to extract if the input blocks are viable.
Definition at line 185 of file CodeExtractor.cpp.
References assert(), llvm::dbgs(), llvm::ArrayRef< T >::empty(), isBlockValidForExtraction(), llvm::DominatorTree::isReachableFromEntry(), LLVM_DEBUG, llvm_unreachable, llvm::predecessors(), and Result.
|
static |
definedInCaller - Return true if the specified value is defined in the function being code extracted, but not in the region being extracted.
These values must be passed in as live-ins to the function.
Definition at line 257 of file CodeExtractor.cpp.
References llvm::SetVector< T, Vector, Set >::count(), and I.
Referenced by llvm::CodeExtractor::findInputsOutputs().
|
static |
definedInRegion - Return true if the specified value is defined in the extracted region.
Definition at line 247 of file CodeExtractor.cpp.
References llvm::SetVector< T, Vector, Set >::count(), and I.
Referenced by llvm::CodeExtractor::findAllocas(), and llvm::CodeExtractor::findInputsOutputs().
|
static |
Definition at line 265 of file CodeExtractor.cpp.
References llvm::any_of(), llvm::SetVector< T, Vector, Set >::count(), and llvm::successors().
Referenced by llvm::CodeExtractor::findAllocas().
|
static |
Test whether a block is valid for extraction.
Definition at line 82 of file CodeExtractor.cpp.
References llvm::SetVector< T, Vector, Set >::count(), E, llvm::SmallVectorBase::empty(), F(), getParent(), llvm::BasicBlock::hasAddressTaken(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::User::operands(), llvm::SmallVectorImpl< T >::pop_back_val(), and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().
Referenced by buildExtractionBlockSet().
1.8.13