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();
60 DerefAndAligned.
insert(PO);
67 OS <<
"The following are dereferenceable:\n";
68 for (
Value *V: Deref) {
70 if (DerefAndAligned.
count(V))
73 OS <<
"\t(unaligned)";
A parsed version of the target data layout string in and methods for querying it. ...
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
This class represents lattice values for constants.
A Module instance is used to store all the information related to an LLVM module. ...
This class provides various memory handling functions that manipulate MemoryBlock instances...
void push_back(const T &Elt)
block Block Frequency true
An instruction for reading from memory.
print Memory Dereferenciblity of pointers in function
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
static bool runOnFunction(Function &F, bool PostInlining)
void initializeMemDerefPrinterPass(PassRegistry &)
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
size_type count(ConstPtrType Ptr) const
count - Return 1 if the specified pointer is in the set, 0 otherwise.
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE, "Assign register bank of generic virtual registers", false, false) RegBankSelect
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Module.h This file contains the declarations for the Module class.
void setPreservesAll()
Set by analyses that do not transform their input at all.
INITIALIZE_PASS_BEGIN(MemDerefPrinter, "print-memderefs", "Memory Dereferenciblity of pointers in function", false, true) INITIALIZE_PASS_END(MemDerefPrinter
bool isDereferenceablePointer(const Value *V, const DataLayout &DL, const Instruction *CtxI=nullptr, const DominatorTree *DT=nullptr)
Return true if this is always a dereferenceable pointer.
Module * getParent()
Get the module that this global value is contained inside of...
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream...
inst_range instructions(Function *F)
bool isDereferenceableAndAlignedPointer(const Value *V, unsigned Align, const DataLayout &DL, const Instruction *CtxI=nullptr, const DominatorTree *DT=nullptr)
Returns true if V is always a dereferenceable pointer with alignment greater or equal than requested...
FunctionPass * createMemDerefPrinter()