LLVM  14.0.0git
Classes | Namespaces | Macros | Functions | Variables
HexagonCommonGEP.cpp File Reference
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/PostDominators.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Use.h"
#include "llvm/IR/User.h"
#include "llvm/IR/Value.h"
#include "llvm/IR/Verifier.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Utils/Local.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <iterator>
#include <map>
#include <set>
#include <utility>
#include <vector>
Include dependency graph for HexagonCommonGEP.cpp:

Go to the source code of this file.

Classes

struct  false::GepNode
 
struct  false::in_set
 

Namespaces

 llvm
 This file implements support for optimizing divisions by a constant.
 
 false
 

Macros

#define DEBUG_TYPE   "commgep"
 

Functions

void llvm::initializeHexagonCommonGEPPass (PassRegistry &)
 
 INITIALIZE_PASS_BEGIN (HexagonCommonGEP, "hcommgep", "Hexagon Common GEP", false, false) INITIALIZE_PASS_END(HexagonCommonGEP
 
raw_ostreamfalse::operator<< (raw_ostream &OS, const GepNode &GN)
 
template<typename NodeContainer >
void false::dump_node_container (raw_ostream &OS, const NodeContainer &S)
 
raw_ostreamfalse::operator<< (raw_ostream &OS, const NodeVect &S) LLVM_ATTRIBUTE_UNUSED
 
raw_ostreamfalse::operator<< (raw_ostream &OS, const NodeToUsesMap &M) LLVM_ATTRIBUTE_UNUSED
 
void * operator new (size_t, SpecificBumpPtrAllocator< GepNode > &A)
 
static void invert_find_roots (const NodeVect &Nodes, NodeChildrenMap &NCM, NodeVect &Roots)
 
static void nodes_for_root (GepNode *Root, NodeChildrenMap &NCM, NodeSet &Nodes)
 
static const NodeSetnode_class (GepNode *N, NodeSymRel &Rel)
 
static NodePair node_pair (GepNode *N1, GepNode *N2)
 
static unsigned node_hash (GepNode *N)
 
static bool node_eq (GepNode *N1, GepNode *N2, NodePairSet &Eq, NodePairSet &Ne)
 
template<typename T >
static BasicBlocknearest_common_dominator (DominatorTree *DT, T &Blocks)
 
template<typename T >
static BasicBlocknearest_common_dominatee (DominatorTree *DT, T &Blocks)
 
template<typename T >
static BasicBlock::iterator first_use_of_in_block (T &Values, BasicBlock *B)
 
static bool is_empty (const BasicBlock *B)
 
static BasicBlockpreheader (DominatorTree *DT, Loop *L)
 
FunctionPassllvm::createHexagonCommonGEP ()
 

Variables

static cl::opt< bool > OptSpeculate ("commgep-speculate", cl::init(true), cl::Hidden, cl::ZeroOrMore)
 
static cl::opt< bool > OptEnableInv ("commgep-inv", cl::init(true), cl::Hidden, cl::ZeroOrMore)
 
static cl::opt< bool > OptEnableConst ("commgep-const", cl::init(true), cl::Hidden, cl::ZeroOrMore)
 
 hcommgep
 
Hexagon Common GEP
 
Hexagon Common false
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "commgep"

Definition at line 50 of file HexagonCommonGEP.cpp.

Function Documentation

◆ first_use_of_in_block()

template<typename T >
static BasicBlock::iterator first_use_of_in_block ( T Values,
BasicBlock B 
)
static

Definition at line 732 of file HexagonCommonGEP.cpp.

References B, E, I, and llvm::tgtok::In.

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( HexagonCommonGEP  ,
"hcommgep"  ,
"Hexagon Common GEP ,
false  ,
false   
)

◆ invert_find_roots()

static void invert_find_roots ( const NodeVect &  Nodes,
NodeChildrenMap &  NCM,
NodeVect &  Roots 
)
static

Definition at line 438 of file HexagonCommonGEP.cpp.

References E, I, and N.

◆ is_empty()

static bool is_empty ( const BasicBlock B)
static

Definition at line 758 of file HexagonCommonGEP.cpp.

References B.

◆ nearest_common_dominatee()

template<typename T >
static BasicBlock* nearest_common_dominatee ( DominatorTree DT,
T Blocks 
)
static

◆ nearest_common_dominator()

template<typename T >
static BasicBlock* nearest_common_dominator ( DominatorTree DT,
T Blocks 
)
static

◆ node_class()

static const NodeSet* node_class ( GepNode *  N,
NodeSymRel &  Rel 
)
static

Definition at line 479 of file HexagonCommonGEP.cpp.

References E, I, and N.

◆ node_eq()

static bool node_eq ( GepNode *  N1,
GepNode *  N2,
NodePairSet &  Eq,
NodePairSet &  Ne 
)
static

Definition at line 505 of file HexagonCommonGEP.cpp.

References node_hash(), node_pair(), and P.

◆ node_hash()

static unsigned node_hash ( GepNode *  N)
static

Definition at line 497 of file HexagonCommonGEP.cpp.

References N.

Referenced by node_eq().

◆ node_pair()

static NodePair node_pair ( GepNode *  N1,
GepNode *  N2 
)
static

Definition at line 489 of file HexagonCommonGEP.cpp.

References P2.

Referenced by node_eq().

◆ nodes_for_root()

static void nodes_for_root ( GepNode *  Root,
NodeChildrenMap &  NCM,
NodeSet Nodes 
)
static

Definition at line 453 of file HexagonCommonGEP.cpp.

References llvm::append_range(), First, llvm::NodeSet::insert(), and N.

◆ operator new()

void* operator new ( size_t  ,
SpecificBumpPtrAllocator< GepNode > &  A 
)
inline

Definition at line 323 of file HexagonCommonGEP.cpp.

◆ preheader()

static BasicBlock* preheader ( DominatorTree DT,
Loop L 
)
static

Variable Documentation

◆ false

Hexagon Common false

Definition at line 173 of file HexagonCommonGEP.cpp.

◆ GEP

Hexagon Common GEP

Definition at line 172 of file HexagonCommonGEP.cpp.

Referenced by BatchCommitValueTo(), buildNew(), calculateVectorIndex(), canCreateUndefOrPoison(), llvm::FastISel::canFoldAddIntoGEP(), chainToBasePointerCost(), CheckAndCreateOffsetAdd(), checkOverflow(), CleanupConstantGlobalUsers(), llvm::InstCombinerImpl::commonPointerCastTransforms(), llvm::ObjectSizeOffsetVisitor::compute(), llvm::ConstantFoldCastOperand(), llvm::ConstantFoldExtractElementInstruction(), llvm::ConstantFoldGetElementPtr(), ConstructLoadOperandConstant(), convertBitCastToGEP(), convertToRelLookupTable(), llvm::GetElementPtrInst::CreateInBounds(), decompose(), doPromotion(), llvm::EmitGEPOffset(), evaluateGEPOffsetExpression(), llvm::findAllocaForValue(), findBaseDefiningValue(), findBaseDefiningValueOfVector(), findLoadCallsAtConstantOffset(), findRematerializableChainToBasePointer(), FindSingleUseIdentifiedObject(), llvm::InstCombinerImpl::foldCmpLoadFromIndexedGlobal(), foldGEPOfGEP(), llvm::InstCombinerImpl::foldICmpAndConstant(), llvm::InstCombinerImpl::foldICmpInstWithConstantNotInt(), llvm::InstCombinerImpl::foldPHIArgGEPIntoPHI(), foldSelectGEP(), for(), llvm::gep_type_begin(), llvm::gep_type_end(), GEPSequentialConstIndexed(), GEPToVectorIndex(), getAdjustedPtr(), llvm::ConstantExpr::getAlignOf(), getAsConstantIndexedAddress(), getBaseType(), llvm::getConstantDataArrayInfo(), llvm::ARMTTIImpl::getGatherScatterOpCost(), llvm::ScalarEvolution::getGEPExpr(), getGEPSmallConstantIntOffsetV(), llvm::getIndexExpressionsFromGEP(), getInvariantGroupClobberingInstruction(), llvm::MemoryDependenceResults::getInvariantGroupPointerDependency(), getKnownAlignForUse(), llvm::X86TTIImpl::getMemoryOpCost(), getOffsetFromIndex(), llvm::ConstantExpr::getOffsetOf(), getSalvageOpsForGEP(), llvm::ConstantExpr::getSizeOf(), llvm::ScalarEvolution::getSizeOfScalableVectorExpr(), llvm::getUnderlyingObject(), getUniformBase(), llvm::AMDGPUTTIImpl::getUnrollingPreferences(), llvm::TargetTransformInfoImplCRTPBase< AMDGPUTTIImpl >::getUserCost(), hasOnlyOneNonZeroIndex(), INITIALIZE_PASS(), insertSpills(), llvm::IRSimilarity::isClose(), llvm::IsConstantOffsetFromGlobal(), isDereferenceableAndAlignedPointer(), llvm::CaptureTracker::isDereferenceableOrNull(), isFreeInLoop(), llvm::isGEPBasedOnPointerToString(), isGEPFoldable(), isGEPKnownNonNull(), isInBoundsGep(), isKnownNonZero(), isKnownTypeIdMember(), isNoWrapAddRec(), isOnlyCopiedFromConstantMemory(), llvm::isPointerOffset(), IsPtrInBounds(), isSafeAndProfitableToSinkLoad(), IsSafeComputationToRemove(), isSafeToPromoteArgument(), LLVMGetNumIndices(), LLVMIsInBounds(), LLVMSetIsInBounds(), llvm::PatternMatch::VScaleVal_match::match(), llvm::InstModificationIRStrategy::mutate(), passingValueIsAlwaysUndefined(), llvm::salvageDebugInfoImpl(), shouldConvertToRelLookupTable(), shouldMergeGEPs(), llvm::InstCombinerImpl::SimplifyDemandedVectorElts(), simplifyWithOpReplaced(), splitGlobal(), SRAGlobal(), llvm::stripGetElementPtr(), tryPromoteAllocaToVector(), llvm::VPRecipeBuilder::tryToCreateWidenRecipe(), AAPointerInfoFloating::updateImpl(), llvm::ValueEnumerator::ValueEnumerator(), llvm::InstCombinerImpl::visitExtractElementInst(), llvm::InstCombinerImpl::visitExtractValueInst(), llvm::InstCombinerImpl::visitFCmpInst(), llvm::ObjectSizeOffsetVisitor::visitGEPOperator(), llvm::ObjectSizeOffsetEvaluator::visitGEPOperator(), llvm::InstCombinerImpl::visitGetElementPtrInst(), llvm::InstCombinerImpl::visitICmpInst(), llvm::InstCombinerImpl::visitPtrToInt(), llvm::InstCombinerImpl::visitStoreInst(), llvm::VPWidenGEPRecipe::VPWidenGEPRecipe(), llvm::InnerLoopVectorizer::widenGEP(), llvm::InnerLoopVectorizer::widenPHIInstruction(), and WriteOptimizationInfo().

◆ hcommgep

hcommgep

Definition at line 172 of file HexagonCommonGEP.cpp.

◆ OptEnableConst

cl::opt<bool> OptEnableConst("commgep-const", cl::init(true), cl::Hidden, cl::ZeroOrMore)
static

◆ OptEnableInv

cl::opt<bool> OptEnableInv("commgep-inv", cl::init(true), cl::Hidden, cl::ZeroOrMore)
static

◆ OptSpeculate

cl::opt<bool> OptSpeculate("commgep-speculate", cl::init(true), cl::Hidden, cl::ZeroOrMore)
static

Referenced by preheader().