Go to the documentation of this file.
9 #ifndef LLVM_ADT_POINTEREMBEDDEDINT_H
10 #define LLVM_ADT_POINTEREMBEDDEDINT_H
18 #include <type_traits>
32 template <
typename IntT,
int Bits = sizeof(IntT) * CHAR_BIT>
38 static_assert(
Bits <
sizeof(uintptr_t) * CHAR_BIT,
39 "Cannot embed more bits than we have in a pointer!");
44 Shift =
sizeof(uintptr_t) * CHAR_BIT -
Bits,
47 Mask =
static_cast<uintptr_t
>(-1) <<
Bits
51 explicit RawValueTag() =
default;
64 assert((std::is_signed<IntT>::value ? isInt<Bits>(
I) : isUInt<Bits>(
I)) &&
65 "Integer has bits outside those preserved!");
72 operator IntT()
const {
73 if (std::is_signed<IntT>::value)
81 template <
typename IntT,
int Bits>
86 return reinterpret_cast<void *
>(
P.Value);
90 return T(
reinterpret_cast<uintptr_t
>(
P),
typename T::RawValueTag());
94 return T(
reinterpret_cast<uintptr_t
>(
P),
typename T::RawValueTag());
97 static constexpr
int NumLowBitsAvailable =
T::Shift;
102 template <
typename IntT,
int Bits>
111 return IntInfo::getHashValue(
Arg);
119 #endif // LLVM_ADT_POINTEREMBEDDEDINT_H
PointerEmbeddedInt & operator=(IntT I)
PointerEmbeddedInt()=default
This is an optimization pass for GlobalISel generic memory operations.
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
static void * getAsVoidPointer(const T &P)
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
An information struct used to provide DenseMap with the various necessary components for a given valu...
static T getFromVoidPointer(const void *P)
Utility to embed an integer into a pointer-like type.
static unsigned getHashValue(const T &Arg)
static T getFromVoidPointer(void *P)
static bool isEqual(const T &LHS, const T &RHS)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static T getTombstoneKey()
A traits type that is used to handle pointer types and things that are just wrappers for pointers as ...
PointerEmbeddedInt(IntT I)
LLVM Value Representation.