Go to the documentation of this file.
35 void releaseMemory()
override {
37 DerefAndAligned.
clear();
44 "Memory Dereferenciblity of pointers in function",
false,
true)
49 return new MemDerefPrinter();
55 if (
LoadInst *LI = dyn_cast<LoadInst>(&
I)) {
56 Value *PO = LI->getPointerOperand();
61 DerefAndAligned.
insert(PO);
68 OS <<
"The following are dereferenceable:\n";
69 for (
Value *V: Deref) {
72 if (DerefAndAligned.
count(V))
75 OS <<
"\t(unaligned)";
82 OS <<
"Memory Dereferencibility of pointers in function '" <<
F.getName()
90 if (
LoadInst *LI = dyn_cast<LoadInst>(&
I)) {
91 Value *PO = LI->getPointerOperand();
96 DerefAndAligned.
insert(PO);
100 OS <<
"The following are dereferenceable:\n";
101 for (
Value *V : Deref) {
104 if (DerefAndAligned.
count(V))
107 OS <<
"\t(unaligned)";
A set of analyses that are preserved following a run of a transformation pass.
This is an optimization pass for GlobalISel generic memory operations.
A parsed version of the target data layout string in and methods for querying it.
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
Represent the analysis usage information of a pass.
void initializeMemDerefPrinterPass(PassRegistry &)
The object format emitted by the WebAssembly backed is documented in
bool isDereferenceablePointer(const Value *V, Type *Ty, const DataLayout &DL, const Instruction *CtxI=nullptr, const DominatorTree *DT=nullptr, const TargetLibraryInfo *TLI=nullptr)
Return true if this is always a dereferenceable pointer.
This class implements an extremely fast bulk output stream that can only output to a stream.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
inst_range instructions(Function *F)
A Module instance is used to store all the information related to an LLVM module.
size_type count(ConstPtrType Ptr) const
count - Return 1 if the specified pointer is in the set, 0 otherwise.
INITIALIZE_PASS_BEGIN(MemDerefPrinter, "print-memderefs", "Memory Dereferenciblity of pointers in function", false, true) INITIALIZE_PASS_END(MemDerefPrinter
This class provides various memory handling functions that manipulate MemoryBlock instances.
Type * getType() const
All values are typed, get the type of this value.
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
An instruction for reading from memory.
FunctionPass * createMemDerefPrinter()
static bool runOnFunction(Function &F, bool PostInlining)
void setPreservesAll()
Set by analyses that do not transform their input at all.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
A container for analyses that lazily runs them and caches their results.
FunctionPass class - This class is used to implement most global optimizations.
print Memory Dereferenciblity of pointers in function
LLVM Value Representation.
Add support for conditional and other related patterns Instead of
bool isDereferenceableAndAlignedPointer(const Value *V, Type *Ty, Align Alignment, const DataLayout &DL, const Instruction *CtxI=nullptr, const DominatorTree *DT=nullptr, const TargetLibraryInfo *TLI=nullptr)
Returns true if V is always a dereferenceable pointer with alignment greater or equal than requested.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.