LLVM  6.0.0svn
Classes | Namespaces | Functions
LoopUtils.h File Reference
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/EHPersonalities.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Operator.h"
#include "llvm/IR/ValueHandle.h"
#include "llvm/Support/Casting.h"
Include dependency graph for LoopUtils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  llvm::LoopSafetyInfo
 Captures loop safety information. More...
 
class  llvm::RecurrenceDescriptor
 The RecurrenceDescriptor is used to identify recurrences variables in a loop. More...
 
class  llvm::RecurrenceDescriptor::InstDesc
 This POD struct holds information about a potential recurrence operation. More...
 
class  llvm::InductionDescriptor
 A struct for saving information about induction variables. More...
 

Namespaces

 llvm
 Compute iterated dominance frontiers using a linear time algorithm.
 

Functions

BasicBlockllvm::InsertPreheaderForLoop (Loop *L, DominatorTree *DT, LoopInfo *LI, bool PreserveLCSSA)
 InsertPreheaderForLoop - Once we discover that a loop doesn't have a preheader, this method is called to insert one. More...
 
bool llvm::formDedicatedExitBlocks (Loop *L, DominatorTree *DT, LoopInfo *LI, bool PreserveLCSSA)
 Ensure that all exit blocks of the loop are dedicated exits. More...
 
bool llvm::formLCSSAForInstructions (SmallVectorImpl< Instruction *> &Worklist, DominatorTree &DT, LoopInfo &LI)
 Ensures LCSSA form for every instruction from the Worklist in the scope of innermost containing loop. More...
 
bool llvm::formLCSSA (Loop &L, DominatorTree &DT, LoopInfo *LI, ScalarEvolution *SE)
 Put loop into LCSSA form. More...
 
bool llvm::formLCSSARecursively (Loop &L, DominatorTree &DT, LoopInfo *LI, ScalarEvolution *SE)
 Put a loop nest into LCSSA form. More...
 
bool llvm::sinkRegion (DomTreeNode *, AliasAnalysis *, LoopInfo *, DominatorTree *, TargetLibraryInfo *, Loop *, AliasSetTracker *, LoopSafetyInfo *, OptimizationRemarkEmitter *ORE)
 Walk the specified region of the CFG (defined by all blocks dominated by the specified block, and that are in the current loop) in reverse depth first order w.r.t the DominatorTree. More...
 
bool llvm::hoistRegion (DomTreeNode *, AliasAnalysis *, LoopInfo *, DominatorTree *, TargetLibraryInfo *, Loop *, AliasSetTracker *, LoopSafetyInfo *, OptimizationRemarkEmitter *ORE)
 Walk the specified region of the CFG (defined by all blocks dominated by the specified block, and that are in the current loop) in depth first order w.r.t the DominatorTree. More...
 
void llvm::deleteDeadLoop (Loop *L, DominatorTree *DT, ScalarEvolution *SE, LoopInfo *LI)
 This function deletes dead loops. More...
 
bool llvm::promoteLoopAccessesToScalars (const SmallSetVector< Value *, 8 > &, SmallVectorImpl< BasicBlock *> &, SmallVectorImpl< Instruction *> &, PredIteratorCache &, LoopInfo *, DominatorTree *, const TargetLibraryInfo *, Loop *, AliasSetTracker *, LoopSafetyInfo *, OptimizationRemarkEmitter *)
 Try to promote memory values to scalars by sinking stores out of the loop and moving loads to before the loop. More...
 
SmallVector< DomTreeNode *, 16 > llvm::collectChildrenInLoop (DomTreeNode *N, const Loop *CurLoop)
 Does a BFS from a given node to all of its children inside a given loop. More...
 
void llvm::computeLoopSafetyInfo (LoopSafetyInfo *, Loop *)
 Computes safety information for a loop checks loop body & header for the possibility of may throw exception, it takes LoopSafetyInfo and loop as argument. More...
 
bool llvm::isGuaranteedToExecute (const Instruction &Inst, const DominatorTree *DT, const Loop *CurLoop, const LoopSafetyInfo *SafetyInfo)
 Returns true if the instruction in a loop is guaranteed to execute at least once. More...
 
SmallVector< Instruction *, 8 > llvm::findDefsUsedOutsideOfLoop (Loop *L)
 Returns the instructions that use values defined in the loop. More...
 
Optional< const MDOperand * > llvm::findStringMetadataForLoop (Loop *TheLoop, StringRef Name)
 Find string metadata for loop. More...
 
void llvm::addStringMetadataToLoop (Loop *TheLoop, const char *MDString, unsigned V=0)
 Set input string into loop metadata by keeping other values intact. More...
 
Optional< unsignedllvm::getLoopEstimatedTripCount (Loop *L)
 Get a loop's estimated trip count based on branch weight metadata. More...
 
void llvm::getLoopAnalysisUsage (AnalysisUsage &AU)
 Helper to consistently add the set of standard passes to a loop pass's AnalysisUsage. More...
 
bool llvm::canSinkOrHoistInst (Instruction &I, AAResults *AA, DominatorTree *DT, Loop *CurLoop, AliasSetTracker *CurAST, LoopSafetyInfo *SafetyInfo, OptimizationRemarkEmitter *ORE=nullptr)
 Returns true if the hoister and sinker can handle this instruction. More...
 
Valuellvm::getShuffleReduction (IRBuilder<> &Builder, Value *Src, unsigned Op, RecurrenceDescriptor::MinMaxRecurrenceKind MinMaxKind=RecurrenceDescriptor::MRK_Invalid, ArrayRef< Value *> RedOps=ArrayRef< Value *>())
 Generates a vector reduction using shufflevectors to reduce the value. More...
 
Valuellvm::createSimpleTargetReduction (IRBuilder<> &B, const TargetTransformInfo *TTI, unsigned Opcode, Value *Src, TargetTransformInfo::ReductionFlags Flags=TargetTransformInfo::ReductionFlags(), ArrayRef< Value *> RedOps=ArrayRef< Value *>())
 Create a target reduction of the given vector. More...
 
Valuellvm::createTargetReduction (IRBuilder<> &B, const TargetTransformInfo *TTI, RecurrenceDescriptor &Desc, Value *Src, bool NoNaN=false)
 Create a generic target reduction using a recurrence descriptor Desc The target is queried to determine if intrinsics or shuffle sequences are required to implement the reduction. More...
 
void llvm::propagateIRFlags (Value *I, ArrayRef< Value *> VL, Value *OpValue=nullptr)
 Get the intersection (logical and) of all of the potential IR flags of each scalar operation (VL) that will be converted into a vector (I). More...