Polly 19.0.0git
Public Member Functions | Private Attributes | Friends | List of all members
polly::VirtualInstruction Class Referencefinal

This class represents a "virtual instruction", an instruction in a ScopStmt, effectively a ScopStmt/Instruction-pair. More...

#include <VirtualInstruction.h>

Public Member Functions

 VirtualInstruction ()
 
 VirtualInstruction (ScopStmt *Stmt, Instruction *Inst)
 Create a new virtual instruction of an instruction Inst in Stmt.
 
VirtualOperandIterator operand_begin () const
 
VirtualOperandIterator operand_end () const
 
llvm::iterator_range< VirtualOperandIteratoroperands () const
 Returns a list of virtual operands.
 
ScopgetScop () const
 Return the SCoP everything is contained in.
 
ScopStmtgetStmt () const
 Return the ScopStmt this virtual instruction is in.
 
Instruction * getInstruction () const
 Return the instruction in the statement.
 
void print (raw_ostream &OS, bool Reproducible=true) const
 Print a description of this object.
 
void dump () const
 

Private Attributes

ScopStmtStmt = nullptr
 The statement this virtual instruction is in.
 
Instruction * Inst = nullptr
 The instruction of a statement.
 

Friends

class VirtualOperandIterator
 
struct llvm::DenseMapInfo< VirtualInstruction >
 

Detailed Description

This class represents a "virtual instruction", an instruction in a ScopStmt, effectively a ScopStmt/Instruction-pair.

An instructions can be moved between statements (e.g. to avoid a scalar dependency) and even can be contained in multiple statements (for instance, to recompute a value instead of transferring it), hence 'virtual'. This class is required to represent such instructions that are not in their 'physical' location anymore.

A statement can currently not contain the same instructions multiple times (that is, from different loop iterations). Therefore, a ScopStmt/Instruction-pair uniquely identifies a virtual instructions. ScopStmt::getInstruction() can contain the same instruction multiple times, but they necessarily compute the same value.

Definition at line 231 of file VirtualInstruction.h.

Constructor & Destructor Documentation

◆ VirtualInstruction() [1/2]

polly::VirtualInstruction::VirtualInstruction ( )
inline

Definition at line 243 of file VirtualInstruction.h.

◆ VirtualInstruction() [2/2]

polly::VirtualInstruction::VirtualInstruction ( ScopStmt Stmt,
Instruction *  Inst 
)
inline

Create a new virtual instruction of an instruction Inst in Stmt.

Definition at line 246 of file VirtualInstruction.h.

References assert, Inst, and Stmt.

Member Function Documentation

◆ dump()

LLVM_DUMP_METHOD void VirtualInstruction::dump ( ) const

Definition at line 165 of file VirtualInstruction.cpp.

References print().

◆ getInstruction()

Instruction * polly::VirtualInstruction::getInstruction ( ) const
inline

◆ getScop()

Scop * polly::VirtualInstruction::getScop ( ) const
inline

Return the SCoP everything is contained in.

Definition at line 268 of file VirtualInstruction.h.

References polly::ScopStmt::getParent(), and Stmt.

◆ getStmt()

ScopStmt * polly::VirtualInstruction::getStmt ( ) const
inline

◆ operand_begin()

VirtualOperandIterator polly::VirtualInstruction::operand_begin ( ) const
inline

Definition at line 251 of file VirtualInstruction.h.

References Inst, Stmt, and VirtualOperandIterator.

Referenced by operands().

◆ operand_end()

VirtualOperandIterator polly::VirtualInstruction::operand_end ( ) const
inline

Definition at line 255 of file VirtualInstruction.h.

References Inst, Stmt, and VirtualOperandIterator.

Referenced by operands().

◆ operands()

llvm::iterator_range< VirtualOperandIterator > polly::VirtualInstruction::operands ( ) const
inline

Returns a list of virtual operands.

Virtual operands, like virtual instructions, need to encode the ScopStmt they are in.

Definition at line 263 of file VirtualInstruction.h.

References operand_begin(), and operand_end().

Referenced by walkReachable().

◆ print()

void VirtualInstruction::print ( raw_ostream &  OS,
bool  Reproducible = true 
) const

Print a description of this object.

Parameters
OSStream to print to.
ReproducibleIf true, ensures that the output is stable between runs and is suitable for checks 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 154 of file VirtualInstruction.cpp.

References polly::ScopStmt::getBaseName(), Inst, and Stmt.

Referenced by dump().

Friends And Related Function Documentation

◆ llvm::DenseMapInfo< VirtualInstruction >

friend struct llvm::DenseMapInfo< VirtualInstruction >
friend

Definition at line 232 of file VirtualInstruction.h.

◆ VirtualOperandIterator

friend class VirtualOperandIterator
friend

Definition at line 232 of file VirtualInstruction.h.

Referenced by operand_begin(), and operand_end().

Member Data Documentation

◆ Inst

Instruction* polly::VirtualInstruction::Inst = nullptr
private

◆ Stmt

ScopStmt* polly::VirtualInstruction::Stmt = nullptr
private

The documentation for this class was generated from the following files: