LLVM  14.0.0git
Macros | Functions | Variables
PPCLoopInstrFormPrep.cpp File Reference
#include "PPC.h"
#include "PPCSubtarget.h"
#include "PPCTargetMachine.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/ScalarEvolutionExpressions.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/IntrinsicsPowerPC.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Value.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.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 <iterator>
#include <utility>
Include dependency graph for PPCLoopInstrFormPrep.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "ppc-loop-instr-form-prep"
 

Functions

 STATISTIC (PHINodeAlreadyExistsUpdate, "PHI node already in pre-increment form")
 
 STATISTIC (PHINodeAlreadyExistsDS, "PHI node already in DS form")
 
 STATISTIC (PHINodeAlreadyExistsDQ, "PHI node already in DQ form")
 
 STATISTIC (DSFormChainRewritten, "Num of DS form chain rewritten")
 
 STATISTIC (DQFormChainRewritten, "Num of DQ form chain rewritten")
 
 STATISTIC (UpdFormChainRewritten, "Num of update form chain rewritten")
 
static bool IsPtrInBounds (Value *BasePtr)
 
static std::string getInstrName (const Value *I, StringRef Suffix)
 
static ValueGetPointerOperand (Value *MemI)
 

Variables

static cl::opt< unsigned > MaxVarsPrep ("ppc-formprep-max-vars", cl::Hidden, cl::init(24), cl::desc("Potential common base number threshold per function for PPC loop " "prep"))
 
static cl::opt< bool > PreferUpdateForm ("ppc-formprep-prefer-update", cl::init(true), cl::Hidden, cl::desc("prefer update form when ds form is also a update form"))
 
static cl::opt< unsigned > MaxVarsUpdateForm ("ppc-preinc-prep-max-vars", cl::Hidden, cl::init(3), cl::desc("Potential PHI threshold per loop for PPC loop prep of update " "form"))
 
static cl::opt< unsigned > MaxVarsDSForm ("ppc-dsprep-max-vars", cl::Hidden, cl::init(3), cl::desc("Potential PHI threshold per loop for PPC loop prep of DS form"))
 
static cl::opt< unsigned > MaxVarsDQForm ("ppc-dqprep-max-vars", cl::Hidden, cl::init(8), cl::desc("Potential PHI threshold per loop for PPC loop prep of DQ form"))
 
static cl::opt< unsigned > DispFormPrepMinThreshold ("ppc-dispprep-min-threshold", cl::Hidden, cl::init(2), cl::desc("Minimal common base load/store instructions triggering DS/DQ form " "preparation"))
 
static const char * name = "Prepare loop for ppc preferred instruction forms"
 
static constexpr StringRef PHINodeNameSuffix = ".phi"
 
static constexpr StringRef CastNodeNameSuffix = ".cast"
 
static constexpr StringRef GEPNodeIncNameSuffix = ".inc"
 
static constexpr StringRef GEPNodeOffNameSuffix = ".off"
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "ppc-loop-instr-form-prep"

Definition at line 80 of file PPCLoopInstrFormPrep.cpp.

Function Documentation

◆ getInstrName()

static std::string getInstrName ( const Value I,
StringRef  Suffix 
)
static

Definition at line 264 of file PPCLoopInstrFormPrep.cpp.

References assert(), and I.

◆ GetPointerOperand()

static Value* GetPointerOperand ( Value MemI)
static

Definition at line 272 of file PPCLoopInstrFormPrep.cpp.

References prefetch.

◆ IsPtrInBounds()

static bool IsPtrInBounds ( Value BasePtr)
static

Definition at line 254 of file PPCLoopInstrFormPrep.cpp.

References GEP.

◆ STATISTIC() [1/6]

STATISTIC ( DQFormChainRewritten  ,
"Num of DQ form chain rewritten  
)

◆ STATISTIC() [2/6]

STATISTIC ( DSFormChainRewritten  ,
"Num of DS form chain rewritten  
)

◆ STATISTIC() [3/6]

STATISTIC ( PHINodeAlreadyExistsDQ  ,
"PHI node already in DQ form"   
)

◆ STATISTIC() [4/6]

STATISTIC ( PHINodeAlreadyExistsDS  ,
"PHI node already in DS form"   
)

◆ STATISTIC() [5/6]

STATISTIC ( PHINodeAlreadyExistsUpdate  ,
"PHI node already in pre-increment form"   
)

◆ STATISTIC() [6/6]

STATISTIC ( UpdFormChainRewritten  ,
"Num of update form chain rewritten  
)

Variable Documentation

◆ CastNodeNameSuffix

constexpr StringRef CastNodeNameSuffix = ".cast"
staticconstexpr

Definition at line 246 of file PPCLoopInstrFormPrep.cpp.

◆ DispFormPrepMinThreshold

cl::opt<unsigned> DispFormPrepMinThreshold("ppc-dispprep-min-threshold", cl::Hidden, cl::init(2), cl::desc("Minimal common base load/store instructions triggering DS/DQ form " "preparation"))
static

◆ GEPNodeIncNameSuffix

constexpr StringRef GEPNodeIncNameSuffix = ".inc"
staticconstexpr

Definition at line 247 of file PPCLoopInstrFormPrep.cpp.

◆ GEPNodeOffNameSuffix

constexpr StringRef GEPNodeOffNameSuffix = ".off"
staticconstexpr

Definition at line 248 of file PPCLoopInstrFormPrep.cpp.

◆ MaxVarsDQForm

cl::opt<unsigned> MaxVarsDQForm("ppc-dqprep-max-vars", cl::Hidden, cl::init(8), cl::desc("Potential PHI threshold per loop for PPC loop prep of DQ form"))
static

◆ MaxVarsDSForm

cl::opt<unsigned> MaxVarsDSForm("ppc-dsprep-max-vars", cl::Hidden, cl::init(3), cl::desc("Potential PHI threshold per loop for PPC loop prep of DS form"))
static

◆ MaxVarsPrep

cl::opt<unsigned> MaxVarsPrep("ppc-formprep-max-vars", cl::Hidden, cl::init(24), cl::desc("Potential common base number threshold per function for PPC loop " "prep"))
static

◆ MaxVarsUpdateForm

cl::opt<unsigned> MaxVarsUpdateForm("ppc-preinc-prep-max-vars", cl::Hidden, cl::init(3), cl::desc("Potential PHI threshold per loop for PPC loop prep of update " "form"))
static

◆ name

const char* name = "Prepare loop for ppc preferred instruction forms"
static

Definition at line 239 of file PPCLoopInstrFormPrep.cpp.

◆ PHINodeNameSuffix

constexpr StringRef PHINodeNameSuffix = ".phi"
staticconstexpr

Definition at line 245 of file PPCLoopInstrFormPrep.cpp.

◆ PreferUpdateForm

cl::opt<bool> PreferUpdateForm("ppc-formprep-prefer-update", cl::init(true), cl::Hidden, cl::desc("prefer update form when ds form is also a update form"))
static