LLVM 20.0.0git
Macros | Functions
ScalarEvolutionExpander.cpp File Reference
#include "llvm/Transforms/Utils/ScalarEvolutionExpander.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/PatternMatch.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Utils/LoopUtils.h"

Go to the source code of this file.

Macros

#define SCEV_DEBUG_WITH_TYPE(TYPE, X)
 

Functions

static const LoopPickMostRelevantLoop (const Loop *A, const Loop *B, DominatorTree &DT)
 PickMostRelevantLoop - Given two loops pick the one that's most relevant for SCEV expansion.
 
static bool canBeCheaplyTransformed (ScalarEvolution &SE, const SCEVAddRecExpr *Phi, const SCEVAddRecExpr *Requested, bool &InvertStep)
 Check whether we can cheaply express the requested SCEV in terms of the available PHI SCEV by truncation and/or inversion of the step.
 
static bool IsIncrementNSW (ScalarEvolution &SE, const SCEVAddRecExpr *AR)
 
static bool IsIncrementNUW (ScalarEvolution &SE, const SCEVAddRecExpr *AR)
 
template<typename T >
static InstructionCost costAndCollectOperands (const SCEVOperand &WorkItem, const TargetTransformInfo &TTI, TargetTransformInfo::TargetCostKind CostKind, SmallVectorImpl< SCEVOperand > &Worklist)
 

Macro Definition Documentation

◆ SCEV_DEBUG_WITH_TYPE

#define SCEV_DEBUG_WITH_TYPE (   TYPE,
  X 
)

Definition at line 34 of file ScalarEvolutionExpander.cpp.

Function Documentation

◆ canBeCheaplyTransformed()

static bool canBeCheaplyTransformed ( ScalarEvolution SE,
const SCEVAddRecExpr Phi,
const SCEVAddRecExpr Requested,
bool InvertStep 
)
static

Check whether we can cheaply express the requested SCEV in terms of the available PHI SCEV by truncation and/or inversion of the step.

Definition at line 900 of file ScalarEvolutionExpander.cpp.

References llvm::Type::getIntegerBitWidth(), llvm::ScalarEvolution::getMinusSCEV(), llvm::SCEVAddRecExpr::getStart(), llvm::ScalarEvolution::getTruncateOrNoop(), llvm::SCEVAddRecExpr::getType(), and llvm::Type::isPointerTy().

◆ costAndCollectOperands()

template<typename T >
static InstructionCost costAndCollectOperands ( const SCEVOperand WorkItem,
const TargetTransformInfo TTI,
TargetTransformInfo::TargetCostKind  CostKind,
SmallVectorImpl< SCEVOperand > &  Worklist 
)
static

◆ IsIncrementNSW()

static bool IsIncrementNSW ( ScalarEvolution SE,
const SCEVAddRecExpr AR 
)
static

◆ IsIncrementNUW()

static bool IsIncrementNUW ( ScalarEvolution SE,
const SCEVAddRecExpr AR 
)
static

◆ PickMostRelevantLoop()

static const Loop * PickMostRelevantLoop ( const Loop A,
const Loop B,
DominatorTree DT 
)
static

PickMostRelevantLoop - Given two loops pick the one that's most relevant for SCEV expansion.

If they are nested, this is the most nested. If they are neighboring, pick the later.

Definition at line 419 of file ScalarEvolutionExpander.cpp.

References A, B, and llvm::DominatorTree::dominates().