LLVM
8.0.1
|
PHITransAddr - An address value which tracks and handles phi translation. More...
#include "llvm/Analysis/PHITransAddr.h"
Public Member Functions | |
PHITransAddr (Value *addr, const DataLayout &DL, AssumptionCache *AC) | |
Value * | getAddr () const |
bool | NeedsPHITranslationFromBlock (BasicBlock *BB) const |
NeedsPHITranslationFromBlock - Return true if moving from the specified BasicBlock to its predecessors requires PHI translation. More... | |
bool | IsPotentiallyPHITranslatable () const |
IsPotentiallyPHITranslatable - If this needs PHI translation, return true if we have some hope of doing it. More... | |
bool | PHITranslateValue (BasicBlock *CurBB, BasicBlock *PredBB, const DominatorTree *DT, bool MustDominate) |
PHITranslateValue - PHI translate the current address up the CFG from CurBB to Pred, updating our state to reflect any needed changes. More... | |
Value * | PHITranslateWithInsertion (BasicBlock *CurBB, BasicBlock *PredBB, const DominatorTree &DT, SmallVectorImpl< Instruction *> &NewInsts) |
PHITranslateWithInsertion - PHI translate this value into the specified predecessor block, inserting a computation of the value if it is unavailable. More... | |
void | dump () const |
bool | Verify () const |
Verify - Check internal consistency of this data structure. More... | |
PHITransAddr - An address value which tracks and handles phi translation.
As we walk "up" the CFG through predecessors, we need to ensure that the address we're tracking is kept up to date. For example, if we're analyzing an address of "&A[i]" and walk through the definition of 'i' which is a PHI node, we must phi translate i to get "&A[j]" or else we will analyze an incorrect pointer in the predecessor block.
This is designed to be a relatively small object that lives on the stack and is copyable.
Definition at line 36 of file PHITransAddr.h.
|
inline |
Definition at line 53 of file PHITransAddr.h.
References I, and llvm::SmallVectorTemplateBase< T >::push_back().
LLVM_DUMP_METHOD void PHITransAddr::dump | ( | ) | const |
Definition at line 46 of file PHITransAddr.cpp.
References llvm::dbgs().
Referenced by NeedsPHITranslationFromBlock().
|
inline |
Definition at line 60 of file PHITransAddr.h.
Referenced by PHITranslateWithInsertion(), and SortNonLocalDepInfoCache().
bool PHITransAddr::IsPotentiallyPHITranslatable | ( | ) | const |
IsPotentiallyPHITranslatable - If this needs PHI translation, return true if we have some hope of doing it.
This should be used as a filter to avoid calling PHITranslateValue in hopeless situations.
Definition at line 115 of file PHITransAddr.cpp.
References CanPHITrans(), and llvm::dyn_cast().
Referenced by NeedsPHITranslationFromBlock(), and SortNonLocalDepInfoCache().
|
inline |
NeedsPHITranslationFromBlock - Return true if moving from the specified BasicBlock to its predecessors requires PHI translation.
Definition at line 64 of file PHITransAddr.h.
References dump(), getParent(), IsPotentiallyPHITranslatable(), PHITranslateValue(), PHITranslateWithInsertion(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::SmallVectorBase::size(), Verify(), and VI.
Referenced by SortNonLocalDepInfoCache().
bool PHITransAddr::PHITranslateValue | ( | BasicBlock * | CurBB, |
BasicBlock * | PredBB, | ||
const DominatorTree * | DT, | ||
bool | MustDominate | ||
) |
PHITranslateValue - PHI translate the current address up the CFG from CurBB to Pred, updating our state to reflect any needed changes.
If 'MustDominate' is true, the translated value must dominate PredBB. This returns true on failure and sets Addr to null.
Definition at line 313 of file PHITransAddr.cpp.
References assert(), llvm::DominatorTree::isReachableFromEntry(), PHITranslateWithInsertion(), and Verify().
Referenced by NeedsPHITranslationFromBlock(), PHITranslateWithInsertion(), and SortNonLocalDepInfoCache().
Value * PHITransAddr::PHITranslateWithInsertion | ( | BasicBlock * | CurBB, |
BasicBlock * | PredBB, | ||
const DominatorTree & | DT, | ||
SmallVectorImpl< Instruction *> & | NewInsts | ||
) |
PHITranslateWithInsertion - PHI translate this value into the specified predecessor block, inserting a computation of the value if it is unavailable.
All newly created instructions are added to the NewInsts list. This returns null on failure.
Definition at line 342 of file PHITransAddr.cpp.
References llvm::MCID::Add, llvm::CastInst::Create(), llvm::GetElementPtrInst::Create(), CreateAdd(), llvm::dyn_cast(), llvm::Instruction::eraseFromParent(), GEP, getAddr(), llvm::Value::getName(), llvm::BasicBlock::getTerminator(), llvm::Value::getType(), llvm::isSafeToSpeculativelyExecute(), llvm::makeArrayRef(), PHITranslateValue(), llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::Instruction::setDebugLoc(), llvm::Instruction::setHasNoSignedWrap(), llvm::Instruction::setHasNoUnsignedWrap(), llvm::GetElementPtrInst::setIsInBounds(), and llvm::SmallVectorBase::size().
Referenced by NeedsPHITranslationFromBlock(), and PHITranslateValue().
bool PHITransAddr::Verify | ( | ) | const |
Verify - Check internal consistency of this data structure.
If the structure is valid, it returns true. If invalid, it prints errors and returns false.
Definition at line 92 of file PHITransAddr.cpp.
References llvm::errs(), llvm_unreachable, and VerifySubExpr().
Referenced by NeedsPHITranslationFromBlock(), and PHITranslateValue().