#include "llvm/Analysis/IVUsers.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/CodeMetrics.h"
#include "llvm/Analysis/LoopAnalysisManager.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/LoopPass.h"
#include "llvm/Analysis/ScalarEvolutionExpressions.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
#include "llvm/InitializePasses.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
usingnamespacellvm;
#define DEBUG_TYPE …
AnalysisKey IVUsersAnalysis::Key;
IVUsers IVUsersAnalysis::run(Loop &L, LoopAnalysisManager &AM,
LoopStandardAnalysisResults &AR) { … }
char IVUsersWrapperPass::ID = …;
INITIALIZE_PASS_BEGIN(IVUsersWrapperPass, "iv-users",
"Induction Variable Users", false, true)
INITIALIZE_PASS_DEPENDENCY(AssumptionCacheTracker)
INITIALIZE_PASS_DEPENDENCY(LoopInfoWrapperPass)
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
INITIALIZE_PASS_DEPENDENCY(ScalarEvolutionWrapperPass)
INITIALIZE_PASS_END(IVUsersWrapperPass, "iv-users", "Induction Variable Users",
false, true)
Pass *llvm::createIVUsersPass() { … }
static bool isInteresting(const SCEV *S, const Instruction *I, const Loop *L,
ScalarEvolution *SE, LoopInfo *LI) { … }
static bool IVUseShouldUsePostIncValue(Instruction *User, Value *Operand,
const Loop *L, DominatorTree *DT) { … }
bool IVUsers::AddUsersIfInteresting(Instruction *I) { … }
IVStrideUse &IVUsers::AddUser(Instruction *User, Value *Operand) { … }
IVUsers::IVUsers(Loop *L, AssumptionCache *AC, LoopInfo *LI, DominatorTree *DT,
ScalarEvolution *SE)
: … { … }
void IVUsers::print(raw_ostream &OS, const Module *M) const { … }
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
LLVM_DUMP_METHOD void IVUsers::dump() const { print(dbgs()); }
#endif
void IVUsers::releaseMemory() { … }
IVUsersWrapperPass::IVUsersWrapperPass() : … { … }
void IVUsersWrapperPass::getAnalysisUsage(AnalysisUsage &AU) const { … }
bool IVUsersWrapperPass::runOnLoop(Loop *L, LPPassManager &LPM) { … }
void IVUsersWrapperPass::print(raw_ostream &OS, const Module *M) const { … }
void IVUsersWrapperPass::releaseMemory() { … }
const SCEV *IVUsers::getReplacementExpr(const IVStrideUse &IU) const { … }
const SCEV *IVUsers::getExpr(const IVStrideUse &IU) const { … }
static const SCEVAddRecExpr *findAddRecForLoop(const SCEV *S, const Loop *L) { … }
const SCEV *IVUsers::getStride(const IVStrideUse &IU, const Loop *L) const { … }
void IVStrideUse::transformToPostInc(const Loop *L) { … }
void IVStrideUse::deleted() { … }