LLVM  14.0.0git
MemoryBuiltins.h
Go to the documentation of this file.
1 //==- llvm/Analysis/MemoryBuiltins.h - Calls to memory builtins --*- C++ -*-==//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This family of functions identifies calls to builtin functions that allocate
10 // or free memory.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_ANALYSIS_MEMORYBUILTINS_H
15 #define LLVM_ANALYSIS_MEMORYBUILTINS_H
16 
17 #include "llvm/ADT/APInt.h"
18 #include "llvm/ADT/DenseMap.h"
19 #include "llvm/ADT/SmallPtrSet.h"
22 #include "llvm/IR/IRBuilder.h"
23 #include "llvm/IR/InstVisitor.h"
24 #include "llvm/IR/ValueHandle.h"
25 #include <cstdint>
26 #include <utility>
27 
28 namespace llvm {
29 
30 class AllocaInst;
31 class Argument;
32 class CallInst;
33 class ConstantPointerNull;
34 class DataLayout;
35 class ExtractElementInst;
36 class ExtractValueInst;
37 class GEPOperator;
38 class GlobalAlias;
39 class GlobalVariable;
40 class Instruction;
41 class IntegerType;
42 class IntrinsicInst;
43 class IntToPtrInst;
44 class LLVMContext;
45 class LoadInst;
46 class PHINode;
47 class SelectInst;
48 class Type;
49 class UndefValue;
50 class Value;
51 
52 /// Tests if a value is a call or invoke to a library function that
53 /// allocates or reallocates memory (either malloc, calloc, realloc, or strdup
54 /// like).
55 bool isAllocationFn(const Value *V, const TargetLibraryInfo *TLI);
56 bool isAllocationFn(const Value *V,
57  function_ref<const TargetLibraryInfo &(Function &)> GetTLI);
58 
59 /// Tests if a value is a call or invoke to a library function that
60 /// allocates memory similar to malloc or calloc.
61 bool isMallocOrCallocLikeFn(const Value *V, const TargetLibraryInfo *TLI);
62 
63 /// Tests if a value is a call or invoke to a library function that
64 /// allocates memory (either malloc, calloc, or strdup like).
65 bool isAllocLikeFn(const Value *V, const TargetLibraryInfo *TLI);
66 
67 /// Tests if a value is a call or invoke to a library function that
68 /// reallocates memory (e.g., realloc).
69 bool isReallocLikeFn(const Value *V, const TargetLibraryInfo *TLI);
70 
71 /// Tests if a function is a call or invoke to a library function that
72 /// reallocates memory (e.g., realloc).
73 bool isReallocLikeFn(const Function *F, const TargetLibraryInfo *TLI);
74 
75 //===----------------------------------------------------------------------===//
76 // free Call Utility Functions.
77 //
78 
79 /// isLibFreeFunction - Returns true if the function is a builtin free()
80 bool isLibFreeFunction(const Function *F, const LibFunc TLIFn);
81 
82 /// isFreeCall - Returns non-null if the value is a call to the builtin free()
83 const CallInst *isFreeCall(const Value *I, const TargetLibraryInfo *TLI);
84 
85 inline CallInst *isFreeCall(Value *I, const TargetLibraryInfo *TLI) {
86  return const_cast<CallInst*>(isFreeCall((const Value*)I, TLI));
87 }
88 
89 //===----------------------------------------------------------------------===//
90 // Properties of allocation functions
91 //
92 
93 /// Return false if the allocation can have side effects on the program state
94 /// we are required to preserve beyond the effect of allocating a new object.
95 /// Ex: If our allocation routine has a counter for the number of objects
96 /// allocated, and the program prints it on exit, can the value change due
97 /// to optimization? Answer is highly language dependent.
98 /// Note: *Removable* really does mean removable; it does not mean observable.
99 /// A language (e.g. C++) can allow removing allocations without allowing
100 /// insertion or speculative execution of allocation routines.
101 bool isAllocRemovable(const CallBase *V, const TargetLibraryInfo *TLI);
102 
103 /// Gets the alignment argument for an aligned_alloc-like function
104 Value *getAllocAlignment(const CallBase *V, const TargetLibraryInfo *TLI);
105 
106 /// Return the size of the requested allocation. With a trivial mapper, this is
107 /// identical to calling getObjectSize(..., Exact). A mapper function can be
108 /// used to replace one Value* (operand to the allocation) with another. This
109 /// is useful when doing abstract interpretation.
110 Optional<APInt> getAllocSize(const CallBase *CB,
111  const TargetLibraryInfo *TLI,
112  std::function<const Value*(const Value*)> Mapper);
113 
114 /// If this allocation function initializes memory to a fixed value, return
115 /// said value in the requested type. Otherwise, return nullptr.
116 Constant *getInitialValueOfAllocation(const CallBase *Alloc,
117  const TargetLibraryInfo *TLI,
118  Type *Ty);
119 
120 //===----------------------------------------------------------------------===//
121 // Utility functions to compute size of objects.
122 //
123 
124 /// Various options to control the behavior of getObjectSize.
126  /// Controls how we handle conditional statements with unknown conditions.
127  enum class Mode : uint8_t {
128  /// Fail to evaluate an unknown condition.
129  Exact,
130  /// Evaluate all branches of an unknown condition. If all evaluations
131  /// succeed, pick the minimum size.
132  Min,
133  /// Same as Min, except we pick the maximum size of all of the branches.
134  Max
135  };
136 
137  /// How we want to evaluate this object's size.
139  /// Whether to round the result up to the alignment of allocas, byval
140  /// arguments, and global variables.
141  bool RoundToAlign = false;
142  /// If this is true, null pointers in address space 0 will be treated as
143  /// though they can't be evaluated. Otherwise, null is always considered to
144  /// point to a 0 byte region of memory.
145  bool NullIsUnknownSize = false;
146 };
147 
148 /// Compute the size of the object pointed by Ptr. Returns true and the
149 /// object size in Size if successful, and false otherwise. In this context, by
150 /// object we mean the region of memory starting at Ptr to the end of the
151 /// underlying object pointed to by Ptr.
152 ///
153 /// WARNING: The object size returned is the allocation size. This does not
154 /// imply dereferenceability at site of use since the object may be freeed in
155 /// between.
156 bool getObjectSize(const Value *Ptr, uint64_t &Size, const DataLayout &DL,
157  const TargetLibraryInfo *TLI, ObjectSizeOpts Opts = {});
158 
159 /// Try to turn a call to \@llvm.objectsize into an integer value of the given
160 /// Type. Returns null on failure. If MustSucceed is true, this function will
161 /// not return null, and may return conservative values governed by the second
162 /// argument of the call to objectsize.
163 Value *lowerObjectSizeCall(IntrinsicInst *ObjectSize, const DataLayout &DL,
164  const TargetLibraryInfo *TLI, bool MustSucceed);
165 
166 
167 
168 using SizeOffsetType = std::pair<APInt, APInt>;
169 
170 /// Evaluate the size and offset of an object pointed to by a Value*
171 /// statically. Fails if size or offset are not known at compile time.
173  : public InstVisitor<ObjectSizeOffsetVisitor, SizeOffsetType> {
174  const DataLayout &DL;
175  const TargetLibraryInfo *TLI;
176  ObjectSizeOpts Options;
177  unsigned IntTyBits;
178  APInt Zero;
180 
181  APInt align(APInt Size, MaybeAlign Align);
182 
183  SizeOffsetType unknown() {
184  return std::make_pair(APInt(), APInt());
185  }
186 
187 public:
190 
192 
193  static bool knownSize(const SizeOffsetType &SizeOffset) {
194  return SizeOffset.first.getBitWidth() > 1;
195  }
196 
197  static bool knownOffset(const SizeOffsetType &SizeOffset) {
198  return SizeOffset.second.getBitWidth() > 1;
199  }
200 
201  static bool bothKnown(const SizeOffsetType &SizeOffset) {
202  return knownSize(SizeOffset) && knownOffset(SizeOffset);
203  }
204 
205  // These are "private", except they can't actually be made private. Only
206  // compute() should be used by external users.
222 
223 private:
224  bool CheckedZextOrTrunc(APInt &I);
225 };
226 
227 using SizeOffsetEvalType = std::pair<Value *, Value *>;
228 
229 /// Evaluate the size and offset of an object pointed to by a Value*.
230 /// May create code to compute the result at run-time.
232  : public InstVisitor<ObjectSizeOffsetEvaluator, SizeOffsetEvalType> {
234  using WeakEvalType = std::pair<WeakTrackingVH, WeakTrackingVH>;
237 
238  const DataLayout &DL;
239  const TargetLibraryInfo *TLI;
240  LLVMContext &Context;
241  BuilderTy Builder;
242  IntegerType *IntTy;
243  Value *Zero;
244  CacheMapTy CacheMap;
245  PtrSetTy SeenVals;
246  ObjectSizeOpts EvalOpts;
247  SmallPtrSet<Instruction *, 8> InsertedInstructions;
248 
249  SizeOffsetEvalType compute_(Value *V);
250 
251 public:
253  return std::make_pair(nullptr, nullptr);
254  }
255 
257  LLVMContext &Context, ObjectSizeOpts EvalOpts = {});
258 
260 
261  bool knownSize(SizeOffsetEvalType SizeOffset) {
262  return SizeOffset.first;
263  }
264 
265  bool knownOffset(SizeOffsetEvalType SizeOffset) {
266  return SizeOffset.second;
267  }
268 
269  bool anyKnown(SizeOffsetEvalType SizeOffset) {
270  return knownSize(SizeOffset) || knownOffset(SizeOffset);
271  }
272 
273  bool bothKnown(SizeOffsetEvalType SizeOffset) {
274  return knownSize(SizeOffset) && knownOffset(SizeOffset);
275  }
276 
277  // The individual instruction visitors should be treated as private.
288 };
289 
290 } // end namespace llvm
291 
292 #endif // LLVM_ANALYSIS_MEMORYBUILTINS_H
llvm::Check::Size
@ Size
Definition: FileCheck.h:73
llvm::ObjectSizeOffsetEvaluator::unknown
static SizeOffsetEvalType unknown()
Definition: MemoryBuiltins.h:252
llvm::SizeOffsetType
std::pair< APInt, APInt > SizeOffsetType
Definition: MemoryBuiltins.h:168
llvm::Argument
This class represents an incoming formal argument to a Function.
Definition: Argument.h:29
llvm::ObjectSizeOffsetVisitor::visitGlobalAlias
SizeOffsetType visitGlobalAlias(GlobalAlias &GA)
Definition: MemoryBuiltins.cpp:694
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:22
llvm::DataLayout
A parsed version of the target data layout string in and methods for querying it.
Definition: DataLayout.h:113
llvm::ExtractElementInst
This instruction extracts a single (scalar) element from a VectorType value.
Definition: Instructions.h:1876
TargetFolder.h
llvm::ObjectSizeOffsetEvaluator::compute
SizeOffsetEvalType compute(Value *V)
Definition: MemoryBuiltins.cpp:773
llvm::ObjectSizeOffsetVisitor::visitExtractValueInst
SizeOffsetType visitExtractValueInst(ExtractValueInst &I)
Definition: MemoryBuiltins.cpp:680
llvm::IRBuilder< TargetFolder, IRBuilderCallbackInserter >
llvm::GlobalVariable
Definition: GlobalVariable.h:39
llvm::ObjectSizeOffsetEvaluator::visitSelectInst
SizeOffsetEvalType visitSelectInst(SelectInst &I)
Definition: MemoryBuiltins.cpp:968
llvm::ObjectSizeOffsetEvaluator::visitGEPOperator
SizeOffsetEvalType visitGEPOperator(GEPOperator &GEP)
Definition: MemoryBuiltins.cpp:907
llvm::GlobalAlias
Definition: GlobalAlias.h:28
llvm::getInitialValueOfAllocation
Constant * getInitialValueOfAllocation(const CallBase *Alloc, const TargetLibraryInfo *TLI, Type *Ty)
If this allocation function initializes memory to a fixed value, return said value in the requested t...
Definition: MemoryBuiltins.cpp:382
APInt.h
DenseMap.h
llvm::ObjectSizeOpts::NullIsUnknownSize
bool NullIsUnknownSize
If this is true, null pointers in address space 0 will be treated as though they can't be evaluated.
Definition: MemoryBuiltins.h:145
llvm::ObjectSizeOffsetEvaluator::visitCallBase
SizeOffsetEvalType visitCallBase(CallBase &CB)
Definition: MemoryBuiltins.cpp:874
llvm::SmallPtrSet
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
Definition: SmallPtrSet.h:449
llvm::ObjectSizeOpts::RoundToAlign
bool RoundToAlign
Whether to round the result up to the alignment of allocas, byval arguments, and global variables.
Definition: MemoryBuiltins.h:141
llvm::ObjectSizeOffsetEvaluator::visitLoadInst
SizeOffsetEvalType visitLoadInst(LoadInst &I)
Definition: MemoryBuiltins.cpp:922
F
#define F(x, y, z)
Definition: MD5.cpp:55
Context
ManagedStatic< detail::RecordContext > Context
Definition: Record.cpp:96
llvm::ObjectSizeOffsetEvaluator::visitIntToPtrInst
SizeOffsetEvalType visitIntToPtrInst(IntToPtrInst &)
Definition: MemoryBuiltins.cpp:917
llvm::isAllocationFn
bool isAllocationFn(const Value *V, const TargetLibraryInfo *TLI)
Tests if a value is a call or invoke to a library function that allocates or reallocates memory (eith...
Definition: MemoryBuiltins.cpp:229
llvm::ConstantPointerNull
A constant pointer value that points to null.
Definition: Constants.h:534
llvm::ObjectSizeOffsetVisitor::bothKnown
static bool bothKnown(const SizeOffsetType &SizeOffset)
Definition: MemoryBuiltins.h:201
llvm::ISD::Constant
@ Constant
Definition: ISDOpcodes.h:76
llvm::ObjectSizeOffsetEvaluator::knownSize
bool knownSize(SizeOffsetEvalType SizeOffset)
Definition: MemoryBuiltins.h:261
llvm::LibFunc
LibFunc
Definition: TargetLibraryInfo.h:34
llvm::ObjectSizeOffsetVisitor::visitIntToPtrInst
SizeOffsetType visitIntToPtrInst(IntToPtrInst &)
Definition: MemoryBuiltins.cpp:708
llvm::ObjectSizeOffsetEvaluator::ObjectSizeOffsetEvaluator
ObjectSizeOffsetEvaluator(const DataLayout &DL, const TargetLibraryInfo *TLI, LLVMContext &Context, ObjectSizeOpts EvalOpts={})
Definition: MemoryBuiltins.cpp:761
llvm::ObjectSizeOpts::Mode::Exact
@ Exact
Fail to evaluate an unknown condition.
TargetLibraryInfo.h
llvm::MaybeAlign
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.
Definition: Alignment.h:109
llvm::IntegerType
Class to represent integer types.
Definition: DerivedTypes.h:40
llvm::ObjectSizeOffsetVisitor::visitGlobalVariable
SizeOffsetType visitGlobalVariable(GlobalVariable &GV)
Definition: MemoryBuiltins.cpp:700
llvm::Instruction
Definition: Instruction.h:45
llvm::ObjectSizeOffsetVisitor::visitAllocaInst
SizeOffsetType visitAllocaInst(AllocaInst &I)
Definition: MemoryBuiltins.cpp:616
llvm::ObjectSizeOffsetEvaluator::visitExtractElementInst
SizeOffsetEvalType visitExtractElementInst(ExtractElementInst &I)
Definition: MemoryBuiltins.cpp:897
Options
const char LLVMTargetMachineRef LLVMPassBuilderOptionsRef Options
Definition: PassBuilderBindings.cpp:48
llvm::ObjectSizeOffsetEvaluator
Evaluate the size and offset of an object pointed to by a Value*.
Definition: MemoryBuiltins.h:231
SmallPtrSet.h
llvm::ObjectSizeOffsetEvaluator::visitPHINode
SizeOffsetEvalType visitPHINode(PHINode &PHI)
Definition: MemoryBuiltins.cpp:926
llvm::Align
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:39
llvm::getObjectSize
bool getObjectSize(const Value *Ptr, uint64_t &Size, const DataLayout &DL, const TargetLibraryInfo *TLI, ObjectSizeOpts Opts={})
Compute the size of the object pointed by Ptr.
Definition: MemoryBuiltins.cpp:479
uint64_t
llvm::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:68
llvm::DenseMap< const Value *, WeakEvalType >
llvm::ObjectSizeOffsetVisitor::visitUndefValue
SizeOffsetType visitUndefValue(UndefValue &)
Definition: MemoryBuiltins.cpp:751
I
#define I(x, y, z)
Definition: MD5.cpp:58
llvm::UndefValue
'undef' values are things that do not have specified contents.
Definition: Constants.h:1377
llvm::ObjectSizeOffsetVisitor
Evaluate the size and offset of an object pointed to by a Value* statically.
Definition: MemoryBuiltins.h:172
llvm::lowerObjectSizeCall
Value * lowerObjectSizeCall(IntrinsicInst *ObjectSize, const DataLayout &DL, const TargetLibraryInfo *TLI, bool MustSucceed)
Try to turn a call to @llvm.objectsize into an integer value of the given Type.
Definition: MemoryBuiltins.cpp:490
llvm::ObjectSizeOffsetVisitor::visitSelectInst
SizeOffsetType visitSelectInst(SelectInst &I)
Definition: MemoryBuiltins.cpp:723
llvm::isAllocLikeFn
bool isAllocLikeFn(const Value *V, const TargetLibraryInfo *TLI)
Tests if a value is a call or invoke to a library function that allocates memory (either malloc,...
Definition: MemoryBuiltins.cpp:264
TemplateParamKind::Type
@ Type
IRBuilder.h
llvm::ObjectSizeOpts::Mode::Min
@ Min
Evaluate all branches of an unknown condition.
llvm::SelectInst
This class represents the LLVM 'select' instruction.
Definition: Instructions.h:1741
function
print Print MemDeps of function
Definition: MemDepPrinter.cpp:83
llvm::GEPOperator
Definition: Operator.h:473
llvm::APInt
Class for arbitrary precision integers.
Definition: APInt.h:75
llvm::ObjectSizeOffsetEvaluator::visitAllocaInst
SizeOffsetEvalType visitAllocaInst(AllocaInst &I)
Definition: MemoryBuiltins.cpp:854
InstVisitor.h
llvm::ObjectSizeOffsetVisitor::visitGEPOperator
SizeOffsetType visitGEPOperator(GEPOperator &GEP)
Definition: MemoryBuiltins.cpp:685
DL
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Definition: AArch64SLSHardening.cpp:76
llvm::InstVisitor
Base class for instruction visitors.
Definition: InstVisitor.h:79
llvm::ObjectSizeOpts
Various options to control the behavior of getObjectSize.
Definition: MemoryBuiltins.h:125
llvm::LoadInst
An instruction for reading from memory.
Definition: Instructions.h:180
ValueHandle.h
llvm::ObjectSizeOpts::Mode::Max
@ Max
Same as Min, except we pick the maximum size of all of the branches.
llvm::ObjectSizeOffsetVisitor::visitLoadInst
SizeOffsetType visitLoadInst(LoadInst &I)
Definition: MemoryBuiltins.cpp:713
llvm::ObjectSizeOffsetEvaluator::knownOffset
bool knownOffset(SizeOffsetEvalType SizeOffset)
Definition: MemoryBuiltins.h:265
llvm::ObjectSizeOffsetVisitor::visitInstruction
SizeOffsetType visitInstruction(Instruction &I)
Definition: MemoryBuiltins.cpp:755
llvm::ObjectSizeOffsetVisitor::visitCallBase
SizeOffsetType visitCallBase(CallBase &CB)
Definition: MemoryBuiltins.cpp:653
llvm::ObjectSizeOffsetVisitor::visitArgument
SizeOffsetType visitArgument(Argument &A)
Definition: MemoryBuiltins.cpp:641
llvm::ObjectSizeOpts::Mode
Mode
Controls how we handle conditional statements with unknown conditions.
Definition: MemoryBuiltins.h:127
llvm::ObjectSizeOpts::EvalMode
Mode EvalMode
How we want to evaluate this object's size.
Definition: MemoryBuiltins.h:138
llvm::ExtractValueInst
This instruction extracts a struct member or array element value from an aggregate value.
Definition: Instructions.h:2404
llvm::getAllocAlignment
Value * getAllocAlignment(const CallBase *V, const TargetLibraryInfo *TLI)
Gets the alignment argument for an aligned_alloc-like function.
Definition: MemoryBuiltins.cpp:292
llvm::SizeOffsetEvalType
std::pair< Value *, Value * > SizeOffsetEvalType
Definition: MemoryBuiltins.h:227
llvm::ObjectSizeOffsetVisitor::knownOffset
static bool knownOffset(const SizeOffsetType &SizeOffset)
Definition: MemoryBuiltins.h:197
llvm::TargetStackID::Value
Value
Definition: TargetFrameLowering.h:27
llvm::TargetLibraryInfo
Provides information about what library functions are available for the current target.
Definition: TargetLibraryInfo.h:221
llvm::IntToPtrInst
This class represents a cast from an integer to a pointer.
Definition: Instructions.h:5124
llvm::ObjectSizeOffsetVisitor::compute
SizeOffsetType compute(Value *V)
Definition: MemoryBuiltins.cpp:575
llvm::ObjectSizeOffsetVisitor::visitConstantPointerNull
SizeOffsetType visitConstantPointerNull(ConstantPointerNull &)
Definition: MemoryBuiltins.cpp:661
llvm::getAllocSize
Optional< APInt > getAllocSize(const CallBase *CB, const TargetLibraryInfo *TLI, std::function< const Value *(const Value *)> Mapper)
Return the size of the requested allocation.
Definition: MemoryBuiltins.cpp:320
llvm::ObjectSizeOffsetEvaluator::visitExtractValueInst
SizeOffsetEvalType visitExtractValueInst(ExtractValueInst &I)
Definition: MemoryBuiltins.cpp:902
llvm::isReallocLikeFn
bool isReallocLikeFn(const Value *V, const TargetLibraryInfo *TLI)
Tests if a value is a call or invoke to a library function that reallocates memory (e....
Definition: MemoryBuiltins.cpp:270
llvm::ObjectSizeOffsetEvaluator::visitInstruction
SizeOffsetEvalType visitInstruction(Instruction &I)
Definition: MemoryBuiltins.cpp:984
llvm::ObjectSizeOffsetVisitor::knownSize
static bool knownSize(const SizeOffsetType &SizeOffset)
Definition: MemoryBuiltins.h:193
llvm::PHINode
Definition: Instructions.h:2657
llvm::ObjectSizeOffsetEvaluator::bothKnown
bool bothKnown(SizeOffsetEvalType SizeOffset)
Definition: MemoryBuiltins.h:273
llvm::CallBase
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
Definition: InstrTypes.h:1176
llvm::CallInst
This class represents a function call, abstracting a target machine's calling convention.
Definition: Instructions.h:1478
llvm::ObjectSizeOffsetVisitor::ObjectSizeOffsetVisitor
ObjectSizeOffsetVisitor(const DataLayout &DL, const TargetLibraryInfo *TLI, LLVMContext &Context, ObjectSizeOpts Options={})
Definition: MemoryBuiltins.cpp:566
GEP
Hexagon Common GEP
Definition: HexagonCommonGEP.cpp:172
llvm::isAllocRemovable
bool isAllocRemovable(const CallBase *V, const TargetLibraryInfo *TLI)
Return false if the allocation can have side effects on the program state we are required to preserve...
Definition: MemoryBuiltins.cpp:280
llvm::AllocaInst
an instruction to allocate memory on the stack
Definition: Instructions.h:62
llvm::isLibFreeFunction
bool isLibFreeFunction(const Function *F, const LibFunc TLIFn)
isLibFreeFunction - Returns true if the function is a builtin free()
Definition: MemoryBuiltins.cpp:399
llvm::ObjectSizeOffsetVisitor::visitExtractElementInst
SizeOffsetType visitExtractElementInst(ExtractElementInst &I)
Definition: MemoryBuiltins.cpp:675
llvm::Value
LLVM Value Representation.
Definition: Value.h:74
llvm::ObjectSizeOffsetEvaluator::anyKnown
bool anyKnown(SizeOffsetEvalType SizeOffset)
Definition: MemoryBuiltins.h:269
llvm::isMallocOrCallocLikeFn
bool isMallocOrCallocLikeFn(const Value *V, const TargetLibraryInfo *TLI)
Tests if a value is a call or invoke to a library function that allocates memory similar to malloc or...
Definition: MemoryBuiltins.cpp:258
llvm::isFreeCall
const CallInst * isFreeCall(const Value *I, const TargetLibraryInfo *TLI)
isFreeCall - Returns non-null if the value is a call to the builtin free()
Definition: MemoryBuiltins.cpp:452
llvm::ObjectSizeOffsetVisitor::visitPHINode
SizeOffsetType visitPHINode(PHINode &)
Definition: MemoryBuiltins.cpp:718