LLVM  8.0.1
Namespaces | Macros | Functions | Variables
PPCCTRLoops.cpp File Reference
#include "PPC.h"
#include "PPCSubtarget.h"
#include "PPCTargetMachine.h"
#include "PPCTargetTransformInfo.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/CFG.h"
#include "llvm/Analysis/CodeMetrics.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/LoopIterator.h"
#include "llvm/Analysis/ScalarEvolutionExpander.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/CodeGen/TargetSchedule.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/InlineAsm.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/ValueHandle.h"
#include "llvm/PassSupport.h"
#include "llvm/Support/CommandLine.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/LoopUtils.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
Include dependency graph for PPCCTRLoops.cpp:

Go to the source code of this file.

Namespaces

 llvm
 This class represents lattice values for constants.
 

Macros

#define DEBUG_TYPE   "ctrloops"
 

Functions

 STATISTIC (NumCTRLoops, "Number of loops converted to CTR loops")
 
void llvm::initializePPCCTRLoopsPass (PassRegistry &)
 
void llvm::initializePPCCTRLoopsVerifyPass (PassRegistry &)
 
 INITIALIZE_PASS_BEGIN (PPCCTRLoops, "ppc-ctr-loops", "PowerPC CTR Loops", false, false) INITIALIZE_PASS_END(PPCCTRLoops
 
 INITIALIZE_PASS_BEGIN (PPCCTRLoopsVerify, "ppc-ctr-loops-verify", "PowerPC CTR Loops Verify", false, false) INITIALIZE_PASS_END(PPCCTRLoopsVerify
 
static bool isLargeIntegerTy (bool Is32Bit, Type *Ty)
 
static bool memAddrUsesCTR (const PPCTargetMachine &TM, const Value *MemAddr)
 
static bool asmClobbersCTR (InlineAsm *IA)
 
static bool clobbersCTR (const MachineInstr &MI)
 
static bool verifyCTRBranch (MachineBasicBlock *MBB, MachineBasicBlock::iterator I)
 

Variables

static cl::opt< int > CTRLoopLimit ("ppc-max-ctrloop", cl::Hidden, cl::init(-1))
 
static cl::opt< unsignedSmallCTRLoopThreshold ("min-ctr-loop-threshold", cl::init(4), cl::Hidden, cl::desc("Loops with a constant trip count smaller than " "this value will not use the count register."))
 
ppc ctr loops
 
ppc ctr PowerPC CTR Loops
 
ppc ctr PowerPC CTR false
 
ppc ctr loops verify
 
ppc ctr loops PowerPC CTR Loops Verify
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "ctrloops"

Definition at line 69 of file PPCCTRLoops.cpp.

Function Documentation

◆ asmClobbersCTR()

static bool asmClobbersCTR ( InlineAsm IA)
static

Definition at line 248 of file PPCCTRLoops.cpp.

References llvm::CodeMetrics::analyzeBasicBlock(), llvm::LoopBase< BlockT, LoopT >::begin(), llvm::BasicBlock::begin(), llvm::LoopBase< BlockT, LoopT >::block_begin(), llvm::LoopBase< BlockT, LoopT >::block_end(), llvm::LoopBase< BlockT, LoopT >::blocks(), C, llvm::Intrinsic::ceil, llvm::InlineAsm::ConstraintInfo::Codes, llvm::CodeMetrics::collectEphemeralValues(), llvm::LoopBase< BlockT, LoopT >::contains(), llvm::Intrinsic::copysign, llvm::Intrinsic::cos, llvm::IRBuilder< T, Inserter >::CreateCall(), CTRLoopLimit, llvm::dbgs(), llvm::DeleteDeadPHIs(), E, llvm::Intrinsic::eh_sjlj_setjmp, llvm::LoopBase< BlockT, LoopT >::end(), llvm::BasicBlock::end(), llvm::StringRef::equals_lower(), llvm::Intrinsic::exp, llvm::Intrinsic::exp2, llvm::SCEVExpander::expandCodeFor(), llvm::ISD::FCEIL, llvm::ISD::FFLOOR, llvm::Intrinsic::floor, llvm::ISD::FMAXNUM, llvm::ISD::FMINNUM, llvm::ISD::FNEARBYINT, llvm::ISD::FRINT, llvm::ISD::FROUND, llvm::ISD::FSQRT, llvm::ISD::FTRUNC, llvm::BranchInst::getCondition(), llvm::Value::getContext(), llvm::Intrinsic::getDeclaration(), llvm::CastInst::getDestTy(), llvm::LoopBase< BlockT, LoopT >::getExitingBlocks(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), llvm::Function::getIntrinsicID(), llvm::LoopBase< BlockT, LoopT >::getLoopPreheader(), llvm::Value::getName(), llvm::Loop::getName(), llvm::BasicBlock::getParent(), llvm::GlobalValue::getParent(), llvm::EVT::getScalarType(), llvm::Type::getScalarType(), llvm::CastInst::getSrcTy(), llvm::BranchInst::getSuccessor(), llvm::BasicBlock::getTerminator(), llvm::SCEV::getType(), llvm::GlobalValue::hasLocalLinkage(), llvm::Value::hasName(), I, llvm::ARM_PROC::IE, llvm::InsertPreheaderForLoop(), llvm::InlineAsm::isInput, isLargeIntegerTy(), llvm::Type::isPointerTy(), llvm::Type::isPPC_FP128Ty(), llvm::EVT::isVector(), LLVM_DEBUG, llvm::Intrinsic::log, llvm::Intrinsic::log10, llvm::Intrinsic::log2, llvm::Intrinsic::longjmp, llvm::Intrinsic::maxnum, memAddrUsesCTR(), llvm::Intrinsic::memcpy, llvm::Intrinsic::memmove, llvm::Intrinsic::memset, Metrics, llvm::Intrinsic::minnum, llvm::Intrinsic::nearbyint, llvm::Intrinsic::not_intrinsic, llvm::CodeMetrics::NumInsts, llvm::MVT::Other, llvm::InlineAsm::ParseConstraints(), llvm::LoopBlocksRPO::perform(), llvm::Intrinsic::pow, llvm::Intrinsic::powi, llvm::Intrinsic::ppc_is_decremented_ctr_nonzero, llvm::Intrinsic::ppc_mtctr, llvm::pred_begin(), llvm::pred_end(), llvm::RecursivelyDeleteTriviallyDeadInstructions(), llvm::Intrinsic::rint, llvm::Intrinsic::round, llvm::BranchInst::setCondition(), llvm::Intrinsic::setjmp, SI, llvm::Intrinsic::sin, SmallCTRLoopThreshold, llvm::Intrinsic::smul_with_overflow, llvm::ISD::SMULO, llvm::Intrinsic::sqrt, llvm::BranchInst::swapSuccessors(), llvm::SystemZISD::TM, llvm::Intrinsic::trunc, llvm::InlineAsm::ConstraintInfo::Type, llvm::Intrinsic::umul_with_overflow, and llvm::ISD::UMULO.

◆ clobbersCTR()

static bool clobbersCTR ( const MachineInstr MI)
static

◆ INITIALIZE_PASS_BEGIN() [1/2]

INITIALIZE_PASS_BEGIN ( PPCCTRLoops  ,
"ppc-ctr-loops ,
"PowerPC CTR Loops ,
false  ,
false   
)

Referenced by llvm::createPPCCTRLoops().

◆ INITIALIZE_PASS_BEGIN() [2/2]

INITIALIZE_PASS_BEGIN ( PPCCTRLoopsVerify  ,
"ppc-ctr-loops-verify ,
"PowerPC CTR Loops Verify ,
false  ,
false   
)

◆ isLargeIntegerTy()

static bool isLargeIntegerTy ( bool  Is32Bit,
Type Ty 
)
static

Definition at line 219 of file PPCCTRLoops.cpp.

Referenced by asmClobbersCTR().

◆ memAddrUsesCTR()

static bool memAddrUsesCTR ( const PPCTargetMachine TM,
const Value MemAddr 
)
static

◆ STATISTIC()

STATISTIC ( NumCTRLoops  ,
"Number of loops converted to CTR loops  
)

◆ verifyCTRBranch()

static bool verifyCTRBranch ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  I 
)
static

Variable Documentation

◆ CTRLoopLimit

cl::opt<int> CTRLoopLimit("ppc-max-ctrloop", cl::Hidden, cl::init(-1))
static

Referenced by asmClobbersCTR().

◆ false

ppc ctr loops PowerPC CTR Loops false

Definition at line 169 of file PPCCTRLoops.cpp.

◆ Loops

ppc ctr PowerPC CTR Loops

Definition at line 169 of file PPCCTRLoops.cpp.

◆ loops

ppc ctr loops

Definition at line 169 of file PPCCTRLoops.cpp.

◆ SmallCTRLoopThreshold

cl::opt<unsigned> SmallCTRLoopThreshold("min-ctr-loop-threshold", cl::init(4), cl::Hidden, cl::desc("Loops with a constant trip count smaller than " "this value will not use the count register."))
static

Referenced by asmClobbersCTR().

◆ verify

ppc ctr loops verify

◆ Verify

static void Verify