LLVM 20.0.0git
|
#include "llvm/Transforms/Scalar/EarlyCSE.h"
#include "llvm/ADT/DenseMapInfo.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/ScopedHashTable.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/GlobalsModRef.h"
#include "llvm/Analysis/GuardUtils.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/Analysis/MemorySSA.h"
#include "llvm/Analysis/MemorySSAUpdater.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/PassManager.h"
#include "llvm/IR/PatternMatch.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Value.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/AtomicOrdering.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/DebugCounter.h"
#include "llvm/Support/RecyclingAllocator.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/AssumeBundleBuilder.h"
#include "llvm/Transforms/Utils/Local.h"
#include <cassert>
#include <deque>
#include <memory>
#include <utility>
Go to the source code of this file.
Classes | |
struct | llvm::DenseMapInfo< SimpleValue > |
struct | llvm::DenseMapInfo< CallValue > |
struct | llvm::DenseMapInfo< GEPValue > |
Namespaces | |
namespace | llvm |
This is an optimization pass for GlobalISel generic memory operations. | |
Macros | |
#define | DEBUG_TYPE "early-cse" |
Typedefs | |
using | EarlyCSELegacyPass = EarlyCSELegacyCommonPass< false > |
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 |
#define DEBUG_TYPE "early-cse" |
Definition at line 63 of file EarlyCSE.cpp.
using EarlyCSELegacyPass = EarlyCSELegacyCommonPass<false> |
Definition at line 1913 of file EarlyCSE.cpp.
|
static |
Definition at line 1298 of file EarlyCSE.cpp.
References From, I, and llvm::programUndefinedIfPoison().
DEBUG_COUNTER | ( | CSECounter | , |
"early-cse" | , | ||
"Controls which instructions are removed" | |||
) |
|
static |
Definition at line 235 of file EarlyCSE.cpp.
References A, assert(), B, Cond, llvm::CmpInst::getInversePredicate(), llvm::Instruction::getOpcode(), llvm::hash_combine(), llvm::hash_combine_range(), hashCallInst(), II, LHS, llvm::PatternMatch::m_Cmp(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), matchSelectWithOptionalNotCond(), RHS, llvm::SPF_SMAX, llvm::SPF_SMIN, llvm::SPF_UMAX, llvm::SPF_UMIN, std::swap(), llvm::User::value_op_begin(), llvm::User::value_op_end(), X, and Y.
Referenced by EliminateDuplicatePHINodesSetBasedImpl().
Definition at line 222 of file EarlyCSE.cpp.
References llvm::Instruction::getOpcode(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::hash_combine(), llvm::hash_combine_range(), llvm::CallBase::isConvergent(), llvm::User::value_op_begin(), and llvm::User::value_op_end().
Referenced by getHashValueImpl().
INITIALIZE_PASS_BEGIN | ( | EarlyCSELegacyPass | , |
"early-cse" | , | ||
"Early CSE" | , | ||
false | , | ||
false | |||
) |
INITIALIZE_PASS_BEGIN | ( | EarlyCSEMemSSALegacyPass | , |
"early-cse-memssa" | , | ||
"Early CSE w/ MemorySSA" | , | ||
false | , | ||
false | |||
) |
|
static |
Definition at line 357 of file EarlyCSE.cpp.
References assert(), llvm::CmpInst::getInversePredicate(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::CmpInst::getPredicate(), llvm::CallBase::isConvergent(), 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().
|
static |
Match a 'select' including an optional 'not's of the condition.
Definition at line 175 of file EarlyCSE.cpp.
References A, B, Cond, 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::PatternMatch::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 | ( | NumCSE | , |
"Number of instructions CSE'd" | |||
) |
STATISTIC | ( | NumCSECall | , |
"Number of call instructions CSE'd" | |||
) |
STATISTIC | ( | NumCSECVP | , |
"Number of compare instructions CVP'd" | |||
) |
STATISTIC | ( | NumCSEGEP | , |
"Number of GEP instructions CSE'd" | |||
) |
STATISTIC | ( | NumCSELoad | , |
"Number of load instructions CSE'd" | |||
) |
STATISTIC | ( | NumDSE | , |
"Number of trivial dead stores removed" | |||
) |
STATISTIC | ( | NumSimplify | , |
"Number of instructions simplified or DCE'd" | |||
) |
|
static |
|
static |
Definition at line 1948 of file EarlyCSE.cpp.
Definition at line 1948 of file EarlyCSE.cpp.
early cse memssa |
Definition at line 1947 of file EarlyCSE.cpp.