15 #ifndef LLVM_SUPPORT_TYPESIZE_H 16 #define LLVM_SUPPORT_TYPESIZE_H 30 : Min(Min), Scalable(Scalable) {}
33 return { Min * RHS, Scalable };
36 return { Min / RHS, Scalable };
43 return !(*
this == RHS);
57 : MinSize(MinSize), IsScalable(Scalable) {}
71 return std::tie(LHS.MinSize, LHS.IsScalable) ==
72 std::tie(RHS.MinSize, RHS.IsScalable);
89 assert(LHS.IsScalable == RHS.IsScalable &&
90 "Ordering comparison of scalable and fixed types");
92 return LHS.MinSize < RHS.MinSize;
110 return { MinSize * RHS, IsScalable };
114 return { LHS * RHS.MinSize, RHS.IsScalable };
118 return { MinSize / RHS, IsScalable };
125 assert(!IsScalable &&
"Request for a fixed size on a scalable object");
143 return (MinSize & 7) == 0;
150 operator uint64_t()
const {
151 return getFixedSize();
157 return { MinSize * RHS, IsScalable };
161 return { MinSize * RHS, IsScalable };
165 return { MinSize * RHS, IsScalable };
169 return { LHS * RHS.MinSize, RHS.IsScalable };
173 return { LHS * RHS.MinSize, RHS.IsScalable };
177 return { LHS * RHS.MinSize, RHS.IsScalable };
181 return { MinSize / RHS, IsScalable };
185 return { MinSize / RHS, IsScalable };
189 return { MinSize / RHS, IsScalable };
199 assert(Align != 0u &&
"Align must be non-zero");
206 #endif // LLVM_SUPPORT_TypeSize_H
friend bool operator!=(const TypeSize &LHS, const TypeSize &RHS)
This class represents lattice values for constants.
TypeSize operator/(uint64_t RHS) const
TypeSize operator*(int64_t RHS) const
TypeSize operator*(unsigned RHS) const
friend bool operator<=(const TypeSize &LHS, const TypeSize &RHS)
static constexpr TypeSize Scalable(uint64_t MinSize)
bool operator!=(const ElementCount &RHS) const
friend TypeSize operator*(const unsigned LHS, const TypeSize &RHS)
friend bool operator<(const TypeSize &LHS, const TypeSize &RHS)
friend bool operator>=(const TypeSize &LHS, const TypeSize &RHS)
TypeSize operator*(uint64_t RHS) const
uint64_t getFixedSize() const
friend TypeSize operator*(const int LHS, const TypeSize &RHS)
friend TypeSize operator*(const uint64_t LHS, const TypeSize &RHS)
ElementCount operator*(unsigned RHS)
This struct is a compact representation of a valid (non-zero power of two) alignment.
TypeSize operator*(int RHS) const
friend bool operator==(const TypeSize &LHS, const TypeSize &RHS)
ElementCount(unsigned Min, bool Scalable)
friend bool operator>(const TypeSize &LHS, const TypeSize &RHS)
static constexpr TypeSize Fixed(uint64_t Size)
TypeSize operator/(int RHS) const
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
uint64_t getKnownMinSize() const
bool operator==(const ElementCount &RHS) const
TypeSize operator/(int64_t RHS) const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
TypeSize operator/(unsigned RHS) const
constexpr TypeSize(uint64_t MinSize, bool Scalable)
friend TypeSize operator*(const int64_t LHS, const TypeSize &RHS)
ElementCount operator/(unsigned RHS)