9#ifndef LLVM_TOOLS_LLUBI_VALUE_H
10#define LLVM_TOOLS_LLUBI_VALUE_H
81 "Please ensure pointer bits are concrete before calling writeTagBits.");
100 static_cast<uint8_t>((
Low.ConcreteMask | (
High.ConcreteMask << 8)) >>
103 static_cast<uint8_t>((
Low.TagMask | (
High.TagMask << 8)) >> ShAmt),
104 static_cast<uint8_t>((
Low.TagValue | (
High.TagValue << 8)) >> ShAmt)};
124 bool AreAllValueBitsPoison = (
ConcreteMask & ~PaddingMask) == 0;
126 (AreAllValueBitsPoison ? 0 : PaddingMask) &&
127 (
Value & PaddingMask) == 0;
210 const APInt &getTag()
const {
return Tag; }
211 void setTag(
const APInt &
T) { Tag =
T; }
233 : Prov(
Provenance::nullary()), Address(Address) {}
235 : Prov(
std::
move(Prov)), Address(Address) {
236 assert(this->Prov &&
"Invalid provenance.");
242 return Pointer(NewProv, Address);
259 std::vector<Byte> Val;
281 : Val(
std::
move(Val)), BitWidth(BitWidth),
282 IsLittleEndian(IsLittleEndian) {
284 assert(
isValid() &&
"Input padding bits must be canonical.");
305 "Canonical padding bits should not be canonicalized.");
306 if ((BitWidth & 7) == 0)
309 Byte &MSB = (IsLittleEndian ? this->Val.back() : this->Val.front());
323 if ((BitWidth & 7) == 0)
326 const Byte &MSB = (IsLittleEndian ? this->Val.back() : this->Val.front());
384 return Ty->isVoidTy();
386 return Ty->isFloatingPointTy() || Ty->isIntegerTy() || Ty->isPointerTy();
388 return Ty->isIntegerTy();
390 return Ty->isFloatingPointTy();
392 return Ty->isPointerTy();
394 return Ty->isByteTy();
397 return Ty->isAggregateType() || Ty->isVectorTy();
429 "Expect an aggregate/vector value");
435 "Expect an aggregate/vector value");
442 "Expect an aggregate/vector value");
479 if (HasNUW && Res.
ult(
RHS))
481 if (HasNSW &&
LHS.isNonNegative() ==
RHS.isNonNegative() &&
490 if (HasNUW && Res.
ugt(
LHS))
492 if (HasNSW &&
LHS.isNonNegative() !=
RHS.isNonNegative() &&
500 bool Overflow =
false;
502 if (HasNSW && Overflow)
505 (void)
LHS.umul_ov(
RHS, Overflow);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file declares a class to represent arbitrary precision floating point values and provide a varie...
This file implements a class to represent arbitrary precision integral constant values and operations...
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
This file defines the RefCountedBase, ThreadSafeRefCountedBase, and IntrusiveRefCntPtr classes.
static cl::opt< RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode > Mode("regalloc-enable-advisor", cl::Hidden, cl::init(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default), cl::desc("Enable regalloc advisor mode"), cl::values(clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default, "default", "Default"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Release, "release", "precompiled"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Development, "development", "for training")))
Class for arbitrary precision integers.
bool ugt(const APInt &RHS) const
Unsigned greater than comparison.
bool ult(const APInt &RHS) const
Unsigned less than comparison.
bool isNonNegative() const
Determine if this APInt Value is non-negative (>= 0)
Represent a constant reference to an array (0 or more elements consecutively in memory),...
A parsed version of the target data layout string in and methods for querying it.
A smart pointer to a reference-counted object that inherits from RefCountedBase or ThreadSafeRefCount...
Represent a mutable reference to an array (0 or more elements consecutively in memory),...
The instances of the Type class are immutable: once they are created, they are never changed.
This class implements an extremely fast bulk output stream that can only output to a stream.
AnyValuePrinter & operator<<(const AnyValue &V)
AnyValuePrinter(Context &Ctx, raw_ostream &OS)
AnyValuePrinter & operator<<(const T &Val)
const AnyValue & get() const
static AnyValue poison()
Use getPoisonValue unless you know the scalar type is integer/fp/ptr!
std::vector< AnyValue > & asAggregate()
static AnyValue boolean(bool Val)
std::vector< AnyValue > AggVal
const Pointer & asPointer() const
BooleanKind asBoolean() const
AnyValue(std::vector< AnyValue > Val)
const ByteValue & asByte() const
ByteValue & asMutableByte()
const APInt & asInteger() const
bool isCompatibleWith(Type *Ty) const
const APFloat & asFloat() const
const std::vector< AnyValue > & asAggregate() const
Represents a scalar byte value.
static LLVM_ABI ByteValue poison(uint32_t BitWidth, bool IsLittleEndian)
ByteValue & operator=(const ByteValue &)=default
LLVM_ABI void print(Context &Ctx, raw_ostream &OS) const
ByteValue(ByteValue &&)=default
static LLVM_ABI ByteValue zero(uint32_t BitWidth, bool IsLittleEndian)
ByteValue(uint32_t BitWidth, std::vector< Byte > Val, bool IsLittleEndian, CanonicalizeMode Mode=CanonicalizeMode::Canonical)
MutableArrayRef< Byte > mutableBytes()
The caller should call canonicalize after mutation.
LLVM_ABI ByteValue(const APInt &V, bool IsLittleEndian)
uint32_t getBitWidth() const
ByteValue(uint32_t BitWidth, ArrayRef< Byte > Val, bool IsLittleEndian, CanonicalizeMode Mode=CanonicalizeMode::Canonical)
ByteValue(const ByteValue &)=default
ArrayRef< Byte > bytes() const
CanonicalizeMode
Specify how to treat the input.
@ FlushNonCanonicalToPoison
void canonicalize(CanonicalizeMode Mode)
Make sure the padding byte is canonical.
ByteValue & operator=(ByteValue &&)=default
The global context for the interpreter.
const APInt & address() const
Pointer getWithNewAddr(const APInt &NewAddr) const
static LLVM_ABI AnyValue null(unsigned AS, const DataLayout &DL)
Pointer(const APInt &Address)
Provenance & provenance() const
Pointer getWithNewProvenance(IntrusiveRefCntPtr< Provenance > NewProv) const
Pointer(IntrusiveRefCntPtr< Provenance > Prov, const APInt &Address)
LLVM_ABI bool isNullPtr(unsigned AS, const DataLayout &DL) const
LLVM_ABI void print(raw_ostream &OS) const
Components of a pointer excluding address.
MemoryObject * getMemoryObject() const
Provenance(IntrusiveRefCntPtr< MemoryObject > Obj)
static LLVM_ABI IntrusiveRefCntPtr< Provenance > nullary()
LLVM_ABI IntrusiveRefCntPtr< Provenance > getWithKnownMemoryObject(MemoryObject &Obj)
WildcardProvenance(uint64_t Generation)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
BooleanKind
Tri-state boolean value.
AnyValue addNoWrap(const APInt &LHS, const APInt &RHS, bool HasNSW, bool HasNUW)
AnyValue subNoWrap(const APInt &LHS, const APInt &RHS, bool HasNSW, bool HasNUW)
raw_ostream & operator<<(raw_ostream &OS, const Pointer &P)
AnyValue mulNoWrap(const APInt &LHS, const APInt &RHS, bool HasNSW, bool HasNUW)
@ Low
Lower the current thread's priority such that it does not affect foreground tasks significantly.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
LLVM_ABI std::optional< Register > getVectorSplat(const MachineInstr &MI, const MachineRegisterInfo &MRI)
Implement std::hash so that hash_code can be used in STL containers.
Representation of a byte in memory.
void writeBits(uint8_t Mask, uint8_t Val)
void writeTagBits(uint8_t Mask, uint8_t Tag)
void writeByte(uint8_t Mask, const Byte &RHS)
void undefBits(uint8_t Mask)
void poisonBits(uint8_t Mask)
static Byte concrete(uint8_t Val)
Byte lshr(uint8_t Shift) const
Byte shl(uint8_t Shift) const
static Byte fshr(const Byte &Low, const Byte &High, uint32_t ShAmt)
Returns a logical byte that is part of two adjacent bytes.
void zeroBits(uint8_t Mask)
bool isCanonicalPaddingByte(uint8_t PaddingMask) const
Padding bits may carry pointer provenance.