LLVM 19.0.0git
|
A SandboxIR Value has users. This is the base class. More...
#include "llvm/SandboxIR/SandboxIR.h"
Classes | |
struct | UseToUser |
Helper for mapped_iterator. More... | |
Public Types | |
enum class | ClassID : unsigned { DEF_VALUE , DEF_USER , DEF_INSTR } |
using | use_iterator = UserUseIterator |
using | const_use_iterator = UserUseIterator |
using | user_iterator = mapped_iterator< sandboxir::UserUseIterator, UseToUser > |
using | const_user_iterator = user_iterator |
Protected Member Functions | |
void | clearValue () |
Value (ClassID SubclassID, llvm::Value *Val, Context &Ctx) | |
Static Protected Member Functions | |
static const char * | getSubclassIDStr (ClassID ID) |
Protected Attributes | |
ClassID | SubclassID |
For isa/dyn_cast. | |
unsigned | UID |
A unique ID used for forming the name (used for debugging). | |
llvm::Value * | Val = nullptr |
The LLVM Value that corresponds to this SandboxIR Value. | |
Context & | Ctx |
All values point to the context. | |
Friends | |
class | Context |
class | User |
class | Use |
class | LoadInst |
template<typename ItTy , typename SBTy > | |
class | LLVMOpUserItToSBTy |
raw_ostream & | operator<< (raw_ostream &OS, const sandboxir::Value &V) |
A SandboxIR Value has users. This is the base class.
Definition at line 137 of file SandboxIR.h.
Definition at line 193 of file SandboxIR.h.
Definition at line 217 of file SandboxIR.h.
Definition at line 192 of file SandboxIR.h.
using llvm::sandboxir::Value::user_iterator = mapped_iterator<sandboxir::UserUseIterator, UseToUser> |
Definition at line 216 of file SandboxIR.h.
|
strong |
Enumerator | |
---|---|
DEF_VALUE | |
DEF_USER | |
DEF_INSTR |
Definition at line 139 of file SandboxIR.h.
|
protected |
Definition at line 80 of file SandboxIR.cpp.
References Ctx, llvm::sandboxir::Context::getNumValues(), and UID.
|
virtualdefault |
|
inlineprotected |
Definition at line 183 of file SandboxIR.h.
References Val.
|
pure virtual |
|
pure virtual |
void Value::dumpCommonFooter | ( | raw_ostream & | OS | ) | const |
Definition at line 153 of file SandboxIR.cpp.
|
virtual |
Reimplemented in llvm::sandboxir::User.
Definition at line 149 of file SandboxIR.cpp.
References getSubclassIDStr(), getUid(), OS, and SubclassID.
Referenced by llvm::sandboxir::User::dumpCommonHeader().
void Value::dumpCommonPrefix | ( | raw_ostream & | OS | ) | const |
Definition at line 162 of file SandboxIR.cpp.
Referenced by llvm::sandboxir::Argument::dump(), llvm::sandboxir::Constant::dump(), llvm::sandboxir::LoadInst::dump(), and llvm::sandboxir::OpaqueInst::dump().
void Value::dumpCommonSuffix | ( | raw_ostream & | OS | ) | const |
Definition at line 169 of file SandboxIR.cpp.
References getSubclassIDStr(), getUid(), OS, and SubclassID.
Referenced by llvm::sandboxir::Argument::dump(), llvm::sandboxir::Constant::dump(), llvm::sandboxir::LoadInst::dump(), and llvm::sandboxir::OpaqueInst::dump().
|
inline |
Definition at line 262 of file SandboxIR.h.
References Ctx.
Referenced by llvm::sandboxir::Constant::getParent().
|
inline |
\Returns the LLVM IR name of the bottom-most LLVM value.
Definition at line 269 of file SandboxIR.h.
References llvm::Value::getName(), and Val.
unsigned Value::getNumUses | ( | ) | const |
\Returns the number of user edges (not necessarily to unique users).
WARNING: This is a linear-time operation.
Definition at line 108 of file SandboxIR.cpp.
References llvm::range_size(), llvm::Value::users(), and Val.
|
inline |
Definition at line 190 of file SandboxIR.h.
References SubclassID.
Definition at line 147 of file SandboxIR.h.
References llvm_unreachable.
Referenced by dumpCommonHeader(), and dumpCommonSuffix().
|
inline |
Definition at line 260 of file SandboxIR.h.
References llvm::Value::getType(), and Val.
Referenced by replaceAllUsesWith(), and replaceUsesWithIf().
std::string Value::getUid | ( | ) | const |
Returns the unique id in the form 'SB<number>.' like 'SB1.'.
Definition at line 143 of file SandboxIR.cpp.
References UID.
Referenced by dumpCommonHeader(), and dumpCommonSuffix().
Return true if this Value has exactly N uses.
Definition at line 251 of file SandboxIR.h.
References use_begin(), and use_end().
Return true if this value has N uses or more.
This is logically equivalent to getNumUses() >= N. WARNING: This can be expensive, as it is linear to the number of users.
Definition at line 242 of file SandboxIR.h.
References use_begin(), and use_end().
void Value::printAsOperandCommon | ( | raw_ostream & | OS | ) | const |
Definition at line 173 of file SandboxIR.cpp.
References OS, llvm::Value::printAsOperand(), and Val.
Referenced by llvm::sandboxir::Argument::printAsOperand().
void Value::replaceAllUsesWith | ( | Value * | Other | ) |
Definition at line 130 of file SandboxIR.cpp.
References assert(), Ctx, llvm::sandboxir::Context::getTracker(), getType(), llvm::sandboxir::Tracker::isTracking(), llvm::Other, llvm::Value::replaceAllUsesWith(), llvm::sandboxir::Tracker::track(), uses(), and Val.
void Value::replaceUsesWithIf | ( | Value * | OtherV, |
llvm::function_ref< bool(const Use &)> | ShouldReplace | ||
) |
Definition at line 110 of file SandboxIR.cpp.
References assert(), Ctx, llvm::sandboxir::Context::getTracker(), getType(), llvm::Use::getUser(), llvm::sandboxir::Context::getValue(), llvm::sandboxir::Tracker::isTracking(), llvm::Value::replaceUsesWithIf(), llvm::sandboxir::Tracker::track(), and Val.
Value::use_iterator Value::use_begin | ( | ) |
Definition at line 87 of file SandboxIR.cpp.
References Ctx, llvm::sandboxir::Context::getValue(), Use, llvm::Value::use_begin(), llvm::Value::use_end(), and Val.
Referenced by hasNUses(), hasNUsesOrMore(), use_begin(), and uses().
|
inline |
Definition at line 196 of file SandboxIR.h.
References use_begin().
|
inline |
Definition at line 199 of file SandboxIR.h.
Referenced by hasNUses(), hasNUsesOrMore(), use_end(), and uses().
|
inline |
Definition at line 200 of file SandboxIR.h.
References use_end().
Value::user_iterator Value::user_begin | ( | ) |
Definition at line 97 of file SandboxIR.cpp.
References Ctx, llvm::sandboxir::Context::getValue(), Use, llvm::Value::use_begin(), llvm::Value::use_end(), and Val.
Referenced by user_begin(), and users().
|
inline |
Definition at line 223 of file SandboxIR.h.
References user_begin().
|
inline |
Definition at line 220 of file SandboxIR.h.
Referenced by user_end(), and users().
|
inline |
Definition at line 226 of file SandboxIR.h.
References user_end().
|
inline |
Definition at line 230 of file SandboxIR.h.
References user_begin(), and user_end().
Referenced by llvm::sandboxir::Instruction::eraseFromParent().
|
inline |
Definition at line 233 of file SandboxIR.h.
References user_begin(), and user_end().
|
inline |
Definition at line 204 of file SandboxIR.h.
References use_begin(), and use_end().
Referenced by replaceAllUsesWith().
|
inline |
Definition at line 207 of file SandboxIR.h.
References use_begin(), and use_end().
|
pure virtual |
Should crash if there is something wrong with the instruction.
Implemented in llvm::sandboxir::Argument, llvm::sandboxir::Constant, llvm::sandboxir::LoadInst, llvm::sandboxir::OpaqueInst, llvm::sandboxir::BasicBlock, llvm::sandboxir::Function, and llvm::sandboxir::User.
|
friend |
Definition at line 175 of file SandboxIR.h.
|
friend |
Definition at line 184 of file SandboxIR.h.
|
friend |
Definition at line 178 of file SandboxIR.h.
|
friend |
Definition at line 281 of file SandboxIR.h.
|
friend |
Definition at line 177 of file SandboxIR.h.
Referenced by llvm::sandboxir::User::getOperandUseDefault(), use_begin(), use_end(), user_begin(), and user_end().
|
friend |
Definition at line 176 of file SandboxIR.h.
|
protected |
All values point to the context.
Definition at line 181 of file SandboxIR.h.
Referenced by llvm::sandboxir::BasicBlock::begin(), llvm::sandboxir::Function::begin(), llvm::sandboxir::LoadInst::create(), llvm::sandboxir::BasicBlock::dump(), llvm::sandboxir::Function::dump(), llvm::sandboxir::BasicBlock::end(), llvm::sandboxir::Function::end(), llvm::sandboxir::Instruction::eraseFromParent(), llvm::sandboxir::Function::getArg(), getContext(), llvm::sandboxir::BasicBlock::getContext(), llvm::sandboxir::Instruction::getIterator(), llvm::sandboxir::Instruction::getNextNode(), llvm::sandboxir::User::getOperandUseDefault(), llvm::sandboxir::Instruction::getParent(), llvm::sandboxir::BasicBlock::getParent(), llvm::sandboxir::LoadInst::getPointerOperand(), llvm::sandboxir::BasicBlock::getTerminator(), llvm::sandboxir::Instruction::moveBefore(), llvm::sandboxir::Instruction::removeFromParent(), replaceAllUsesWith(), llvm::sandboxir::User::replaceUsesOfWith(), replaceUsesWithIf(), llvm::sandboxir::User::setOperand(), use_begin(), use_end(), user_begin(), user_end(), Value(), and llvm::sandboxir::User::verifyUserOfLLVMUse().
|
protected |
For isa/dyn_cast.
Definition at line 164 of file SandboxIR.h.
Referenced by dumpCommonHeader(), dumpCommonSuffix(), and getSubclassID().
|
protected |
A unique ID used for forming the name (used for debugging).
Definition at line 167 of file SandboxIR.h.
|
protected |
The LLVM Value that corresponds to this SandboxIR Value.
NOTE: Some sandboxir Instructions, like Packs, may include more than one value and in these cases Val
points to the last instruction in program order.
Definition at line 173 of file SandboxIR.h.
Referenced by llvm::sandboxir::Function::arg_empty(), llvm::sandboxir::Function::arg_size(), llvm::sandboxir::BasicBlock::back(), llvm::sandboxir::BasicBlock::begin(), llvm::sandboxir::Function::begin(), clearValue(), llvm::sandboxir::LoadInst::create(), llvm::sandboxir::BasicBlock::dump(), llvm::sandboxir::Function::dump(), dumpCommonFooter(), dumpCommonPrefix(), llvm::sandboxir::Function::dumpNameAndArgs(), llvm::sandboxir::BasicBlock::end(), llvm::sandboxir::Function::end(), llvm::sandboxir::BasicBlock::front(), llvm::sandboxir::LoadInst::getAlign(), llvm::sandboxir::Function::getArg(), llvm::sandboxir::Instruction::getIterator(), getName(), llvm::sandboxir::Instruction::getNextNode(), llvm::sandboxir::User::getNumOperands(), getNumUses(), llvm::sandboxir::User::getOperandUseDefault(), llvm::sandboxir::Instruction::getParent(), llvm::sandboxir::BasicBlock::getParent(), llvm::sandboxir::LoadInst::getPointerOperand(), llvm::sandboxir::BasicBlock::getTerminator(), llvm::sandboxir::Instruction::getTopmostLLVMInstruction(), getType(), llvm::sandboxir::Instruction::insertInto(), llvm::sandboxir::LoadInst::isSimple(), llvm::sandboxir::LoadInst::isUnordered(), llvm::sandboxir::Instruction::moveBefore(), llvm::sandboxir::User::op_begin(), llvm::sandboxir::User::op_end(), printAsOperandCommon(), replaceAllUsesWith(), llvm::sandboxir::User::replaceUsesOfWith(), replaceUsesWithIf(), llvm::sandboxir::User::setOperand(), use_begin(), user_begin(), llvm::sandboxir::Argument::verify(), llvm::sandboxir::Constant::verify(), llvm::sandboxir::LoadInst::verify(), llvm::sandboxir::BasicBlock::verify(), llvm::sandboxir::Function::verify(), and llvm::sandboxir::User::verify().