LLVM: lib/Transforms/InstCombine/InstCombinePHI.cpp File Reference (original) (raw)

Go to the source code of this file.

Macros
#define DEBUG_TYPE "instcombine"
Functions
STATISTIC (NumPHIsOfInsertValues, "Number of phi-of-insertvalue turned into insertvalue-of-phis")
STATISTIC (NumPHIsOfExtractValues, "Number of phi-of-extractvalue turned into extractvalue-of-phi")
STATISTIC (NumPHICSEs, "Number of PHI's that got CSE'd")
static bool isSafeAndProfitableToSinkLoad (LoadInst *L)
Return true if we know that it is safe to sink the load out of the block that defines it.
static bool PHIsEqualValue (PHINode *PN, Value *&NonPhiInVal, SmallPtrSetImpl< PHINode * > &ValueEqualPHIs)
Return true if this phi node is always equal to NonPhiInVal.
static ConstantInt * getAnyNonZeroConstInt (PHINode &PN)
Return an existing non-zero constant if this phi node has one, otherwise return constant 1.
static Value * simplifyUsingControlFlow (InstCombiner &Self, PHINode &PN, const DominatorTree &DT)
static Value * foldDependentIVs (PHINode &PN, IRBuilderBase &Builder)

DEBUG_TYPE

#define DEBUG_TYPE "instcombine"

foldDependentIVs()

Definition at line 1383 of file InstCombinePHI.cpp.

References assert(), llvm::cast(), llvm::dyn_cast(), GEP, llvm::ConstantExpr::getBinOpIdentity(), llvm::BasicBlock::getFirstInsertionPt(), llvm::PHINode::getIncomingValue(), llvm::Constant::getNullValue(), llvm::PHINode::getNumIncomingValues(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::Value::getType(), llvm::PatternMatch::m_BinOp(), llvm::PatternMatch::m_c_BinOp(), llvm::PatternMatch::m_GEP(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::match(), and llvm::matchSimpleRecurrence().

getAnyNonZeroConstInt()

isSafeAndProfitableToSinkLoad()

PHIsEqualValue()

simplifyUsingControlFlow()

Definition at line 1280 of file InstCombinePHI.cpp.

References llvm::all_of(), llvm::PHINode::blocks(), llvm::InstCombiner::Builder, llvm::CallingConv::C, llvm::cast(), Cond, llvm::IRBuilderBase::CreateNot(), llvm::DominatorTree::dominates(), llvm::dyn_cast(), llvm::BasicBlock::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::DomTreeNodeBase< NodeT >::getBlock(), llvm::Value::getContext(), llvm::ConstantInt::getFalse(), llvm::BasicBlock::getFirstInsertionPt(), llvm::DomTreeNodeBase< NodeT >::getIDom(), llvm::DominatorTreeBase< NodeT, IsPostDom >::getNode(), llvm::ConstantExpr::getNot(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::ConstantInt::getTrue(), llvm::Value::getType(), llvm::PHINode::incoming_values(), llvm::IsaPred, llvm::DominatorTree::isReachableFromEntry(), llvm::User::operands(), llvm::IRBuilderBase::SetInsertPoint(), and llvm::zip().

STATISTIC() [1/3]

STATISTIC ( NumPHICSEs ,
"Number of PHI's that got CSE'd" )

STATISTIC() [2/3]

STATISTIC ( NumPHIsOfExtractValues ,
"Number of phi-of-extractvalue turned into extractvalue-of-phi" )

STATISTIC() [3/3]

STATISTIC ( NumPHIsOfInsertValues ,
"Number of phi-of-insertvalue turned into insertvalue-of-phis" )

MaxNumPhis

cl::opt< unsigned > MaxNumPhis("instcombine-max-num-phis", cl::init(512), cl::desc("Maximum number phis to handle in intptr/ptrint folding")) ( "instcombine-max-num-phis" , cl::init(512) , cl::desc("Maximum number phis to handle in intptr/ptrint folding") ) static