14#ifndef LLVM_ANALYSIS_WITHCACHE_H
15#define LLVM_ANALYSIS_WITHCACHE_H
25 const SimplifyQuery &Q);
28 static_assert(std::is_pointer_v<Arg>,
"WithCache requires a pointer type!");
30 using UnderlyingType = std::remove_pointer_t<Arg>;
31 constexpr static bool IsConst = std::is_const_v<Arg>;
33 template <
typename T,
bool Const>
34 using conditionally_const_t = std::conditional_t<Const, const T, T>;
36 using PointerType = conditionally_const_t<UnderlyingType *, IsConst>;
37 using ReferenceType = conditionally_const_t<UnderlyingType &, IsConst>;
54 : Pointer(Pointer,
true), Known(Known) {}
60 calculateKnownBits(Q);
64 [[nodiscard]]
bool hasKnownBits()
const {
return Pointer.getInt(); }
This file defines the PointerIntPair class.
PointerIntPair - This class implements a pair of a pointer and small integer.
PointerType operator->() const
bool hasKnownBits() const
WithCache(PointerType Pointer)
WithCache(PointerType Pointer, const KnownBits &Known)
const KnownBits & getKnownBits(const SimplifyQuery &Q) const
ReferenceType operator*() const
PointerType getValue() const
This is an optimization pass for GlobalISel generic memory operations.
void computeKnownBits(const Value *V, KnownBits &Known, const DataLayout &DL, unsigned Depth=0, AssumptionCache *AC=nullptr, const Instruction *CxtI=nullptr, const DominatorTree *DT=nullptr, bool UseInstrInfo=true)
Determine which bits of V are known to be either zero or one and return them in the KnownZero/KnownOn...