LLVM  6.0.0svn
Functions
Loads.cpp File Reference
#include "llvm/Analysis/Loads.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/GlobalAlias.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Operator.h"
#include "llvm/IR/Statepoint.h"
Include dependency graph for Loads.cpp:

Go to the source code of this file.

Functions

static bool isAligned (const Value *Base, const APInt &Offset, unsigned Align, const DataLayout &DL)
 
static bool isAligned (const Value *Base, unsigned Align, const DataLayout &DL)
 
static bool isDereferenceableAndAlignedPointer (const Value *V, unsigned Align, const APInt &Size, const DataLayout &DL, const Instruction *CtxI, const DominatorTree *DT, SmallPtrSetImpl< const Value *> &Visited)
 Test if V is always a pointer to allocated and suitably aligned memory for a simple load or store. More...
 
static bool AreEquivalentAddressValues (const Value *A, const Value *B)
 Test if A and B will obviously have the same value. More...
 

Function Documentation

◆ AreEquivalentAddressValues()

static bool AreEquivalentAddressValues ( const Value A,
const Value B 
)
static

Test if A and B will obviously have the same value.

This includes recognizing that t0 and t1 will have the same value in code like this:

%t0 = getelementptr \@a, 0, 3
store i32 0, i32* %t0
%t1 = getelementptr \@a, 0, 3
%t2 = load i32* %t1

Definition at line 170 of file Loads.cpp.

Referenced by llvm::FindAvailablePtrLoadStore(), and llvm::isSafeToLoadUnconditionally().

◆ isAligned() [1/2]

static bool isAligned ( const Value Base,
const APInt Offset,
unsigned  Align,
const DataLayout DL 
)
static

◆ isAligned() [2/2]

static bool isAligned ( const Value Base,
unsigned  Align,
const DataLayout DL 
)
static

◆ isDereferenceableAndAlignedPointer()

static bool isDereferenceableAndAlignedPointer ( const Value V,
unsigned  Align,
const APInt Size,
const DataLayout DL,
const Instruction CtxI,
const DominatorTree DT,
SmallPtrSetImpl< const Value *> &  Visited 
)
static