LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Macros | Functions
SimplifyIndVar.cpp File Reference
#include "llvm/Transforms/Utils/SimplifyIndVar.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/IVUsers.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/LoopPass.h"
#include "llvm/Analysis/ScalarEvolutionExpressions.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Instructions.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
Include dependency graph for SimplifyIndVar.cpp:

Go to the source code of this file.

Namespaces

 llvm
 List of target independent CodeGen pass IDs.
 

Macros

#define DEBUG_TYPE   "indvars"
 

Functions

 STATISTIC (NumElimIdentity,"Number of IV identities eliminated")
 
 STATISTIC (NumElimOperand,"Number of IV operands folded into a use")
 
 STATISTIC (NumElimRem,"Number of IV remainder operations eliminated")
 
 STATISTIC (NumElimCmp,"Number of IV comparisons eliminated")
 
static void pushIVUsers (Instruction *Def, SmallPtrSet< Instruction *, 16 > &Simplified, SmallVectorImpl< std::pair< Instruction *, Instruction * > > &SimpleIVUsers)
 
static bool isSimpleIVUser (Instruction *I, const Loop *L, ScalarEvolution *SE)
 
bool llvm::simplifyUsersOfIV (PHINode *CurrIV, ScalarEvolution *SE, LPPassManager *LPM, SmallVectorImpl< WeakVH > &Dead, IVVisitor *V=NULL)
 
bool llvm::simplifyLoopIVs (Loop *L, ScalarEvolution *SE, LPPassManager *LPM, SmallVectorImpl< WeakVH > &Dead)
 

Macro Definition Documentation

#define DEBUG_TYPE   "indvars"

Definition at line 16 of file SimplifyIndVar.cpp.

Function Documentation

static bool isSimpleIVUser ( Instruction I,
const Loop L,
ScalarEvolution SE 
)
static

isSimpleIVUser - Return true if this instruction generates a simple SCEV expression in terms of that IV.

This is similar to IVUsers' isInteresting() but processes each instruction non-recursively when the operand is already known to be a simpleIVUser.

Definition at line 292 of file SimplifyIndVar.cpp.

References llvm::dyn_cast(), llvm::SCEVAddRecExpr::getLoop(), llvm::ScalarEvolution::getSCEV(), llvm::Value::getType(), and llvm::ScalarEvolution::isSCEVable().

static void pushIVUsers ( Instruction Def,
SmallPtrSet< Instruction *, 16 > &  Simplified,
SmallVectorImpl< std::pair< Instruction *, Instruction * > > &  SimpleIVUsers 
)
static

pushIVUsers - Add all uses of Def to the current IV's worklist.

Definition at line 268 of file SimplifyIndVar.cpp.

References llvm::SmallPtrSet< PtrType, SmallSize >::insert(), llvm::Value::use_begin(), and llvm::Value::use_end().

STATISTIC ( NumElimIdentity  ,
"Number of IV identities eliminated"   
)
STATISTIC ( NumElimOperand  ,
"Number of IV operands folded into a use"   
)
STATISTIC ( NumElimRem  ,
"Number of IV remainder operations eliminated"   
)
STATISTIC ( NumElimCmp  ,
"Number of IV comparisons eliminated"   
)