#include "llvm/Analysis/CodeMetrics.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/InstructionCost.h"
#define DEBUG_TYPE …
usingnamespacellvm;
static void
appendSpeculatableOperands(const Value *V,
SmallPtrSetImpl<const Value *> &Visited,
SmallVectorImpl<const Value *> &Worklist) { … }
static void completeEphemeralValues(SmallPtrSetImpl<const Value *> &Visited,
SmallVectorImpl<const Value *> &Worklist,
SmallPtrSetImpl<const Value *> &EphValues) { … }
void CodeMetrics::collectEphemeralValues(
const Loop *L, AssumptionCache *AC,
SmallPtrSetImpl<const Value *> &EphValues) { … }
void CodeMetrics::collectEphemeralValues(
const Function *F, AssumptionCache *AC,
SmallPtrSetImpl<const Value *> &EphValues) { … }
static bool extendsConvergenceOutsideLoop(const Instruction &I, const Loop *L) { … }
void CodeMetrics::analyzeBasicBlock(
const BasicBlock *BB, const TargetTransformInfo &TTI,
const SmallPtrSetImpl<const Value *> &EphValues, bool PrepareForLTO,
const Loop *L) { … }