14#ifndef POLLY_SUPPORT_VIRTUALINSTRUCTION_H
15#define POLLY_SUPPORT_VIRTUALINSTRUCTION_H
122 Value *
Val,
bool Virtual);
162 void print(raw_ostream &OS,
bool Reproducible =
true)
const;
164#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
191 return this->U == that.
U;
196 return this->U != that.
U;
263 llvm::iterator_range<VirtualOperandIterator>
operands()
const {
285 void print(raw_ostream &OS,
bool Reproducible =
true)
const;
287#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
308 DenseSet<VirtualInstruction> &UsedInsts,
309 DenseSet<MemoryAccess *> &UsedAccs,
310 ScopStmt *OnlyLocal =
nullptr);
315template <>
struct DenseMapInfo<
polly::VirtualInstruction> {
319 return DenseMapInfo<polly::ScopStmt *>::isEqual(LHS.
getStmt(),
327 TombstoneKey.
Stmt = DenseMapInfo<polly::ScopStmt *>::getTombstoneKey();
328 TombstoneKey.
Inst = DenseMapInfo<Instruction *>::getTombstoneKey();
334 EmptyKey.
Stmt = DenseMapInfo<polly::ScopStmt *>::getEmptyKey();
335 EmptyKey.
Inst = DenseMapInfo<Instruction *>::getEmptyKey();
340 return DenseMapInfo<std::pair<polly::ScopStmt *, Instruction *>>::
Represent memory accesses in statements.
Loop * getSurroundingLoop() const
Return the closest innermost loop that contains this statement, but is not contained in it.
This class represents a "virtual instruction", an instruction in a ScopStmt, effectively a ScopStmt/I...
VirtualOperandIterator operand_begin() const
ScopStmt * getStmt() const
Return the ScopStmt this virtual instruction is in.
Instruction * Inst
The instruction of a statement.
llvm::iterator_range< VirtualOperandIterator > operands() const
Returns a list of virtual operands.
Scop * getScop() const
Return the SCoP everything is contained in.
ScopStmt * Stmt
The statement this virtual instruction is in.
VirtualInstruction(ScopStmt *Stmt, Instruction *Inst)
Create a new virtual instruction of an instruction Inst in Stmt.
friend class VirtualOperandIterator
VirtualOperandIterator operand_end() const
void print(raw_ostream &OS, bool Reproducible=true) const
Print a description of this object.
Instruction * getInstruction() const
Return the instruction in the statement.
An iterator for virtual operands.
std::forward_iterator_tag iterator_category
VirtualUse operator*() const
VirtualOperandIterator(ScopStmt *User, User::op_iterator U)
bool operator!=(const Self &that) const
bool operator==(const Self &that) const
std::ptrdiff_t difference_type
Determine the nature of a value's use within a statement.
ScopStmt * User
The statement where a value is used.
MemoryAccess * getMemoryAccess() const
Return the MemoryAccess that makes the value available in this statement, if any.
const SCEV * getScevExpr() const
Return the ScalarEvolution representation of Val.
static VirtualUse create(Scop *S, const Use &U, LoopInfo *LI, bool Virtual)
Get a VirtualUse for an llvm::Use.
static VirtualUse create(ScopStmt *UserStmt, Loop *UserScope, Value *Val, bool Virtual)
UseKind
The different types of uses.
const SCEV * ScevExpr
The value represented as llvm::SCEV expression.
VirtualUse(ScopStmt *User, Value *Val, UseKind Kind, const SCEV *ScevExpr, MemoryAccess *InputMA)
ScopStmt * getUser() const
Return user statement.
Value * Val
The value that is used.
bool isSynthesizable() const
UseKind getKind() const
Return the type of use.
void print(raw_ostream &OS, bool Reproducible=true) const
Print a description of this object.
MemoryAccess * InputMA
If this is an inter-statement (or read-only) use, contains the MemoryAccess that makes the value avai...
UseKind Kind
The type of value use.
llvm::Value * getValue() const
Return the used value.
This file contains the declaration of the PolyhedralInfo class, which will provide an interface to ex...
static bool operator==(VirtualInstruction LHS, VirtualInstruction RHS)
@ Value
MemoryKind::Value: Models an llvm::Value.
void markReachable(Scop *S, LoopInfo *LI, DenseSet< VirtualInstruction > &UsedInsts, DenseSet< MemoryAccess * > &UsedAccs, ScopStmt *OnlyLocal=nullptr)
Find all reachable instructions and accesses.
static polly::VirtualInstruction getTombstoneKey()
static bool isEqual(polly::VirtualInstruction LHS, polly::VirtualInstruction RHS)
static unsigned getHashValue(polly::VirtualInstruction Val)
static polly::VirtualInstruction getEmptyKey()