LLVM: lib/Transforms/Scalar/EarlyCSE.cpp File Reference (original) (raw)
Go to the source code of this file.
| Macros | |
|---|---|
| #define | DEBUG_TYPE "early-cse" |
| Typedefs | |
|---|---|
| using | EarlyCSELegacyPass = EarlyCSELegacyCommonPass |
| Functions | |
|---|---|
| STATISTIC (NumSimplify, "Number of instructions simplified or DCE'd") | |
| STATISTIC (NumCSE, "Number of instructions CSE'd") | |
| STATISTIC (NumCSECVP, "Number of compare instructions CVP'd") | |
| STATISTIC (NumCSELoad, "Number of load instructions CSE'd") | |
| STATISTIC (NumCSECall, "Number of call instructions CSE'd") | |
| STATISTIC (NumCSEGEP, "Number of GEP instructions CSE'd") | |
| STATISTIC (NumDSE, "Number of trivial dead stores removed") | |
| DEBUG_COUNTER (CSECounter, "early-cse", "Controls which instructions are removed") | |
| static bool | matchSelectWithOptionalNotCond (Value *V, Value *&Cond, Value *&A, Value *&B, SelectPatternFlavor &Flavor) |
| Match a 'select' including an optional 'not's of the condition. | |
| static unsigned | hashCallInst (CallInst *CI) |
| static unsigned | getHashValueImpl (SimpleValue Val) |
| static bool | isEqualImpl (SimpleValue LHS, SimpleValue RHS) |
| static void | combineIRFlags (Instruction &From, Value *To) |
| INITIALIZE_PASS_BEGIN (EarlyCSELegacyPass, "early-cse", "Early CSE", false, false) using EarlyCSEMemSSALegacyPass | |
| INITIALIZE_PASS_BEGIN (EarlyCSEMemSSALegacyPass, "early-cse-memssa", "Early CSE w/ MemorySSA", false, false) INITIALIZE_PASS_END(EarlyCSEMemSSALegacyPass |
| Variables | |
|---|---|
| static cl::opt< unsigned > | EarlyCSEMssaOptCap ("earlycse-mssa-optimization-cap", cl::init(500), cl::Hidden, cl::desc("Enable imprecision in EarlyCSE in pathological cases, in exchange " "for faster compile. Caps the MemorySSA clobbering calls.")) |
| static cl::opt< bool > | EarlyCSEDebugHash ("earlycse-debug-hash", cl::init(false), cl::Hidden, cl::desc("Perform extra assertion checking to verify that SimpleValue's hash " "function is well-behaved w.r.t. its isEqual predicate")) |
| early cse | memssa |
| early cse Early CSE w | MemorySSA |
| early cse Early CSE w | false |
◆ DEBUG_TYPE
#define DEBUG_TYPE "early-cse"
◆ EarlyCSELegacyPass
using EarlyCSELegacyPass = EarlyCSELegacyCommonPass
◆ combineIRFlags()
◆ DEBUG_COUNTER()
| DEBUG_COUNTER | ( | CSECounter | , |
|---|---|---|---|
| "early-cse" | , | ||
| "Controls which instructions are removed" | ) |
◆ getHashValueImpl()
| unsigned getHashValueImpl ( SimpleValue Val) | static |
|---|
Definition at line 229 of file EarlyCSE.cpp.
References A(), assert(), B(), Cond, llvm::drop_begin(), llvm::dyn_cast(), llvm::CmpInst::getInversePredicate(), llvm::Instruction::getOpcode(), llvm::hash_combine(), llvm::hash_combine_range(), hashCallInst(), II, llvm::isa(), LHS, llvm::PatternMatch::m_Cmp(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), matchSelectWithOptionalNotCond(), llvm::User::operand_values(), RHS, llvm::SPF_SMAX, llvm::SPF_SMIN, llvm::SPF_UMAX, llvm::SPF_UMIN, std::swap(), X, and Y.
Referenced by EliminateDuplicatePHINodesSetBasedImpl(), and llvm::DenseMapInfo< std::tuple< Ts... > >::getHashValue().
◆ hashCallInst()
◆ INITIALIZE_PASS_BEGIN() [1/2]
| INITIALIZE_PASS_BEGIN | ( | EarlyCSELegacyPass | , |
|---|---|---|---|
| "early-cse" | , | ||
| "Early CSE" | , | ||
| false | , | ||
| false | ) |
◆ INITIALIZE_PASS_BEGIN() [2/2]
| INITIALIZE_PASS_BEGIN | ( | EarlyCSEMemSSALegacyPass | , |
|---|---|---|---|
| "early-cse-memssa" | , | ||
| "Early CSE w/ MemorySSA" | , | ||
| false | , | ||
| false | ) |
◆ isEqualImpl()
| bool isEqualImpl ( SimpleValue LHS, SimpleValue RHS ) | static |
|---|
Definition at line 350 of file EarlyCSE.cpp.
References assert(), llvm::cast(), llvm::dyn_cast(), llvm::CmpInst::getInversePredicate(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::CmpInst::getPredicate(), llvm::isa(), llvm::Instruction::isIdenticalToWhenDefined(), LHS, llvm::PatternMatch::m_Cmp(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), matchSelectWithOptionalNotCond(), RHS, llvm::SPF_SMAX, llvm::SPF_SMIN, llvm::SPF_UMAX, llvm::SPF_UMIN, X, and Y.
Referenced by EliminateDuplicatePHINodesSetBasedImpl(), and llvm::DenseMapInfo< std::tuple< Ts... > >::isEqual().
◆ matchSelectWithOptionalNotCond()
Match a 'select' including an optional 'not's of the condition.
Definition at line 171 of file EarlyCSE.cpp.
References A(), B(), Cond, llvm::CmpInst::getSwappedPredicate(), llvm::CmpInst::ICMP_SGE, llvm::CmpInst::ICMP_SGT, llvm::CmpInst::ICMP_SLE, llvm::CmpInst::ICMP_SLT, llvm::CmpInst::ICMP_UGE, llvm::CmpInst::ICMP_UGT, llvm::CmpInst::ICMP_ULE, llvm::CmpInst::ICMP_ULT, llvm::PatternMatch::m_ICmp(), llvm::MIPatternMatch::m_Not(), llvm::PatternMatch::m_Select(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::SPF_SMAX, llvm::SPF_SMIN, llvm::SPF_UMAX, llvm::SPF_UMIN, llvm::SPF_UNKNOWN, and std::swap().
Referenced by getHashValueImpl(), and isEqualImpl().
◆ STATISTIC() [1/7]
◆ STATISTIC() [2/7]
◆ STATISTIC() [3/7]
| STATISTIC | ( | NumCSECVP | , |
|---|---|---|---|
| "Number of compare instructions CVP'd" | ) |
◆ STATISTIC() [4/7]
◆ STATISTIC() [5/7]
◆ STATISTIC() [6/7]
| STATISTIC | ( | NumDSE | , |
|---|---|---|---|
| "Number of trivial dead stores removed" | ) |
◆ STATISTIC() [7/7]
| STATISTIC | ( | NumSimplify | , |
|---|---|---|---|
| "Number of instructions simplified or DCE'd" | ) |
◆ EarlyCSEDebugHash
| cl::opt< bool > EarlyCSEDebugHash("earlycse-debug-hash", cl::init(false), cl::Hidden, cl::desc("Perform extra assertion checking to verify that SimpleValue's hash " "function is well-behaved w.r.t. its isEqual predicate")) ( "earlycse-debug-hash" , cl::init(false) , cl::Hidden , cl::desc("Perform extra assertion checking to verify that SimpleValue's hash " "function is well-behaved w.r.t. its isEqual predicate") ) | static |
|---|
◆ EarlyCSEMssaOptCap
| cl::opt< unsigned > EarlyCSEMssaOptCap("earlycse-mssa-optimization-cap", cl::init(500), cl::Hidden, cl::desc("Enable imprecision in EarlyCSE in pathological cases, in exchange " "for faster compile. Caps the MemorySSA clobbering calls.")) ( "earlycse-mssa-optimization-cap" , cl::init(500) , cl::Hidden , cl::desc("Enable imprecision in EarlyCSE in pathological cases, in exchange " "for faster compile. Caps the MemorySSA clobbering calls.") ) | static |
|---|
◆ false
early cse Early CSE w false