LLVM  mainline
Namespaces | Functions
Local.h File Reference
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/GetElementPtrTypeIterator.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Operator.h"
Include dependency graph for Local.h:

Go to the source code of this file.

Namespaces

namespace  llvm
 

Compute iterated dominance frontiers using a linear time algorithm.


Functions

bool llvm::ConstantFoldTerminator (BasicBlock *BB, bool DeleteDeadConditions=false, const TargetLibraryInfo *TLI=nullptr)
 ConstantFoldTerminator - If a terminator instruction is predicated on a constant value, convert it into an unconditional branch to the constant destination.
bool llvm::isInstructionTriviallyDead (Instruction *I, const TargetLibraryInfo *TLI=nullptr)
 isInstructionTriviallyDead - Return true if the result produced by the instruction is not used, and the instruction has no side effects.
bool llvm::RecursivelyDeleteTriviallyDeadInstructions (Value *V, const TargetLibraryInfo *TLI=nullptr)
 RecursivelyDeleteTriviallyDeadInstructions - If the specified value is a trivially dead instruction, delete it.
bool llvm::RecursivelyDeleteDeadPHINode (PHINode *PN, const TargetLibraryInfo *TLI=nullptr)
 RecursivelyDeleteDeadPHINode - If the specified value is an effectively dead PHI node, due to being a def-use chain of single-use nodes that either forms a cycle or is terminated by a trivially dead instruction, delete it.
bool llvm::SimplifyInstructionsInBlock (BasicBlock *BB, const TargetLibraryInfo *TLI=nullptr)
 SimplifyInstructionsInBlock - Scan the specified basic block and try to simplify any instructions in it and recursively delete dead instructions.
void llvm::RemovePredecessorAndSimplify (BasicBlock *BB, BasicBlock *Pred)
 RemovePredecessorAndSimplify - Like BasicBlock::removePredecessor, this method is called when we're about to delete Pred as a predecessor of BB.
void llvm::MergeBasicBlockIntoOnlyPred (BasicBlock *BB, DominatorTree *DT=nullptr)
 MergeBasicBlockIntoOnlyPred - BB is a block with one predecessor and its predecessor is known to have one successor (BB!).
bool llvm::TryToSimplifyUncondBranchFromEmptyBlock (BasicBlock *BB)
 TryToSimplifyUncondBranchFromEmptyBlock - BB is known to contain an unconditional branch, and contains no instructions other than PHI nodes, potential debug intrinsics and the branch.
bool llvm::EliminateDuplicatePHINodes (BasicBlock *BB)
 EliminateDuplicatePHINodes - Check for and eliminate duplicate PHI nodes in this block.
bool llvm::SimplifyCFG (BasicBlock *BB, const TargetTransformInfo &TTI, unsigned BonusInstThreshold, AssumptionCache *AC=nullptr)
 SimplifyCFG - This function is used to do simplification of a CFG.
bool llvm::FlattenCFG (BasicBlock *BB, AliasAnalysis *AA=nullptr)
 FlatternCFG - This function is used to flatten a CFG.
bool llvm::FoldBranchToCommonDest (BranchInst *BI, unsigned BonusInstThreshold=1)
 FoldBranchToCommonDest - If this basic block is ONLY a setcc and a branch, and if a predecessor branches to us and one of our successors, fold the setcc into the predecessor and use logical operations to pick the right destination.
AllocaInstllvm::DemoteRegToStack (Instruction &X, bool VolatileLoads=false, Instruction *AllocaPoint=nullptr)
 DemoteRegToStack - This function takes a virtual register computed by an Instruction and replaces it with a slot in the stack frame, allocated via alloca.
AllocaInstllvm::DemotePHIToStack (PHINode *P, Instruction *AllocaPoint=nullptr)
 DemotePHIToStack - This function takes a virtual register computed by a phi node and replaces it with a slot in the stack frame, allocated via alloca.
unsigned llvm::getOrEnforceKnownAlignment (Value *V, unsigned PrefAlign, const DataLayout &DL, const Instruction *CxtI=nullptr, AssumptionCache *AC=nullptr, const DominatorTree *DT=nullptr)
 getOrEnforceKnownAlignment - If the specified pointer has an alignment that we can determine, return it, otherwise return 0.
static unsigned llvm::getKnownAlignment (Value *V, const DataLayout &DL, const Instruction *CxtI=nullptr, AssumptionCache *AC=nullptr, const DominatorTree *DT=nullptr)
 getKnownAlignment - Try to infer an alignment for the specified pointer.
template<typename IRBuilderTy >
Value * llvm::EmitGEPOffset (IRBuilderTy *Builder, const DataLayout &DL, User *GEP, bool NoAssumptions=false)
 EmitGEPOffset - Given a getelementptr instruction/constantexpr, emit the code necessary to compute the offset from the base pointer (without adding in the base pointer).
bool llvm::ConvertDebugDeclareToDebugValue (DbgDeclareInst *DDI, StoreInst *SI, DIBuilder &Builder)
 ===---------------------------------------------------------------------===// Dbg Intrinsic utilities
bool llvm::ConvertDebugDeclareToDebugValue (DbgDeclareInst *DDI, LoadInst *LI, DIBuilder &Builder)
 Inserts a llvm.dbg.value intrinsic before a load of an alloca'd value that has an associated llvm.dbg.decl intrinsic.
bool llvm::LowerDbgDeclare (Function &F)
 LowerDbgDeclare - Lowers llvm.dbg.declare intrinsics into appropriate set of llvm.dbg.value intrinsics.
DbgDeclareInstllvm::FindAllocaDbgDeclare (Value *V)
 FindAllocaDbgDeclare - Finds the llvm.dbg.declare intrinsic corresponding to an alloca, if any.
bool llvm::replaceDbgDeclareForAlloca (AllocaInst *AI, Value *NewAllocaAddress, DIBuilder &Builder, bool Deref)
 Replaces llvm.dbg.declare instruction when an alloca is replaced with a new value.
bool llvm::removeUnreachableBlocks (Function &F)
 Remove all blocks that can not be reached from the function's entry.
void llvm::combineMetadata (Instruction *K, const Instruction *J, ArrayRef< unsigned > KnownIDs)
 Combine the metadata of two instructions so that K can replace J.
unsigned llvm::replaceDominatedUsesWith (Value *From, Value *To, DominatorTree &DT, const BasicBlockEdge &Edge)
 Replace each use of 'From' with 'To' if that use is dominated by the given edge.