LLVM 20.0.0git
Macros | Functions | Variables
LoopTermFold.cpp File Reference
#include "llvm/Transforms/Scalar/LoopTermFold.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/LoopAnalysisManager.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/LoopPass.h"
#include "llvm/Analysis/MemorySSA.h"
#include "llvm/Analysis/MemorySSAUpdater.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/ScalarEvolutionExpressions.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Value.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Transforms/Utils/LoopUtils.h"
#include "llvm/Transforms/Utils/ScalarEvolutionExpander.h"
#include <cassert>
#include <optional>

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "loop-term-fold"
 

Functions

 STATISTIC (NumTermFold, "Number of terminating condition fold recognized and performed")
 
static std::optional< std::tuple< PHINode *, PHINode *, const SCEV *, bool > > canFoldTermCondOfLoop (Loop *L, ScalarEvolution &SE, DominatorTree &DT, const LoopInfo &LI, const TargetTransformInfo &TTI)
 
static bool RunTermFold (Loop *L, ScalarEvolution &SE, DominatorTree &DT, LoopInfo &LI, const TargetTransformInfo &TTI, TargetLibraryInfo &TLI, MemorySSA *MSSA)
 
 INITIALIZE_PASS_BEGIN (LoopTermFold, "loop-term-fold", "Loop Terminator Folding", false, false) INITIALIZE_PASS_END(LoopTermFold
 

Variables

loop term fold
 
loop term Loop Terminator Folding
 
loop term Loop Terminator false
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "loop-term-fold"

Definition at line 46 of file LoopTermFold.cpp.

Function Documentation

◆ canFoldTermCondOfLoop()

static std::optional< std::tuple< PHINode *, PHINode *, const SCEV *, bool > > canFoldTermCondOfLoop ( Loop L,
ScalarEvolution SE,
DominatorTree DT,
const LoopInfo LI,
const TargetTransformInfo TTI 
)
static

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( LoopTermFold  ,
"loop-term-fold"  ,
"Loop Terminator Folding"  ,
false  ,
false   
)

◆ RunTermFold()

static bool RunTermFold ( Loop L,
ScalarEvolution SE,
DominatorTree DT,
LoopInfo LI,
const TargetTransformInfo TTI,
TargetLibraryInfo TLI,
MemorySSA MSSA 
)
static

◆ STATISTIC()

STATISTIC ( NumTermFold  ,
"Number of terminating condition fold recognized and performed"   
)

Variable Documentation

◆ false

loop term Loop Terminator false

Definition at line 375 of file LoopTermFold.cpp.

◆ fold

loop term fold

Definition at line 374 of file LoopTermFold.cpp.

◆ Folding

loop term Loop Terminator Folding

Definition at line 374 of file LoopTermFold.cpp.