LLVM 17.0.0git

PHITransAddr - An address value which tracks and handles phi translation. More...

#include "llvm/Analysis/PHITransAddr.h"

## Public Member Functions

bool needsPHITranslationFromBlock (BasicBlock *BB) const
needsPHITranslationFromBlock - Return true if moving from the specified BasicBlock to its predecessors requires PHI translation.

bool isPotentiallyPHITranslatable () const
isPotentiallyPHITranslatable - If this needs PHI translation, return true if we have some hope of doing it.

ValuetranslateValue (BasicBlock *CurBB, BasicBlock *PredBB, const DominatorTree *DT, bool MustDominate)
translateValue - PHI translate the current address up the CFG from CurBB to Pred, updating our state to reflect any needed changes.

ValuetranslateWithInsertion (BasicBlock *CurBB, BasicBlock *PredBB, const DominatorTree &DT, SmallVectorImpl< Instruction * > &NewInsts)
translateWithInsertion - PHI translate this value into the specified predecessor block, inserting a computation of the value if it is unavailable.

void dump () const

bool verify () const
verify - Check internal consistency of this data structure.

## Detailed Description

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 35 of file PHITransAddr.h.

## Constructor & Destructor Documentation

inline

Definition at line 52 of file PHITransAddr.h.

## ◆ dump()

 LLVM_DUMP_METHOD void PHITransAddr::dump ( ) const

Definition at line 40 of file PHITransAddr.cpp.

References llvm::dbgs().

inline

Definition at line 58 of file PHITransAddr.h.

Referenced by memoryIsNotModifiedBetween().

## ◆ isPotentiallyPHITranslatable()

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 103 of file PHITransAddr.cpp.

References canPHITrans().

Referenced by memoryIsNotModifiedBetween().

## ◆ needsPHITranslationFromBlock()

 bool llvm::PHITransAddr::needsPHITranslationFromBlock ( BasicBlock * BB ) const
inline

needsPHITranslationFromBlock - Return true if moving from the specified BasicBlock to its predecessors requires PHI translation.

Definition at line 62 of file PHITransAddr.h.

References llvm::any_of().

Referenced by memoryIsNotModifiedBetween().

## ◆ translateValue()

 Value * PHITransAddr::translateValue ( BasicBlock * CurBB, BasicBlock * PredBB, const DominatorTree * DT, bool MustDominate )

translateValue - PHI translate the current address up the CFG from CurBB to Pred, updating our state to reflect any needed changes.

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.

Definition at line 298 of file PHITransAddr.cpp.

Referenced by memoryIsNotModifiedBetween().

## ◆ translateWithInsertion()

 Value * PHITransAddr::translateWithInsertion ( BasicBlock * CurBB, BasicBlock * PredBB, const DominatorTree & DT, SmallVectorImpl< Instruction * > & NewInsts )

translateWithInsertion - PHI translate this value into the specified predecessor block, inserting a computation of the value if it is unavailable.

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 326 of file PHITransAddr.cpp.