LLVM  6.0.0svn
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/CodeMetrics.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/ScalarEvolutionExpander.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/Analysis/TargetTransformInfo.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/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/Local.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
 Compute iterated dominance frontiers using a linear time algorithm.
 

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 66 of file PPCCTRLoops.cpp.

Function Documentation

◆ asmClobbersCTR()

static bool asmClobbersCTR ( InlineAsm IA)
static

Definition at line 245 of file PPCCTRLoops.cpp.

References llvm::CodeMetrics::analyzeBasicBlock(), llvm::SmallVectorTemplateCommon< T >::begin(), 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::InlineAsm::ConstraintInfo::Codes, llvm::CodeMetrics::collectEphemeralValues(), llvm::LoopBase< BlockT, LoopT >::contains(), llvm::IRBuilder< T, Inserter >::CreateCall(), CTRLoopLimit, llvm::dbgs(), DEBUG, llvm::DeleteDeadPHIs(), E, llvm::SmallVectorTemplateCommon< T >::end(), llvm::LoopBase< BlockT, LoopT >::end(), llvm::BasicBlock::end(), llvm::StringRef::equals_lower(), llvm::SCEVExpander::expandCodeFor(), llvm::ISD::FCEIL, llvm::ISD::FFLOOR, 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::Type::getScalarType(), llvm::MVT::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::MVT::isVector(), llvm::log2(), llvm::maxnum(), memAddrUsesCTR(), Metrics, llvm::minnum(), llvm::Intrinsic::not_intrinsic, llvm::CodeMetrics::NumInsts, llvm::MVT::Other, llvm::InlineAsm::ParseConstraints(), llvm::pred_begin(), llvm::pred_end(), llvm::RecursivelyDeleteTriviallyDeadInstructions(), round(), llvm::BranchInst::setCondition(), SI, SmallCTRLoopThreshold, llvm::ISD::SMULO, llvm::BranchInst::swapSuccessors(), llvm::SystemZISD::TM, llvm::InlineAsm::ConstraintInfo::Type, 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 216 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 166 of file PPCCTRLoops.cpp.

◆ Loops

ppc ctr PowerPC CTR Loops

Definition at line 166 of file PPCCTRLoops.cpp.

◆ loops

ppc ctr loops

Definition at line 166 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