Polly 20.0.0git
|
Determine the nature of a value's use within a statement. More...
#include <VirtualInstruction.h>
Public Types | |
enum | UseKind { Constant , Block , Synthesizable , Hoisted , ReadOnly , Intra , Inter } |
The different types of uses. More... | |
Public Member Functions | |
bool | isConstant () const |
bool | isBlock () const |
bool | isSynthesizable () const |
bool | isHoisted () const |
bool | isReadOnly () const |
bool | isIntra () const |
bool | isInter () const |
ScopStmt * | getUser () const |
Return user statement. | |
llvm::Value * | getValue () const |
Return the used value. | |
UseKind | getKind () const |
Return the type of use. | |
const SCEV * | getScevExpr () const |
Return the ScalarEvolution representation of Val . | |
MemoryAccess * | getMemoryAccess () const |
Return the MemoryAccess that makes the value available in this statement, if any. | |
void | print (raw_ostream &OS, bool Reproducible=true) const |
Print a description of this object. | |
void | dump () const |
Static Public Member Functions | |
static VirtualUse | create (Scop *S, const Use &U, LoopInfo *LI, bool Virtual) |
Get a VirtualUse for an llvm::Use. | |
static VirtualUse | create (Scop *S, ScopStmt *UserStmt, Loop *UserScope, Value *Val, bool Virtual) |
Get a VirtualUse for uses within statements. | |
static VirtualUse | create (ScopStmt *UserStmt, Loop *UserScope, Value *Val, bool Virtual) |
Private Member Functions | |
VirtualUse (ScopStmt *User, Value *Val, UseKind Kind, const SCEV *ScevExpr, MemoryAccess *InputMA) | |
Private Attributes | |
ScopStmt * | User |
The statement where a value is used. | |
Value * | Val |
The value that is used. | |
UseKind | Kind |
The type of value use. | |
const SCEV * | ScevExpr |
The value represented as llvm::SCEV expression. | |
MemoryAccess * | InputMA |
If this is an inter-statement (or read-only) use, contains the MemoryAccess that makes the value available in this statement. | |
Determine the nature of a value's use within a statement.
These are not always representable by llvm::Use. For instance, scalar write MemoryAccesses do use a value, but are not associated with an instruction's argument.
Despite its name it is not tied to virtual instructions (although it works fine with them), but to promote consistent handling of values used in statements.
Definition at line 31 of file VirtualInstruction.h.
The different types of uses.
Handling usually differentiates a lot between these; one can use a switch to handle each case (and get warned by the compiler if one is not handled).
Enumerator | |
---|---|
Constant | |
Block | |
Synthesizable | |
Hoisted | |
ReadOnly | |
Intra | |
Inter |
Definition at line 36 of file VirtualInstruction.h.
|
inlineprivate |
Definition at line 85 of file VirtualInstruction.h.
|
static |
Get a VirtualUse for an llvm::Use.
S | The Scop object. |
U | The llvm::Use the get information for. |
LI | The LoopInfo analysis. Needed to determine whether the value is synthesizable. |
Virtual | Whether to ignore existing MemoryAccess. |
U
. Definition at line 19 of file VirtualInstruction.cpp.
References assert, create(), polly::ScopStmt::getEntryBlock(), polly::MemoryAccess::getStatement(), polly::getUseBlock(), Inter, Intra, and polly::PHI.
Referenced by create(), polly::ScopBuilder::ensureValueRead(), findReferencesByUse(), polly::BlockGenerator::getNewValue(), polly::ZoneAlgorithm::makeValInst(), polly::VirtualOperandIterator::operator*(), verifyUse(), verifyUses(), and walkReachable().
|
static |
Get a VirtualUse for uses within statements.
It is assumed that the user is not a PHINode. Such uses are always VirtualUse::Inter unless in a regions statement.
S | The Scop object. |
UserStmt | The statement in which Val is used. Can be nullptr, in which case it assumed that the statement has been removed, which is only possible if no instruction in it had side-effects or computes a value used by another statement. |
UserScope | Loop scope in which the value is used. Needed to determine whether the value is synthesizable. |
Val | The value being used. |
Virtual | Whether to use (and prioritize over instruction location) information about MemoryAccesses. |
Val's
use in UserStmt
. Definition at line 52 of file VirtualInstruction.cpp.
References assert, Block, polly::canSynthesize(), Constant, polly::ScopStmt::getParent(), Hoisted, InputMA, Inter, Intra, polly::ScopStmt::lookupValueReadOf(), ReadOnly, ScevExpr, Synthesizable, and Val.
|
inlinestatic |
Definition at line 124 of file VirtualInstruction.h.
References create(), polly::ScopStmt::getParent(), and Val.
LLVM_DUMP_METHOD void VirtualUse::dump | ( | ) | const |
Definition at line 148 of file VirtualInstruction.cpp.
References print().
|
inline |
Return the type of use.
Definition at line 144 of file VirtualInstruction.h.
References Kind.
Referenced by findReferencesByUse().
|
inline |
Return the MemoryAccess that makes the value available in this statement, if any.
Definition at line 151 of file VirtualInstruction.h.
References InputMA.
|
inline |
Return the ScalarEvolution representation of Val
.
Definition at line 147 of file VirtualInstruction.h.
References ScevExpr.
Referenced by findReferencesByUse().
|
inline |
|
inline |
|
inline |
Definition at line 130 of file VirtualInstruction.h.
References Block.
|
inline |
Definition at line 129 of file VirtualInstruction.h.
References Constant.
|
inline |
Definition at line 132 of file VirtualInstruction.h.
References Hoisted.
|
inline |
Definition at line 135 of file VirtualInstruction.h.
References Inter.
|
inline |
Definition at line 134 of file VirtualInstruction.h.
References Intra.
|
inline |
Definition at line 133 of file VirtualInstruction.h.
References ReadOnly.
|
inline |
Definition at line 131 of file VirtualInstruction.h.
References Synthesizable.
void VirtualUse::print | ( | raw_ostream & | OS, |
bool | Reproducible = true |
||
) | const |
Print a description of this object.
OS | Stream to print to. |
Reproducible | If true, ensures that the output is stable between runs and is suitable to check in regression tests. This excludes printing e.g. pointer values. If false, the output should not be used for regression tests, but may contain more information useful in debugger sessions. |
Definition at line 106 of file VirtualInstruction.cpp.
References Block, Constant, polly::ScopStmt::getBaseName(), Hoisted, InputMA, Inter, Intra, ReadOnly, ScevExpr, Synthesizable, User, and Val.
Referenced by dump().
|
private |
If this is an inter-statement (or read-only) use, contains the MemoryAccess that makes the value available in this statement.
In case of intra-statement uses, can contain a MemoryKind::Array access. In all other cases, it is a nullptr.
Definition at line 83 of file VirtualInstruction.h.
Referenced by create(), getMemoryAccess(), and print().
|
private |
|
private |
The value represented as llvm::SCEV expression.
Definition at line 77 of file VirtualInstruction.h.
Referenced by create(), getScevExpr(), and print().
|
private |
The statement where a value is used.
Definition at line 68 of file VirtualInstruction.h.
|
private |
The value that is used.
Definition at line 71 of file VirtualInstruction.h.
Referenced by create(), getValue(), and print().