LLVM  9.0.0svn
Namespaces | Enumerations | 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/DemandedBits.h"
#include "llvm/Analysis/EHPersonalities.h"
#include "llvm/Analysis/IVDescriptors.h"
#include "llvm/Analysis/MustExecute.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.

Namespaces

 llvm
 This class represents lattice values for constants.
 

Enumerations

enum  llvm::TransformationMode {
  llvm::TM_Unspecified, llvm::TM_Enable, llvm::TM_Disable, llvm::TM_Force = 0x04,
  llvm::TM_ForcedByUser = TM_Enable | TM_Force, llvm::TM_SuppressedByUser = TM_Disable | TM_Force
}
 The mode sets how eager a transformation should be applied. More...
 

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 *, TargetTransformInfo *, Loop *, AliasSetTracker *, MemorySSAUpdater *, ICFLoopSafetyInfo *, 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 *, MemorySSAUpdater *, ICFLoopSafetyInfo *, 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 *, ICFLoopSafetyInfo *, 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...
 
SmallVector< Instruction *, 8 > llvm::findDefsUsedOutsideOfLoop (Loop *L)
 Returns the instructions that use values defined in the loop. More...
 
Optional< const MDOperand * > llvm::findStringMetadataForLoop (const Loop *TheLoop, StringRef Name)
 Find string metadata for loop. More...
 
llvm::Optional< int > llvm::getOptionalIntLoopAttribute (Loop *TheLoop, StringRef Name)
 Find named metadata for a loop with an integer value. More...
 
Optional< MDNode * > llvm::makeFollowupLoopID (MDNode *OrigLoopID, ArrayRef< StringRef > FollowupAttrs, const char *InheritOptionsAttrsPrefix="", bool AlwaysNew=false)
 Create a new loop identifier for a loop created from a loop transformation. More...
 
bool llvm::hasDisableAllTransformsHint (const Loop *L)
 Look for the loop attribute that disables all transformation heuristic. 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...
 
bool llvm::hasIterationCountInvariantInParent (Loop *L, ScalarEvolution &SE)
 Check inner loop (L) backedge count is known to be invariant on all iterations of its outer loop. 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, MemorySSAUpdater *MSSAU, bool TargetExecutesOncePerLoop, OptimizationRemarkEmitter *ORE=nullptr)
 Returns true if is legal to hoist or sink this instruction disregarding the possible introduction of faults. More...
 
Valuellvm::createMinMaxOp (IRBuilder<> &Builder, RecurrenceDescriptor::MinMaxRecurrenceKind RK, Value *Left, Value *Right)
 Returns a Min/Max operation corresponding to MinMaxRecurrenceKind. More...
 
Valuellvm::getOrderedReduction (IRBuilder<> &Builder, Value *Acc, Value *Src, unsigned Op, RecurrenceDescriptor::MinMaxRecurrenceKind MinMaxKind=RecurrenceDescriptor::MRK_Invalid, ArrayRef< Value *> RedOps=None)
 Generates an ordered vector reduction using extracts to reduce the value. More...
 
Valuellvm::getShuffleReduction (IRBuilder<> &Builder, Value *Src, unsigned Op, RecurrenceDescriptor::MinMaxRecurrenceKind MinMaxKind=RecurrenceDescriptor::MRK_Invalid, ArrayRef< Value *> RedOps=None)
 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=None)
 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...
 
bool llvm::isKnownNegativeInLoop (const SCEV *S, const Loop *L, ScalarEvolution &SE)
 Returns true if we can prove that S is defined and always negative in loop L. More...
 
bool llvm::isKnownNonNegativeInLoop (const SCEV *S, const Loop *L, ScalarEvolution &SE)
 Returns true if we can prove that S is defined and always non-negative in loop L. More...
 
bool llvm::cannotBeMaxInLoop (const SCEV *S, const Loop *L, ScalarEvolution &SE, bool Signed)
 Returns true if S is defined and never is equal to signed/unsigned max. More...
 
bool llvm::cannotBeMinInLoop (const SCEV *S, const Loop *L, ScalarEvolution &SE, bool Signed)
 Returns true if S is defined and never is equal to signed/unsigned min. More...
 
TransformationMode llvm::hasUnrollTransformation (Loop *L)
 
TransformationMode llvm::hasUnrollAndJamTransformation (Loop *L)
 
TransformationMode llvm::hasVectorizeTransformation (Loop *L)
 
TransformationMode llvm::hasDistributeTransformation (Loop *L)
 
TransformationMode llvm::hasLICMVersioningTransformation (Loop *L)