9#ifndef LLVM_SANDBOXIR_VALUE_H
10#define LLVM_SANDBOXIR_VALUE_H
20#define DEF_INSTR(ID, OPC, CLASS) class CLASS;
21#define DEF_CONST(ID, CLASS) class CLASS;
22#define DEF_USER(ID, CLASS) class CLASS;
23#include "llvm/SandboxIR/Values.def"
30class UnaryInstruction;
34class OverflowingBinaryOperator;
60 return !(*
this ==
Other);
69#define DEF_VALUE(ID, CLASS) ID,
70#define DEF_USER(ID, CLASS) ID,
71#define DEF_CONST(ID, CLASS) ID,
72#define DEF_INSTR(ID, OPC, CLASS) ID,
73#include "llvm/SandboxIR/Values.def"
79#define DEF_VALUE(ID, CLASS) \
82#define DEF_USER(ID, CLASS) \
85#define DEF_CONST(ID, CLASS) \
88#define DEF_INSTR(ID, OPC, CLASS) \
91#include "llvm/SandboxIR/Values.def"
277 std::string
getUid()
const;
300 return From->getSubclassID() == ClassID::OpaqueValue;
304 assert((isa<llvm::MetadataAsValue>(
Val) || isa<llvm::InlineAsm>(
Val)) &&
305 "Expected Metadata or InlineAssembly!");
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
BlockVerifier::State From
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
Machine Check Debug Module
StringRef - Represent a constant reference to a string, i.e.
LLVM Value Representation.
LLVM_ABI StringRef getName() const
Return a constant reference to the value's name.
An efficient, type-erasing, non-owning reference to a callable.
A range adaptor for a pair of iterators.
This class implements an extremely fast bulk output stream that can only output to a stream.
A vector constant whose element type is a simple 1/2/4/8-byte integer or float/double,...
In SandboxIR the Module is mainly used to access the list of global objects.
static bool classof(const Value *From)
void dumpOS(raw_ostream &OS) const override
void verify() const override
Should crash if there is something wrong with the instruction.
OpaqueValue(llvm::Value *V, Context &Ctx)
The main job of the Region is to point to new instructions generated by vectorization passes.
Just like llvm::Type these are immutable, unique, never get freed and can only be created via static ...
Represents a Def-use/Use-def edge in SandboxIR.
class User * getUser() const
Iterator for the Use edges of a Value's users.
const sandboxir::Use & getUse() const
std::input_iterator_tag iterator_category
std::ptrdiff_t difference_type
bool operator!=(const UserUseIterator &Other) const
value_type operator*() const
bool operator==(const UserUseIterator &Other) const
LLVM_ABI UserUseIterator & operator++()
UserUseIterator()=default
A sandboxir::User has operands.
A SandboxIR Value has users. This is the base class.
mapped_iterator< sandboxir::UserUseIterator, UseToUser > user_iterator
llvm::Value * Val
The LLVM Value that corresponds to this SandboxIR Value.
void dumpCommonFooter(raw_ostream &OS) const
virtual void dumpCommonHeader(raw_ostream &OS) const
const_use_iterator use_end() const
ClassID getSubclassID() const
void dumpCommonSuffix(raw_ostream &OS) const
StringRef getName() const
\Returns the LLVM IR name of the bottom-most LLVM value.
virtual void verify() const =0
Should crash if there is something wrong with the instruction.
LLVM_ABI void replaceAllUsesWith(Value *Other)
LLVM_ABI unsigned getNumUses() const
\Returns the number of user edges (not necessarily to unique users).
UserUseIterator use_iterator
void printAsOperandCommon(raw_ostream &OS) const
Context & Ctx
All values point to the context.
ClassID SubclassID
For isa/dyn_cast.
LLVM_DUMP_METHOD void dump() const
LLVM_ABI Type * getType() const
friend class LLVMOpUserItToSBTy
const_use_iterator use_begin() const
Context & getContext() const
const_user_iterator user_begin() const
bool hasNUsesOrMore(unsigned Num) const
Return true if this value has N uses or more.
Value & operator=(const Value &)=delete
iterator_range< const_user_iterator > users() const
iterator_range< user_iterator > users()
std::string getUid() const
Returns the unique id in the form 'SB<number>.' like 'SB1.'.
LLVM_ABI void replaceUsesWithIf(Value *OtherV, llvm::function_ref< bool(const Use &)> ShouldReplace)
bool hasNUses(unsigned Num) const
Return true if this Value has exactly N uses.
unsigned UID
A unique ID used for forming the name (used for debugging).
virtual void dumpOS(raw_ostream &OS) const =0
void dumpCommonPrefix(raw_ostream &OS) const
iterator_range< use_iterator > uses()
const_user_iterator user_end() const
static const char * getSubclassIDStr(ClassID ID)
Value(const Value &)=delete
Disable copies.
friend raw_ostream & operator<<(raw_ostream &OS, const sandboxir::Value &V)
LLVM_ABI use_iterator use_begin()
LLVM_ABI user_iterator user_begin()
iterator_range< const_use_iterator > uses() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Helper for mapped_iterator.
User * operator()(const Use &Use) const