|
LLVM 24.0.0git
|
#include "llvm/Analysis/MemorySSA.h"#include "AnalysisOptions.h"#include "llvm/ADT/DenseMap.h"#include "llvm/ADT/DenseMapInfo.h"#include "llvm/ADT/DenseSet.h"#include "llvm/ADT/DepthFirstIterator.h"#include "llvm/ADT/Hashing.h"#include "llvm/ADT/STLExtras.h"#include "llvm/ADT/SmallPtrSet.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/StringExtras.h"#include "llvm/ADT/iterator.h"#include "llvm/ADT/iterator_range.h"#include "llvm/Analysis/AliasAnalysis.h"#include "llvm/Analysis/CFGPrinter.h"#include "llvm/Analysis/IteratedDominanceFrontier.h"#include "llvm/Analysis/Loads.h"#include "llvm/Analysis/LoopInfo.h"#include "llvm/Analysis/MemoryLocation.h"#include "llvm/Config/llvm-config.h"#include "llvm/IR/AssemblyAnnotationWriter.h"#include "llvm/IR/BasicBlock.h"#include "llvm/IR/Dominators.h"#include "llvm/IR/Function.h"#include "llvm/IR/Instruction.h"#include "llvm/IR/Instructions.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/LLVMContext.h"#include "llvm/IR/Operator.h"#include "llvm/IR/PassManager.h"#include "llvm/IR/Use.h"#include "llvm/InitializePasses.h"#include "llvm/Pass.h"#include "llvm/Support/AtomicOrdering.h"#include "llvm/Support/Casting.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/Compiler.h"#include "llvm/Support/Debug.h"#include "llvm/Support/ErrorHandling.h"#include "llvm/Support/FormattedStream.h"#include "llvm/Support/GraphWriter.h"#include "llvm/Support/raw_ostream.h"#include <algorithm>#include <cassert>#include <iterator>#include <memory>#include <utility>Go to the source code of this file.
Classes | |
| struct | llvm::DenseMapInfo< MemoryLocOrCall > |
| class | llvm::MemorySSA::ClobberWalkerBase |
| class | llvm::MemorySSA::CachingWalker |
| A MemorySSAWalker that does AA walks to disambiguate accesses. More... | |
| class | llvm::MemorySSA::SkipSelfWalker |
| class | llvm::MemorySSA::OptimizeUses |
| This class is a batch walker of all MemoryUse's in the program, and points their defining access at the thing that actually clobbers them. More... | |
| class | DOTFuncMSSAInfo |
| struct | llvm::GraphTraits< DOTFuncMSSAInfo * > |
| struct | llvm::DOTGraphTraits< DOTFuncMSSAInfo * > |
Namespaces | |
| namespace | llvm |
| This is an optimization pass for GlobalISel generic memory operations. | |
Macros | |
| #define | DEBUG_TYPE "memoryssa" |
Functions | |
| INITIALIZE_PASS_BEGIN (MemorySSAWrapperPass, "memoryssa", "Memory SSA", false, true) INITIALIZE_PASS_END(MemorySSAWrapperPass | |
| static bool | areLoadsReorderable (const LoadInst *Use, const LoadInst *MayClobber) |
| This does one-way checks to see if Use could theoretically be hoisted above MayClobber. | |
| template<typename AliasAnalysisType> | |
| static bool | instructionClobbersQuery (const MemoryDef *MD, const MemoryLocation &UseLoc, const Instruction *UseInst, AliasAnalysisType &AA) |
| template<typename AliasAnalysisType> | |
| static bool | instructionClobbersQuery (MemoryDef *MD, const MemoryUseOrDef *MU, const MemoryLocOrCall &UseMLOC, AliasAnalysisType &AA) |
| template<typename AliasAnalysisType> | |
| static bool | isUseTriviallyOptimizableToLiveOnEntry (AliasAnalysisType &AA, const Instruction *I) |
| static void | checkClobberSanity (MemoryAccess *Start, MemoryAccess *ClobberAt, const MemoryLocation &StartLoc, const MemorySSA &MSSA, const UpwardsMemoryQuery &Query, BatchAAResults &AA, bool AllowImpreciseClobber=false) |
| Verifies that Start is clobbered by ClobberAt, and that nothing inbetween Start and ClobberAt can clobbers Start. | |
| static bool | isOrdered (const Instruction *I) |
| static const Instruction * | getInvariantGroupClobberingInstruction (Instruction &I, DominatorTree &DT) |
Variables | |
| memoryssa | |
| Memory | SSA |
| Memory | false |
| static cl::opt< bool, true > | VerifyMemorySSAX ("verify-memoryssa", cl::location(VerifyMemorySSA), cl::Hidden, cl::desc("Enable verification of MemorySSA.")) |
| static const char | LiveOnEntryStr [] = "liveOnEntry" |
| #define DEBUG_TYPE "memoryssa" |
Definition at line 63 of file MemorySSA.cpp.
This does one-way checks to see if Use could theoretically be hoisted above MayClobber.
This will not check the other way around.
This assumes that, for the purposes of MemorySSA, Use comes directly after MayClobber, with no potentially clobbering operations in between them. (Where potentially clobbering ops are memory barriers, aliased stores, etc.)
Definition at line 240 of file MemorySSA.cpp.
References llvm::Acquire, llvm::LoadInst::getOrdering(), llvm::isAtLeastOrStrongerThan(), llvm::LoadInst::isVolatile(), and llvm::SequentiallyConsistent.
Referenced by instructionClobbersQuery().
|
static |
Verifies that Start is clobbered by ClobberAt, and that nothing inbetween Start and ClobberAt can clobbers Start.
This is meant to be as simple and self-contained as possible. Because it uses no cache, etc., it can be relatively expensive.
| Start | The MemoryAccess that we want to walk from. |
| ClobberAt | A clobber for Start. |
| StartLoc | The MemoryLocation for Start. |
| MSSA | The MemorySSA instance that Start and ClobberAt belong to. |
| Query | The UpwardsMemoryQuery we used for our search. |
| AA | The AliasAnalysis we used for our search. |
| AllowImpreciseClobber | Always false, unless we do relaxed verify. |
Definition at line 377 of file MemorySSA.cpp.
References _, assert(), llvm::def_chain(), llvm::MemorySSA::dominates(), llvm::dyn_cast(), llvm::SmallVectorImpl< T >::emplace_back(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::MemorySSA::getDomTree(), llvm::detail::DenseSetImpl< ValueT, MapTy >::insert(), instructionClobbersQuery(), llvm::isa(), llvm::MemorySSA::isLiveOnEntryDef(), llvm::DominatorTree::isReachableFromEntry(), MAP, llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::upward_defs_begin(), and llvm::upward_defs_end().
|
static |
Definition at line 2476 of file MemorySSA.cpp.
References llvm::DominatorTree::dominates(), llvm::dyn_cast(), llvm::getLoadStorePointerOperand(), I, llvm::isa(), llvm::Value::stripPointerCasts(), and llvm::Value::users().
| INITIALIZE_PASS_BEGIN | ( | MemorySSAWrapperPass | , |
| "memoryssa" | , | ||
| "Memory SSA" | , | ||
| false | , | ||
| true | ) |
References INITIALIZE_PASS_DEPENDENCY.
|
static |
Definition at line 266 of file MemorySSA.cpp.
References areLoadsReorderable(), assert(), llvm::dyn_cast(), llvm::dyn_cast_or_null(), llvm::MemoryUseOrDef::getMemoryInst(), I, II, and llvm::isModSet().
Referenced by checkClobberSanity(), llvm::MemorySSAUtil::defClobbersUseOrDef(), and instructionClobbersQuery().
|
static |
Definition at line 307 of file MemorySSA.cpp.
References llvm::MemoryUseOrDef::getMemoryInst(), and instructionClobbersQuery().
|
inlinestatic |
Definition at line 1728 of file MemorySSA.cpp.
References llvm::dyn_cast(), and I.
Referenced by llvm::VPReductionEVLRecipe::execute(), llvm::VPReductionRecipe::execute(), and llvm::MemoryDependenceResults::getNonLocalPointerDependency().
|
static |
Definition at line 351 of file MemorySSA.cpp.
References llvm::dyn_cast(), llvm::MemoryLocation::get(), I, and llvm::isModSet().
| Memory false |
Definition at line 69 of file MemorySSA.cpp.
Definition at line 83 of file MemorySSA.cpp.
Referenced by llvm::MemoryDef::print(), llvm::MemoryPhi::print(), and llvm::MemoryUse::print().
| memoryssa |
Definition at line 69 of file MemorySSA.cpp.
| Memory SSA |
Definition at line 69 of file MemorySSA.cpp.
Referenced by llvm::promoteLoopAccessesToScalars(), and RewriteUsesOfClonedInstructions().