LLVM API Documentation

AddrModeMatcher.cpp File Reference

#include "llvm/Transforms/Utils/AddrModeMatcher.h"
#include "llvm/DerivedTypes.h"
#include "llvm/GlobalValue.h"
#include "llvm/Instruction.h"
#include "llvm/Assembly/Writer.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Support/GetElementPtrTypeIterator.h"
#include "llvm/Support/PatternMatch.h"
#include "llvm/Support/raw_ostream.h"

Include dependency graph for AddrModeMatcher.cpp:

Go to the source code of this file.

Functions

static bool MightBeFoldableInst (Instruction *I)
static bool IsOperandAMemoryOperand (CallInst *CI, InlineAsm *IA, Value *OpVal, const TargetLowering &TLI)
static bool FindAllMemoryUses (Instruction *I, SmallVectorImpl< std::pair< Instruction *, unsigned > > &MemoryUses, SmallPtrSet< Instruction *, 16 > &ConsideredInsts, const TargetLowering &TLI)


Function Documentation

static bool FindAllMemoryUses ( Instruction *  I,
SmallVectorImpl< std::pair< Instruction *, unsigned > > &  MemoryUses,
SmallPtrSet< Instruction *, 16 > &  ConsideredInsts,
const TargetLowering &  TLI 
) [static]

FindAllMemoryUses - Recursively walk all the uses of I until we find a memory use. If we find an obviously non-foldable instruction, return true. Add the ultimately found memory instructions to MemoryUses.

Definition at line 421 of file AddrModeMatcher.cpp.

References llvm::dyn_cast(), E, llvm::SmallPtrSet< PtrType, SmallSize >::insert(), IsOperandAMemoryOperand(), LI, MightBeFoldableInst(), llvm::Value::use_begin(), and llvm::Value::use_end().

static bool IsOperandAMemoryOperand ( CallInst *  CI,
InlineAsm *  IA,
Value *  OpVal,
const TargetLowering &  TLI 
) [static]

static bool MightBeFoldableInst ( Instruction *  I  )  [static]

MightBeFoldableInst - This is a little filter, which returns true if an addressing computation involving I might be folded into a load/store accessing it. This doesn't need to be perfect, but needs to accept at least the set of instructions that MatchOperationAddr can.

Definition at line 121 of file AddrModeMatcher.cpp.

References BitCast, llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::Value::getType(), and PtrToInt.

Referenced by FindAllMemoryUses().