14#ifndef LLVM_ANALYSIS_WITHCACHE_H
15#define LLVM_ANALYSIS_WITHCACHE_H
29 static_assert(std::is_pointer_v<Arg>,
"WithCache requires a pointer type!");
31 using UnderlyingType = std::remove_pointer_t<Arg>;
32 constexpr static bool IsConst = std::is_const_v<Arg>;
34 template <
typename T,
bool Const>
35 using conditionally_const_t = std::conditional_t<Const, const T, T>;
37 using PointerType = conditionally_const_t<UnderlyingType *, IsConst>;
38 using ReferenceType = conditionally_const_t<UnderlyingType &, IsConst>;
55 : Pointer(Pointer,
true), Known(Known) {}
61 calculateKnownBits(Q);
65 [[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.
LLVM_ABI void computeKnownBits(const Value *V, KnownBits &Known, const DataLayout &DL, AssumptionCache *AC=nullptr, const Instruction *CxtI=nullptr, const DominatorTree *DT=nullptr, bool UseInstrInfo=true, unsigned Depth=0)
Determine which bits of V are known to be either zero or one and return them in the KnownZero/KnownOn...