37 void releaseMemory()
override {
39 DerefAndAligned.clear();
46 "Memory Dereferenciblity of pointers in function",
false,
true)
51 return new MemDerefPrinter();
54 bool MemDerefPrinter::runOnFunction(
Function &
F) {
57 if (
LoadInst *LI = dyn_cast<LoadInst>(&
I)) {
58 Value *PO = LI->getPointerOperand();
62 DerefAndAligned.insert(PO);
69 OS <<
"The following are dereferenceable:\n";
70 for (
Value *V: Deref) {
72 if (DerefAndAligned.count(V))
75 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...
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...
print Memory Dereferenciblity of pointers in false
An instruction for reading from memory.
print Memory Dereferenciblity of pointers in function
INITIALIZE_PASS_BEGIN(MemDerefPrinter,"print-memderefs","Memory Dereferenciblity of pointers in function", false, true) INITIALIZE_PASS_END(MemDerefPrinter
void initializeMemDerefPrinterPass(PassRegistry &)
Represent the analysis usage information of a pass.
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE,"Assign register bank of generic virtual registers", false, false) RegBankSelect
FunctionPass class - This class is used to implement most global optimizations.
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.
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.
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
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()