9#ifndef LLVM_SANDBOXIR_VALUE_H
10#define LLVM_SANDBOXIR_VALUE_H
18#define DEF_INSTR(ID, OPC, CLASS) class CLASS;
19#define DEF_CONST(ID, CLASS) class CLASS;
20#define DEF_USER(ID, CLASS) class CLASS;
21#include "llvm/SandboxIR/Values.def"
28class UnaryInstruction;
32class OverflowingBinaryOperator;
57 return !(*
this ==
Other);
66#define DEF_VALUE(ID, CLASS) ID,
67#define DEF_USER(ID, CLASS) ID,
68#define DEF_CONST(ID, CLASS) ID,
69#define DEF_INSTR(ID, OPC, CLASS) ID,
70#include "llvm/SandboxIR/Values.def"
76#define DEF_VALUE(ID, CLASS) \
79#define DEF_USER(ID, CLASS) \
82#define DEF_CONST(ID, CLASS) \
85#define DEF_INSTR(ID, OPC, CLASS) \
88#include "llvm/SandboxIR/Values.def"
269 std::string
getUid()
const;
#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.
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.
In SandboxIR the Module is mainly used to access the list of global objects.
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
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.
void replaceAllUsesWith(Value *Other)
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
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.'.
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)
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