LLVM 22.0.0git
PPCLoopInstrFormPrep.cpp File Reference

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")
 STATISTIC (ChainCommoningRewritten, "Num of commoning chains")
static bool IsPtrInBounds (Value *BasePtr)
static std::string getInstrName (const Value *I, StringRef Suffix)
static ValuegetPointerOperandAndType (Value *MemI, Type **PtrElementType=nullptr)

Variables

static cl::opt< unsignedMaxVarsPrep ("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< boolPreferUpdateForm ("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< boolEnableUpdateFormForNonConstInc ("ppc-formprep-update-nonconst-inc", cl::init(false), cl::Hidden, cl::desc("prepare update form when the load/store increment is a loop " "invariant non-const value."))
static cl::opt< boolEnableChainCommoning ("ppc-formprep-chain-commoning", cl::init(false), cl::Hidden, cl::desc("Enable chain commoning in PPC loop prepare pass."))
static cl::opt< unsignedMaxVarsUpdateForm ("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< unsignedMaxVarsDSForm ("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< unsignedMaxVarsDQForm ("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< unsignedMaxVarsChainCommon ("ppc-chaincommon-max-vars", cl::Hidden, cl::init(4), cl::desc("Bucket number per loop for PPC loop chain common"))
static cl::opt< unsignedDispFormPrepMinThreshold ("ppc-dispprep-min-threshold", cl::Hidden, cl::init(2), cl::desc("Minimal common base load/store instructions triggering DS/DQ form " "preparation"))
static cl::opt< unsignedChainCommonPrepMinThreshold ("ppc-chaincommon-min-threshold", cl::Hidden, cl::init(4), cl::desc("Minimal common base load/store instructions triggering chain " "commoning preparation. Must be not smaller than 4"))
static const charname = "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 111 of file PPCLoopInstrFormPrep.cpp.

Function Documentation

◆ getInstrName()

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

Definition at line 355 of file PPCLoopInstrFormPrep.cpp.

References assert(), and I.

◆ getPointerOperandAndType()

Value * getPointerOperandAndType ( Value * MemI,
Type ** PtrElementType = nullptr )
static

◆ IsPtrInBounds()

bool IsPtrInBounds ( Value * BasePtr)
static

Definition at line 345 of file PPCLoopInstrFormPrep.cpp.

References llvm::dyn_cast(), and GEP.

◆ STATISTIC() [1/7]

STATISTIC ( ChainCommoningRewritten ,
"Num of commoning chains"  )

References I, and llvm::Offset.

◆ STATISTIC() [2/7]

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

◆ STATISTIC() [3/7]

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

◆ STATISTIC() [4/7]

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

◆ STATISTIC() [5/7]

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

◆ STATISTIC() [6/7]

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

◆ STATISTIC() [7/7]

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

Variable Documentation

◆ CastNodeNameSuffix

StringRef CastNodeNameSuffix = ".cast"
staticconstexpr

Definition at line 337 of file PPCLoopInstrFormPrep.cpp.

◆ ChainCommonPrepMinThreshold

cl::opt< unsigned > ChainCommonPrepMinThreshold("ppc-chaincommon-min-threshold", cl::Hidden, cl::init(4), cl::desc("Minimal common base load/store instructions triggering chain " "commoning preparation. Must be not smaller than 4")) ( "ppc-chaincommon-min-threshold" ,
cl::Hidden ,
cl::init(4) ,
cl::desc("Minimal common base load/store instructions triggering chain " "commoning preparation. Must be not smaller than 4")  )
static

◆ 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")) ( "ppc-dispprep-min-threshold" ,
cl::Hidden ,
cl::init(2) ,
cl::desc("Minimal common base load/store instructions triggering DS/DQ form " "preparation")  )
static

◆ EnableChainCommoning

cl::opt< bool > EnableChainCommoning("ppc-formprep-chain-commoning", cl::init(false), cl::Hidden, cl::desc("Enable chain commoning in PPC loop prepare pass.")) ( "ppc-formprep-chain-commoning" ,
cl::init(false) ,
cl::Hidden ,
cl::desc("Enable chain commoning in PPC loop prepare pass.")  )
static

◆ EnableUpdateFormForNonConstInc

cl::opt< bool > EnableUpdateFormForNonConstInc("ppc-formprep-update-nonconst-inc", cl::init(false), cl::Hidden, cl::desc("prepare update form when the load/store increment is a loop " "invariant non-const value.")) ( "ppc-formprep-update-nonconst-inc" ,
cl::init(false) ,
cl::Hidden ,
cl::desc("prepare update form when the load/store increment is a loop " "invariant non-const value.")  )
static

◆ GEPNodeIncNameSuffix

StringRef GEPNodeIncNameSuffix = ".inc"
staticconstexpr

Definition at line 338 of file PPCLoopInstrFormPrep.cpp.

◆ GEPNodeOffNameSuffix

StringRef GEPNodeOffNameSuffix = ".off"
staticconstexpr

Definition at line 339 of file PPCLoopInstrFormPrep.cpp.

◆ MaxVarsChainCommon

cl::opt< unsigned > MaxVarsChainCommon("ppc-chaincommon-max-vars", cl::Hidden, cl::init(4), cl::desc("Bucket number per loop for PPC loop chain common")) ( "ppc-chaincommon-max-vars" ,
cl::Hidden ,
cl::init(4) ,
cl::desc("Bucket number per loop for PPC loop chain common")  )
static

◆ 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")) ( "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")) ( "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")) ( "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")) ( "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 330 of file PPCLoopInstrFormPrep.cpp.

◆ PHINodeNameSuffix

StringRef PHINodeNameSuffix = ".phi"
staticconstexpr

Definition at line 336 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")) ( "ppc-formprep-prefer-update" ,
cl::init(true) ,
cl::Hidden ,
cl::desc("prefer update form when ds form is also a update form")  )
static