LLVM: lib/Analysis/MemDerefPrinter.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
15
16using namespace llvm;
17
20 OS << "Memory Dereferencibility of pointers in function '" << F.getName()
21 << "'\n";
22
25
29 Value *PO = LI->getPointerOperand();
33 DL, LI))
34 DerefAndAligned.insert(PO);
35 }
36 }
37
38 OS << "The following are dereferenceable:\n";
39 for (Value *V : Deref) {
40 OS << " ";
41 V->print(OS);
42 if (DerefAndAligned.count(V))
43 OS << "\t(aligned)";
44 else
45 OS << "\t(unaligned)";
46 OS << "\n";
47 }
49}
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Expand Atomic instructions
A parsed version of the target data layout string in and methods for querying it.
An instruction for reading from memory.
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Definition MemDerefPrinter.cpp:18
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
size_type count(ConstPtrType Ptr) const
count - Return 1 if the specified pointer is in the set, 0 otherwise.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
LLVM Value Representation.
Type * getType() const
All values are typed, get the type of this value.
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) dyn_cast(const From &Val)
dyn_cast - Return the argument parameter cast to the specified type.
LLVM_ABI bool isDereferenceableAndAlignedPointer(const Value *V, Type *Ty, Align Alignment, const DataLayout &DL, const Instruction *CtxI=nullptr, AssumptionCache *AC=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.
LLVM_ABI bool isDereferenceablePointer(const Value *V, Type *Ty, const DataLayout &DL, const Instruction *CtxI=nullptr, AssumptionCache *AC=nullptr, const DominatorTree *DT=nullptr, const TargetLibraryInfo *TLI=nullptr)
Return true if this is always a dereferenceable pointer.
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.