Go to the documentation of this file.
13 #ifndef LLVM_IR_VALUEHANDLE_H
14 #define LLVM_IR_VALUEHANDLE_H
45 AddToExistingUseList(
RHS.getPrevPtr());
53 void setValPtr(
Value *V) { Val = V; }
57 : PrevPair(nullptr,
Kind) {}
59 : PrevPair(nullptr,
Kind), Val(V) {
82 return RHS.getValPtr();
85 setValPtr(
RHS.getValPtr());
87 AddToExistingUseList(
RHS.getPrevPtr());
94 assert(V &&
"Dereferencing deleted ValueHandle");
259 template <
typename ValueTy>
261 #
if LLVM_ENABLE_ABI_BREAKING_CHECKS
267 #if LLVM_ENABLE_ABI_BREAKING_CHECKS
272 Value *getRawValPtr()
const {
return ThePtr; }
273 void setRawValPtr(
Value *
P) { ThePtr =
P; }
276 static Value *GetAsValue(
Value *V) {
return V; }
277 static Value *GetAsValue(
const Value *V) {
return const_cast<Value*
>(V); }
279 ValueTy *getValPtr()
const {
return static_cast<ValueTy *
>(getRawValPtr()); }
280 void setValPtr(ValueTy *
P) { setRawValPtr(GetAsValue(
P)); }
283 #if LLVM_ENABLE_ABI_BREAKING_CHECKS
293 operator ValueTy*()
const {
302 setValPtr(
RHS.getValPtr());
337 "TrackingVH must be non-null and valid on dereference!");
343 assert(isa<ValueTy>(InnerHandle) &&
344 "Tracked Value was replaced by one with an invalid type!");
345 return cast<ValueTy>(InnerHandle);
363 operator ValueTy*()
const {
384 virtual void anchor();
444 template <
typename ValueTy>
446 #
if LLVM_ENABLE_ABI_BREAKING_CHECKS
453 static Value *GetAsValue(
Value *V) {
return V; }
454 static Value *GetAsValue(
const Value *V) {
return const_cast<Value *
>(V); }
456 #if LLVM_ENABLE_ABI_BREAKING_CHECKS
463 bool Poisoned =
false;
469 void deleted()
override {
470 assert(!Poisoned &&
"Tried to delete an already poisoned handle!");
476 void allUsesReplacedWith(
Value *)
override {
477 assert(!Poisoned &&
"Tried to RAUW an already poisoned handle!");
481 #else // LLVM_ENABLE_ABI_BREAKING_CHECKS
482 Value *ThePtr =
nullptr;
484 Value *getRawValPtr()
const {
return ThePtr; }
485 void setRawValPtr(
Value *
P) { ThePtr =
P; }
488 ValueTy *getValPtr()
const {
489 #if LLVM_ENABLE_ABI_BREAKING_CHECKS
490 assert(!Poisoned &&
"Accessed a poisoned value handle!");
492 return static_cast<ValueTy *
>(getRawValPtr());
494 void setValPtr(ValueTy *
P) { setRawValPtr(GetAsValue(
P)); }
498 #if LLVM_ENABLE_ABI_BREAKING_CHECKS
501 : CallbackVH(
RHS), Poisoned(
RHS.Poisoned) {}
512 Poisoned =
RHS.Poisoned;
519 operator ValueTy *()
const {
return getValPtr(); }
562 #endif // LLVM_IR_VALUEHANDLE_H
This is an optimization pass for GlobalISel generic memory operations.
virtual void deleted()
Callback for Value destruction.
Value handle that is nullable, but tries to track the Value.
This is the common base class of value handles.
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
ValueTy * getValPtr() const
WeakVH(const WeakVH &RHS)
A nullable Value handle that is nullable.
static PoisoningVH< T > getEmptyKey()
Value * getValPtr() const
Value * operator=(const ValueHandleBase &RHS)
static Error getInt(StringRef R, IntTy &Result)
Get an unsigned integer, including error checks.
static Value * GetAsValue(Value *V)
static PoisoningVH< T > getTombstoneKey()
An information struct used to provide DenseMap with the various necessary components for a given valu...
static bool isEqual(const T *LHS, const PoisoningVH< T > &RHS)
Define a template that can be specialized by smart pointers to reflect the fact that they are automat...
static WeakVH getTombstoneKey()
static bool isValid(Value *V)
ValueHandleBase(HandleBaseKind Kind, Value *V)
static void ValueIsRAUWd(Value *Old, Value *New)
Value * operator->() const
PointerTy getPointer() const
static unsigned getHashValue(const PoisoningVH< T > &Val)
ValueTy * operator->() const
Value * operator=(const ValueHandleBase &RHS)
static SimpleType getSimplifiedValue(WeakVH &WVH)
void RemoveFromUseList()
Remove this ValueHandle from its current use list.
static SimpleType getSimplifiedValue(WeakTrackingVH &WVH)
ValueTy * operator=(const AssertingVH< ValueTy > &RHS)
bool pointsToAliveValue() const
virtual void allUsesReplacedWith(Value *)
Callback for Value RAUW.
WeakVH & operator=(const WeakVH &RHS)=default
ValueHandleBase(const ValueHandleBase &RHS)
static Value * GetAsValue(const Value *V)
Value handle that tracks a Value across RAUW.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ValueTy & operator*() const
Value & operator*() const
Value * operator=(Value *RHS)
CallbackVH(const Value *P)
static SimpleType getSimplifiedValue(const WeakVH &WVH)
static void ValueIsDeleted(Value *V)
static bool isEqual(const WeakVH &LHS, const WeakVH &RHS)
ValueTy & operator*() const
if(llvm_vc STREQUAL "") set(fake_version_inc "$
void setPointer(PointerTy PtrVal) &
void clearValPtr()
Clear the underlying pointer without clearing the use list.
Value handle that poisons itself if the Value is deleted.
static SimpleType getSimplifiedValue(const WeakTrackingVH &WVH)
static bool isEqual(const PoisoningVH< T > &LHS, const PoisoningVH< T > &RHS)
Value * operator=(const ValueHandleBase &RHS)
static WeakVH getEmptyKey()
ValueTy * operator=(ValueTy *RHS)
HandleBaseKind
This indicates what sub class the handle actually is.
static bool isEqual(const Function &Caller, const Function &Callee)
Value handle with callbacks on RAUW and destruction.
void setValPtr(ValueTy *P)
WeakTrackingVH(const WeakTrackingVH &RHS)
PointerIntPair - This class implements a pair of a pointer and small integer.
static unsigned getHashValue(const T *Val)
Value handle that asserts if the Value is deleted.
ValueHandleBase(HandleBaseKind Kind, const ValueHandleBase &RHS)
Value * operator=(Value *RHS)
ValueTy * operator->() const
ValueTy * operator->() const
Value * operator=(Value *RHS)
ValueTy * operator=(ValueTy *RHS)
CallbackVH & operator=(const CallbackVH &)=default
ValueTy & operator*() const
static unsigned getHashValue(const WeakVH &Val)
LLVM Value Representation.
ValueHandleBase(HandleBaseKind Kind)
WeakTrackingVH & operator=(const WeakTrackingVH &RHS)=default