9#ifndef LLVM_SANDBOXIR_USER_H
10#define LLVM_SANDBOXIR_USER_H
28#define DEF_INSTR(ID, OPC, CLASS) friend class CLASS;
29#include "llvm/SandboxIR/Values.def"
50 return !(*
this ==
Other);
76 return Use.LLVMUse->getOperandNo();
103 assert(isa<llvm::User>(
Val) &&
"Expect User value!");
107 assert(isa<llvm::User>(
Val) &&
"Expect User value!");
129 return isa<llvm::User>(
Val) ? cast<llvm::User>(
Val)->getNumOperands() : 0;
139 assert(isa<llvm::User>(
Val) &&
"Expected User!");
BlockVerifier::State From
ppc ctr loops PowerPC CTR Loops Verify
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
A Use represents the edge between a Value definition and its users.
LLVM Value Representation.
A range adaptor for a pair of iterators.
This class implements an extremely fast bulk output stream that can only output to a stream.
Iterator for the Use edges of a User's operands.
OperandUseIterator()=default
std::ptrdiff_t difference_type
std::input_iterator_tag iterator_category
OperandUseIterator operator++(int)
bool operator!=(const OperandUseIterator &Other) const
bool operator==(const OperandUseIterator &Other) const
OperandUseIterator operator-(unsigned Num) const
value_type operator*() const
OperandUseIterator & operator++()
OperandUseIterator operator+(unsigned Num) const
Represents a Def-use/Use-def edge in SandboxIR.
unsigned getOperandNo() const
A sandboxir::User has operands.
virtual op_iterator op_begin()
void dumpOS(raw_ostream &OS) const override
friend class OperandUseIterator
Value * getOperand(unsigned OpIdx) const
virtual unsigned getUseOperandNo(const Use &Use) const =0
\Returns the operand index of Use.
void verifyUserOfLLVMUse(const llvm::Use &Use) const
unsigned getUseOperandNoDefault(const Use &Use) const
The default implementation works only for single-LLVMIR-instruction Users and only if they match exac...
virtual const_op_iterator op_end() const
virtual void setOperand(unsigned OperandIdx, Value *Operand)
void verify() const override
Should crash if there is something wrong with the instruction.
bool replaceUsesOfWith(Value *FromV, Value *ToV)
Replaces any operands that match FromV with ToV.
Use getOperandUseDefault(unsigned OpIdx, bool Verify) const
\Returns the Use edge that corresponds to OpIdx.
OperandUseIterator op_iterator
const_op_range operands() const
static bool classof(const Value *From)
For isa/dyn_cast.
virtual Use getOperandUseInternal(unsigned OpIdx, bool Verify) const =0
\Returns the Use for the OpIdx'th operand.
void dumpCommonHeader(raw_ostream &OS) const final
void swapOperandsInternal(unsigned OpIdxA, unsigned OpIdxB)
virtual unsigned getNumOperands() const
virtual const_op_iterator op_begin() const
Use getOperandUse(unsigned OpIdx) const
\Returns the operand edge for OpIdx.
virtual op_iterator op_end()
User(ClassID ID, llvm::Value *V, Context &Ctx)
A SandboxIR Value has users. This is the base class.
llvm::Value * Val
The LLVM Value that corresponds to this SandboxIR Value.
Context & Ctx
All values point to the context.