LLVM
10.0.0svn
|
A Use represents the edge between a Value definition and its users. More...
#include "llvm/IR/Use.h"
Classes | |
struct | PrevPointerTraits |
Pointer traits for the Prev PointerIntPair. More... | |
struct | UserRefPointerTraits |
Pointer traits for the UserRef PointerIntPair. More... | |
Public Types | |
using | UserRef = PointerIntPair< User *, 1, unsigned, UserRefPointerTraits > |
Public Member Functions | |
Use (const Use &U)=delete | |
void | swap (Use &RHS) |
Provide a fast substitute to std::swap<Use> that also works with less standard-compliant compilers. More... | |
operator Value * () const | |
Value * | get () const |
User * | getUser () const LLVM_READONLY |
Returns the User that contains this Use. More... | |
void | set (Value *Val) |
Value * | operator= (Value *RHS) |
const Use & | operator= (const Use &RHS) |
Value * | operator-> () |
const Value * | operator-> () const |
Use * | getNext () const |
unsigned | getOperandNo () const |
Return the operand # of this use in its User. More... | |
Static Public Member Functions | |
static Use * | initTags (Use *Start, Use *Stop) |
Initializes the waymarking tags on an array of Uses. More... | |
static void | zap (Use *Start, const Use *Stop, bool del=false) |
Destroys Use operands when the number of operands of a User changes. More... | |
Friends | |
class | Value |
A Use represents the edge between a Value definition and its users.
This is notionally a two-dimensional linked list. It supports traversing all of the uses for a particular value definition. It also supports jumping directly to the used value when we arrive from the User's operands, and jumping directly to the User when we arrive from the Value's uses.
The pointer to the used Value is explicit, and the pointer to the User is implicit. The implicit pointer is found via a waymarking algorithm described in the programmer's manual:
http://www.llvm.org/docs/ProgrammersManual.html#the-waymarking-algorithm
This is essentially the single most memory intensive object in LLVM because of the number of uses in the system. At the same time, the constant time operations it allows are essential to many optimizations having reasonable time complexity.
using llvm::Use::UserRef = PointerIntPair<User *, 1, unsigned, UserRefPointerTraits> |
|
inline |
Definition at line 107 of file Use.h.
References getUser(), LLVM_READONLY, and operator=().
Referenced by llvm::Attributor::checkForAllCallSites(), createCallInst(), llvm::simplify_type< Use >::getSimplifiedValue(), llvm::simplify_type< const Use >::getSimplifiedValue(), getStartOrEndSlot(), llvm::DivergenceAnalysis::isDivergentUse(), operandWithNewAddressSpaceOrCreateUndef(), processCallSite(), llvm::SSAUpdater::RewriteUse(), and ShrinkDemandedConstant().
|
inline |
Definition at line 123 of file Use.h.
References getOperandNo(), and initTags().
unsigned llvm::Use::getOperandNo | ( | ) | const |
Return the operand # of this use in its User.
Definition at line 47 of file Use.cpp.
References getUser(), and llvm::User::op_begin().
Referenced by allUsesTruncate(), createCallInst(), getNext(), isCompatibleReplacement(), isSimplePointerUseValidToReplace(), tryFoldInst(), and tryToFoldACImm().
User * llvm::Use::getUser | ( | ) | const |
Returns the User that contains this Use.
For an instruction operand, for example, this will return the instruction.
Definition at line 40 of file Use.cpp.
Referenced by llvm::MemorySSAUpdater::applyInsertUpdates(), llvm::Attributor::checkForAllCallSites(), contains(), createCallInst(), llvm::deleteDeadLoop(), llvm::DominatorTree::dominates(), llvm::MemorySSA::dominates(), eliminateSwiftErrorAlloca(), foldXorToXor(), get(), llvm::IRPosition::getAttrs(), GetCaseResults(), llvm::MemoryPhi::getIncomingBlock(), llvm::PHINode::getIncomingBlock(), getOperandNo(), getRetComponentType(), getSignature(), INITIALIZE_PASS(), llvm::MemorySSAUpdater::insertDef(), isDirectCall(), llvm::DivergenceAnalysis::isDivergentUse(), isProfitableForVectorization(), llvm::DominatorTree::isReachableFromEntry(), isSimplePointerUseValidToReplace(), OptimizeGlobalAddressOfMalloc(), PushArgMD(), llvm::MemorySSAUpdater::removeMemoryAccess(), replaceAllUsesOfWithIn(), llvm::replaceDbgValueForAlloca(), llvm::replaceNonLocalUsesWith(), replacePrepare(), llvm::Value::replaceUsesOutsideBlock(), RetagMask(), llvm::SSAUpdater::RewriteUse(), llvm::SSAUpdater::RewriteUseAfterInsertions(), RewriteUsesOfClonedInstructions(), runAttributorOnModule(), simplifyLoopInst(), sinkInstruction(), and llvm::sroa::AllocaSliceRewriter::visit().
|
inline |
Definition at line 730 of file Value.h.
References llvm::Value::addUse().
Referenced by llvm::MemorySSAUpdater::applyInsertUpdates(), contains(), createCallInst(), llvm::deleteDeadLoop(), llvm::GVNExpression::Expression::dump(), eliminateSwiftErrorAlloca(), isDirectCall(), isProfitableForVectorization(), processCallSite(), llvm::SwitchInst::removeCase(), llvm::IndirectBrInst::removeDestination(), llvm::MemorySSAUpdater::removeMemoryAccess(), replaceDominatedUsesWith(), llvm::replaceNonLocalUsesWith(), llvm::Value::replaceUsesWithIf(), llvm::SSAUpdater::RewriteUse(), llvm::SSAUpdater::RewriteUseAfterInsertions(), simplifyLoopInst(), and sinkLastInstruction().
void llvm::Use::swap | ( | Use & | RHS | ) |
Provide a fast substitute to std::swap<Use> that also works with less standard-compliant compilers.
Definition at line 16 of file Use.cpp.
References llvm::Value::addUse().
Destroys Use operands when the number of operands of a User changes.
Definition at line 86 of file Use.cpp.
Referenced by llvm::User::growHungoffUses(), and llvm::User::operator delete().