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

Statement of the Scop. More...

#include <ScopInfo.h>

Public Types

using iterator = MemoryAccessVec::iterator
 
using const_iterator = MemoryAccessVec::const_iterator
 

Public Member Functions

 ScopStmt (Scop &parent, BasicBlock &bb, StringRef Name, Loop *SurroundingLoop, std::vector< Instruction * > Instructions)
 Create the ScopStmt from a BasicBlock.
 
 ScopStmt (Scop &parent, Region &R, StringRef Name, Loop *SurroundingLoop, std::vector< Instruction * > EntryBlockInstructions)
 Create an overapproximating ScopStmt for the region R.
 
 ScopStmt (Scop &parent, isl::map SourceRel, isl::map TargetRel, isl::set Domain)
 Create a copy statement.
 
 ScopStmt (const ScopStmt &)=delete
 
const ScopStmtoperator= (const ScopStmt &)=delete
 
 ~ScopStmt ()
 
isl::ctx getIslCtx () const
 Get an isl_ctx pointer.
 
isl::set getDomain () const
 Get the iteration domain of this ScopStmt.
 
isl::space getDomainSpace () const
 Get the space of the iteration domain.
 
isl::id getDomainId () const
 Get the id of the iteration domain space.
 
std::string getDomainStr () const
 Get an isl string representing this domain.
 
isl::map getSchedule () const
 Get the schedule function of this ScopStmt.
 
std::string getScheduleStr () const
 Get an isl string representing this schedule.
 
isl::set getInvalidDomain () const
 Get the invalid domain for this statement.
 
isl::set getInvalidContext () const
 Get the invalid context for this statement.
 
void setInvalidDomain (isl::set ID)
 Set the invalid context for this statement to ID.
 
BasicBlock * getBasicBlock () const
 Get the BasicBlock represented by this ScopStmt (if any).
 
bool isBlockStmt () const
 Return true if this statement represents a single basic block.
 
bool isCopyStmt () const
 Return true if this is a copy statement.
 
Region * getRegion () const
 Get the region represented by this ScopStmt (if any).
 
bool isRegionStmt () const
 Return true if this statement represents a whole region.
 
BasicBlock * getEntryBlock () const
 Return a BasicBlock from this statement.
 
bool contains (const Loop *L) const
 Return whether L is boxed within this statement.
 
bool represents (BasicBlock *BB) const
 Return whether this statement represents BB.
 
bool contains (Instruction *Inst) const
 Return whether this statement contains Inst.
 
Loop * getSurroundingLoop () const
 Return the closest innermost loop that contains this statement, but is not contained in it.
 
bool isEmpty () const
 Return true if this statement does not contain any accesses.
 
const MemoryAccessListlookupArrayAccessesFor (const Instruction *Inst) const
 Find all array accesses for Inst.
 
MemoryAccessgetArrayAccessOrNULLFor (const Instruction *Inst) const
 Return the only array access for Inst, if existing.
 
MemoryAccessgetArrayAccessFor (const Instruction *Inst) const
 Return the only array access for Inst.
 
MemoryAccesslookupValueWriteOf (Instruction *Inst) const
 Return the MemoryAccess that writes the value of an instruction defined in this statement, or nullptr if not existing, respectively not yet added.
 
MemoryAccesslookupValueReadOf (Value *Inst) const
 Return the MemoryAccess that reloads a value, or nullptr if not existing, respectively not yet added.
 
MemoryAccesslookupPHIReadOf (PHINode *PHI) const
 Return the MemoryAccess that loads a PHINode value, or nullptr if not existing, respectively not yet added.
 
MemoryAccesslookupPHIWriteOf (PHINode *PHI) const
 Return the PHI write MemoryAccess for the incoming values from any basic block in this ScopStmt, or nullptr if not existing, respectively not yet added.
 
MemoryAccesslookupInputAccessOf (Value *Val) const
 Return the input access of the value, or null if no such MemoryAccess exists.
 
void addAccess (MemoryAccess *Access, bool Preprend=false)
 Add Access to this statement's list of accesses.
 
void removeMemoryAccess (MemoryAccess *MA)
 Remove a MemoryAccess from this statement.
 
void removeSingleMemoryAccess (MemoryAccess *MA, bool AfterHoisting=true)
 Remove MA from this statement.
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
size_t size () const
 
unsigned getNumIterators () const
 
ScopgetParent ()
 
const ScopgetParent () const
 
const std::vector< Instruction * > & getInstructions () const
 
void setInstructions (ArrayRef< Instruction * > Range)
 Set the list of instructions for this statement.
 
std::vector< Instruction * >::const_iterator insts_begin () const
 
std::vector< Instruction * >::const_iterator insts_end () const
 
iterator_range< std::vector< Instruction * >::const_iteratorinsts () const
 The range of instructions in this statement.
 
void prependInstruction (Instruction *Inst)
 Insert an instruction before all other instructions in this statement.
 
const char * getBaseName () const
 
void setAstBuild (isl::ast_build B)
 Set the isl AST build.
 
isl::ast_build getAstBuild () const
 Get the isl AST build.
 
void restrictDomain (isl::set NewDomain)
 Restrict the domain of the statement.
 
Loop * getLoopForDimension (unsigned Dimension) const
 Get the loop for a dimension.
 
void realignParams ()
 Align the parameters in the statement to the scop context.
 
void print (raw_ostream &OS, bool PrintInstructions) const
 Print the ScopStmt.
 
void printInstructions (raw_ostream &OS) const
 Print the instructions in ScopStmt.
 
MemoryAccessensureValueRead (Value *V)
 Check whether there is a value read access for V in this statement, and if not, create one.
 
void dump () const
 Print the ScopStmt to stderr.
 

Private Types

using MemoryAccessVec = llvm::SmallVector< MemoryAccess *, 8 >
 The memory accesses of this statement.
 

Private Member Functions

void removeAccessData (MemoryAccess *MA)
 Remove MA from dictionaries pointing to them.
 

Private Attributes

ScopParent
 Polyhedral description.
 
isl::set InvalidDomain
 The domain under which this statement is not modeled precisely.
 
isl::set Domain
 The iteration domain describes the set of iterations for which this statement is executed.
 
MemoryAccessVec MemAccs
 
DenseMap< const Instruction *, MemoryAccessListInstructionToAccess
 Mapping from instructions to (scalar) memory accesses.
 
DenseMap< Value *, MemoryAccess * > ValueReads
 The set of values defined elsewhere required in this ScopStmt and their MemoryKind::Value READ MemoryAccesses.
 
DenseMap< Instruction *, MemoryAccess * > ValueWrites
 The set of values defined in this ScopStmt that are required elsewhere, mapped to their MemoryKind::Value WRITE MemoryAccesses.
 
DenseMap< PHINode *, MemoryAccess * > PHIWrites
 Map from PHI nodes to its incoming value when coming from this statement.
 
DenseMap< PHINode *, MemoryAccess * > PHIReads
 Map from PHI nodes to its read access in this statement.
 
BasicBlock * BB = nullptr
 A SCoP statement represents either a basic block (affine/precise case) or a whole region (non-affine case).
 
Region * R = nullptr
 The region represented by this statement (in the non-affine case).
 
isl::ast_build Build
 }
 
SmallVector< Loop *, 4 > NestLoops
 
std::string BaseName
 
Loop * SurroundingLoop
 The closest loop that contains this statement.
 
std::vector< Instruction * > Instructions
 Vector for Instructions in this statement.
 

Friends

class ScopBuilder
 

Detailed Description

Statement of the Scop.

A Scop statement represents an instruction in the Scop.

It is further described by its iteration domain, its schedule and its data accesses. At the moment every statement represents a single basic block of LLVM-IR.

Definition at line 1138 of file ScopInfo.h.

Member Typedef Documentation

◆ const_iterator

using polly::ScopStmt::const_iterator = MemoryAccessVec::const_iterator

Definition at line 1516 of file ScopInfo.h.

◆ iterator

using polly::ScopStmt::iterator = MemoryAccessVec::iterator

Definition at line 1515 of file ScopInfo.h.

◆ MemoryAccessVec

using polly::ScopStmt::MemoryAccessVec = llvm::SmallVector<MemoryAccess *, 8>
private

The memory accesses of this statement.

The only side effects of a statement are its memory accesses.

Definition at line 1209 of file ScopInfo.h.

Constructor & Destructor Documentation

◆ ScopStmt() [1/4]

ScopStmt::ScopStmt ( Scop parent,
BasicBlock &  bb,
StringRef  Name,
Loop *  SurroundingLoop,
std::vector< Instruction * >  Instructions 
)

Create the ScopStmt from a BasicBlock.

Definition at line 1178 of file ScopInfo.cpp.

◆ ScopStmt() [2/4]

ScopStmt::ScopStmt ( Scop parent,
Region &  R,
StringRef  Name,
Loop *  SurroundingLoop,
std::vector< Instruction * >  EntryBlockInstructions 
)

Create an overapproximating ScopStmt for the region R.

Parameters
EntryBlockInstructionsThe list of instructions that belong to the entry block of the region statement. Instructions are only tracked for entry blocks for now. We currently do not allow to modify the instructions of blocks later in the region statement.

Definition at line 1172 of file ScopInfo.cpp.

◆ ScopStmt() [3/4]

ScopStmt::ScopStmt ( Scop parent,
isl::map  SourceRel,
isl::map  TargetRel,
isl::set  Domain 
)

Create a copy statement.

Parameters
StmtThe parent statement.
SourceRelThe source location.
TargetRelThe target location.
DomainThe original domain under which the copy statement would be executed.

Definition at line 1185 of file ScopInfo.cpp.

References addAccess(), polly::Scop::addAccessFunction(), isl::id::alloc(), BaseName, Domain, getBaseName(), polly::Scop::getCopyStmtsNum(), polly::getIslCompatibleName(), getIslCtx(), isl::in, polly::MemoryAccess::MUST_WRITE, polly::MemoryAccess::READ, isl::map::set_tuple_id(), and isl::set::set_tuple_id().

◆ ScopStmt() [4/4]

polly::ScopStmt::ScopStmt ( const ScopStmt )
delete

◆ ~ScopStmt()

ScopStmt::~ScopStmt ( )
default

Member Function Documentation

◆ addAccess()

void ScopStmt::addAccess ( MemoryAccess Access,
bool  Preprend = false 
)

Add Access to this statement's list of accesses.

Parameters
AccessThe access to add.
PrependIf true, will add Access before all other instructions (instead of appending it).

Definition at line 1119 of file ScopInfo.cpp.

References assert, polly::MemoryAccess::getAccessInstruction(), polly::MemoryAccess::getAccessValue(), InstructionToAccess, polly::MemoryAccess::isAnyPHIKind(), polly::MemoryAccess::isArrayKind(), polly::MemoryAccess::isRead(), polly::MemoryAccess::isValueKind(), polly::MemoryAccess::isWrite(), MemAccs, polly::PHI, PHIReads, PHIWrites, polly::Value, ValueReads, and ValueWrites.

Referenced by polly::ScopBuilder::addMemoryAccess(), ensureValueRead(), and ScopStmt().

◆ begin() [1/2]

iterator polly::ScopStmt::begin ( )
inline

Definition at line 1518 of file ScopInfo.h.

References MemAccs.

Referenced by polly::IslNodeBuilder::generateCopyStmt().

◆ begin() [2/2]

const_iterator polly::ScopStmt::begin ( ) const
inline

Definition at line 1520 of file ScopInfo.h.

References MemAccs.

◆ contains() [1/2]

bool polly::ScopStmt::contains ( const Loop *  L) const
inline

Return whether L is boxed within this statement.

Definition at line 1340 of file ScopInfo.h.

References getRegion(), and isBlockStmt().

Referenced by polly::ScopBuilder::buildAccessSingleDim().

◆ contains() [2/2]

bool polly::ScopStmt::contains ( Instruction *  Inst) const
inline

Return whether this statement contains Inst.

Definition at line 1358 of file ScopInfo.h.

References Instructions, isBlockStmt(), and represents().

◆ dump()

LLVM_DUMP_METHOD void ScopStmt::dump ( ) const

Print the ScopStmt to stderr.

Definition at line 1268 of file ScopInfo.cpp.

References print().

◆ end() [1/2]

iterator polly::ScopStmt::end ( )
inline

Definition at line 1519 of file ScopInfo.h.

References MemAccs.

◆ end() [2/2]

const_iterator polly::ScopStmt::end ( ) const
inline

Definition at line 1521 of file ScopInfo.h.

References MemAccs.

◆ ensureValueRead()

MemoryAccess * ScopStmt::ensureValueRead ( Value *  V)

Check whether there is a value read access for V in this statement, and if not, create one.

This allows to add MemoryAccesses after the initial creation of the Scop by ScopBuilder.

Returns
The already existing or newly created MemoryKind::Value READ MemoryAccess.
See also
ScopBuilder::ensureValueRead(Value*,ScopStmt*)

Definition at line 1332 of file ScopInfo.cpp.

References addAccess(), polly::Scop::addAccessData(), polly::Scop::addAccessFunction(), polly::MemoryAccess::buildAccessRelation(), polly::Scop::getOrCreateScopArrayInfo(), lookupInputAccessOf(), Parent, polly::MemoryAccess::READ, and polly::Value.

◆ getArrayAccessFor()

MemoryAccess & polly::ScopStmt::getArrayAccessFor ( const Instruction *  Inst) const
inline

Return the only array access for Inst.

Parameters
InstThe instruction for which to look up the access.
Returns
The unique array memory access related to Inst.

Definition at line 1432 of file ScopInfo.h.

References assert, and getArrayAccessOrNULLFor().

Referenced by polly::ScopBuilder::collectCandidateReductionLoads(), polly::BlockGenerator::generateArrayStore(), and polly::BlockGenerator::generateLocationAccessed().

◆ getArrayAccessOrNULLFor()

MemoryAccess * polly::ScopStmt::getArrayAccessOrNULLFor ( const Instruction *  Inst) const
inline

Return the only array access for Inst, if existing.

Parameters
InstThe instruction for which to look up the access.
Returns
The unique array memory access related to Inst or nullptr if no array access exists

Definition at line 1409 of file ScopInfo.h.

References assert, and InstructionToAccess.

Referenced by polly::BlockGenerator::copyInstruction(), and getArrayAccessFor().

◆ getAstBuild()

isl::ast_build polly::ScopStmt::getAstBuild ( ) const
inline

Get the isl AST build.

Definition at line 1563 of file ScopInfo.h.

References Build.

Referenced by polly::BlockGenerator::buildContainsCondition(), and polly::BlockGenerator::generateBeginStmtTrace().

◆ getBaseName()

const char * ScopStmt::getBaseName ( ) const

◆ getBasicBlock()

BasicBlock * polly::ScopStmt::getBasicBlock ( ) const
inline

Get the BasicBlock represented by this ScopStmt (if any).

Returns
The BasicBlock represented by this ScopStmt, or null if the statement represents a region.

Definition at line 1316 of file ScopInfo.h.

References BB.

Referenced by polly::BlockGenerator::copyStmt(), findReferencesInStmt(), polly::BlockGenerator::generateScalarStores(), getEntryBlock(), polly::Scop::removeFromStmtMap(), and represents().

◆ getDomain()

isl::set ScopStmt::getDomain ( ) const

◆ getDomainId()

isl::id ScopStmt::getDomainId ( ) const

Get the id of the iteration domain space.

Returns
The id of the iteration domain space

Definition at line 1233 of file ScopInfo.cpp.

References Domain, and isl::set::get_tuple_id().

◆ getDomainSpace()

isl::space ScopStmt::getDomainSpace ( ) const

◆ getDomainStr()

std::string ScopStmt::getDomainStr ( ) const

Get an isl string representing this domain.

Definition at line 1205 of file ScopInfo.cpp.

References Domain.

Referenced by print().

◆ getEntryBlock()

BasicBlock * ScopStmt::getEntryBlock ( ) const

◆ getInstructions()

const std::vector< Instruction * > & polly::ScopStmt::getInstructions ( ) const
inline

◆ getInvalidContext()

isl::set polly::ScopStmt::getInvalidContext ( ) const
inline

Get the invalid context for this statement.

Definition at line 1307 of file ScopInfo.h.

References getInvalidDomain(), and isl::set::params().

Referenced by polly::ScopBuilder::addInvariantLoads().

◆ getInvalidDomain()

isl::set polly::ScopStmt::getInvalidDomain ( ) const
inline

Get the invalid domain for this statement.

Definition at line 1304 of file ScopInfo.h.

References InvalidDomain.

Referenced by polly::MemoryAccess::buildAccessRelation(), and getInvalidContext().

◆ getIslCtx()

isl::ctx ScopStmt::getIslCtx ( ) const

Get an isl_ctx pointer.

Definition at line 1227 of file ScopInfo.cpp.

References polly::Scop::getIslCtx(), and Parent.

Referenced by polly::MemoryAccess::createBasicAccessMap(), and ScopStmt().

◆ getLoopForDimension()

Loop * ScopStmt::getLoopForDimension ( unsigned  Dimension) const

Get the loop for a dimension.

Parameters
DimensionThe dimension of the induction variable
Returns
The loop at a certain dimension.

Definition at line 1223 of file ScopInfo.cpp.

References NestLoops.

Referenced by polly::IslNodeBuilder::createSubstitutions().

◆ getNumIterators()

unsigned ScopStmt::getNumIterators ( ) const

Definition at line 1219 of file ScopInfo.cpp.

References NestLoops.

Referenced by polly::MemoryAccess::buildAccessRelation(), and polly::Scop::getStatistics().

◆ getParent() [1/2]

Scop * polly::ScopStmt::getParent ( )
inline

◆ getParent() [2/2]

const Scop * polly::ScopStmt::getParent ( ) const
inline

Definition at line 1527 of file ScopInfo.h.

References Parent.

◆ getRegion()

Region * polly::ScopStmt::getRegion ( ) const
inline

◆ getSchedule()

isl::map ScopStmt::getSchedule ( ) const

Get the schedule function of this ScopStmt.

Returns
The schedule function of this ScopStmt, if it does not contain extension nodes, and nullptr, otherwise.

Definition at line 1096 of file ScopInfo.cpp.

References Domain, isl::map::from_aff(), getDomain(), getDomainSpace(), getParent(), polly::Scop::getSchedule(), isl::union_map::intersect_domain(), isl::set::is_empty(), and M().

Referenced by getScheduleStr().

◆ getScheduleStr()

std::string ScopStmt::getScheduleStr ( ) const

Get an isl string representing this schedule.

Returns
An isl string representing this schedule, if it does not contain extension nodes, and an empty string, otherwise.

Definition at line 1207 of file ScopInfo.cpp.

References getSchedule().

Referenced by print().

◆ getSurroundingLoop()

Loop * polly::ScopStmt::getSurroundingLoop ( ) const
inline

Return the closest innermost loop that contains this statement, but is not contained in it.

For block statement, this is just the loop that contains the block. Region statements can contain boxed loops, so getting the loop of one of the region's BBs might return such an inner loop. For instance, the region's entry could be a header of a loop, but the region might extend to BBs after the loop exit. Similarly, the region might only contain parts of the loop body and still include the loop header.

Most of the time the surrounding loop is the top element of NestLoops, except when it is empty. In that case it return the loop that the whole SCoP is contained in. That can be nullptr if there is no such loop.

Definition at line 1379 of file ScopInfo.h.

References assert, isCopyStmt(), and SurroundingLoop.

Referenced by polly::ScopBuilder::buildAccessMemIntrinsic(), polly::ScopBuilder::buildAccessMultiDimFixed(), polly::ScopBuilder::buildAccessSingleDim(), polly::ZoneAlgorithm::computeNormalizedPHIs(), polly::ScopBuilder::ensureValueRead(), polly::ZoneAlgorithm::getDefToTarget(), polly::ZoneAlgorithm::getWrittenValue(), polly::VirtualOperandIterator::operator*(), and walkReachable().

◆ insts()

iterator_range< std::vector< Instruction * >::const_iterator > polly::ScopStmt::insts ( ) const
inline

The range of instructions in this statement.

Definition at line 1548 of file ScopInfo.h.

References insts_begin(), and insts_end().

Referenced by polly::BlockGenerator::generateBeginStmtTrace().

◆ insts_begin()

std::vector< Instruction * >::const_iterator polly::ScopStmt::insts_begin ( ) const
inline

Definition at line 1539 of file ScopInfo.h.

References Instructions.

Referenced by insts().

◆ insts_end()

std::vector< Instruction * >::const_iterator polly::ScopStmt::insts_end ( ) const
inline

Definition at line 1543 of file ScopInfo.h.

References Instructions.

Referenced by insts().

◆ isBlockStmt()

bool polly::ScopStmt::isBlockStmt ( ) const
inline

◆ isCopyStmt()

bool polly::ScopStmt::isCopyStmt ( ) const
inline

Return true if this is a copy statement.

Definition at line 1322 of file ScopInfo.h.

References BB, and R.

Referenced by polly::IslNodeBuilder::createUser(), getSurroundingLoop(), and represents().

◆ isEmpty()

bool polly::ScopStmt::isEmpty ( ) const
inline

Return true if this statement does not contain any accesses.

Definition at line 1386 of file ScopInfo.h.

References MemAccs.

Referenced by polly::Scop::simplifySCoP().

◆ isRegionStmt()

bool polly::ScopStmt::isRegionStmt ( ) const
inline

◆ lookupArrayAccessesFor()

const MemoryAccessList * polly::ScopStmt::lookupArrayAccessesFor ( const Instruction *  Inst) const
inline

Find all array accesses for Inst.

Parameters
InstThe instruction accessing an array.
Returns
A list of array accesses (MemoryKind::Array) accessed by Inst. If there is no such access, it returns nullptr.

Definition at line 1395 of file ScopInfo.h.

References InstructionToAccess.

Referenced by walkReachable().

◆ lookupInputAccessOf()

MemoryAccess * polly::ScopStmt::lookupInputAccessOf ( Value *  Val) const
inline

Return the input access of the value, or null if no such MemoryAccess exists.

The input access is the MemoryAccess that makes an inter-statement value available in this statement by reading it at the start of this statement. This can be a MemoryKind::Value if defined in another statement or a MemoryKind::PHI if the value is a PHINode in this statement.

Definition at line 1475 of file ScopInfo.h.

References assert, lookupPHIReadOf(), and lookupValueReadOf().

Referenced by ensureValueRead().

◆ lookupPHIReadOf()

MemoryAccess * polly::ScopStmt::lookupPHIReadOf ( PHINode *  PHI) const
inline

Return the MemoryAccess that loads a PHINode value, or nullptr if not existing, respectively not yet added.

Definition at line 1456 of file ScopInfo.h.

References polly::PHI, and PHIReads.

Referenced by lookupInputAccessOf(), and walkReachable().

◆ lookupPHIWriteOf()

MemoryAccess * polly::ScopStmt::lookupPHIWriteOf ( PHINode *  PHI) const
inline

Return the PHI write MemoryAccess for the incoming values from any basic block in this ScopStmt, or nullptr if not existing, respectively not yet added.

Definition at line 1463 of file ScopInfo.h.

References assert, isBlockStmt(), polly::PHI, PHIWrites, and R.

Referenced by polly::ScopBuilder::ensurePHIWrite().

◆ lookupValueReadOf()

MemoryAccess * polly::ScopStmt::lookupValueReadOf ( Value *  Inst) const
inline

Return the MemoryAccess that reloads a value, or nullptr if not existing, respectively not yet added.

Definition at line 1450 of file ScopInfo.h.

References ValueReads.

Referenced by polly::VirtualUse::create(), polly::ScopBuilder::ensureValueRead(), and lookupInputAccessOf().

◆ lookupValueWriteOf()

MemoryAccess * polly::ScopStmt::lookupValueWriteOf ( Instruction *  Inst) const
inline

Return the MemoryAccess that writes the value of an instruction defined in this statement, or nullptr if not existing, respectively not yet added.

Definition at line 1442 of file ScopInfo.h.

References assert, BB, isRegionStmt(), R, and ValueWrites.

Referenced by polly::ScopBuilder::ensureValueWrite().

◆ operator=()

const ScopStmt & polly::ScopStmt::operator= ( const ScopStmt )
delete

◆ prependInstruction()

void polly::ScopStmt::prependInstruction ( Instruction *  Inst)
inline

Insert an instruction before all other instructions in this statement.

Definition at line 1553 of file ScopInfo.h.

References Instructions.

◆ print()

void ScopStmt::print ( raw_ostream &  OS,
bool  PrintInstructions 
) const

Print the ScopStmt.

Parameters
OSThe output stream the ScopStmt is printed to.
PrintInstructionsWhether to print the statement's instructions as well.

Definition at line 1244 of file ScopInfo.cpp.

References Domain, getBaseName(), getDomainStr(), getScheduleStr(), isl::set::is_null(), MemAccs, and printInstructions().

Referenced by dump(), and polly::Scop::printStatements().

◆ printInstructions()

void ScopStmt::printInstructions ( raw_ostream &  OS) const

Print the instructions in ScopStmt.

Definition at line 1235 of file ScopInfo.cpp.

References Instructions.

Referenced by print().

◆ realignParams()

void ScopStmt::realignParams ( )

Align the parameters in the statement to the scop context.

Definition at line 1154 of file ScopInfo.cpp.

References isl::set::align_params(), Ctx, Domain, polly::Scop::getContext(), isl::set::gist_params(), InvalidDomain, Parent, polly::MemoryAccess::realignParams(), and simplify.

Referenced by polly::Scop::realignParams().

◆ removeAccessData()

void ScopStmt::removeAccessData ( MemoryAccess MA)
private

◆ removeMemoryAccess()

void ScopStmt::removeMemoryAccess ( MemoryAccess MA)

Remove a MemoryAccess from this statement.

Note that scalar accesses that are caused by MA will be eliminated too.

Definition at line 1294 of file ScopInfo.cpp.

References polly::MemoryAccess::getAccessInstruction(), InstructionToAccess, MemAccs, Parent, polly::Scop::removeAccessData(), and removeAccessData().

◆ removeSingleMemoryAccess()

void ScopStmt::removeSingleMemoryAccess ( MemoryAccess MA,
bool  AfterHoisting = true 
)

Remove MA from this statement.

In contrast to removeMemoryAccess(), no other access will be eliminated.

Parameters
MAThe MemoryAccess to be removed.
AfterHoistingIf true, also remove from data access lists. These lists are filled during ScopBuilder::buildAccessRelations. Therefore, if this method is called before buildAccessRelations, false must be passed.

Definition at line 1314 of file ScopInfo.cpp.

References assert, polly::MemoryAccess::getAccessInstruction(), InstructionToAccess, MemAccs, Parent, polly::Scop::removeAccessData(), and removeAccessData().

◆ represents()

bool polly::ScopStmt::represents ( BasicBlock *  BB) const
inline

Return whether this statement represents BB.

Definition at line 1349 of file ScopInfo.h.

References BB, getBasicBlock(), getRegion(), isBlockStmt(), and isCopyStmt().

Referenced by polly::RegionGenerator::addOperandToPHI(), polly::ScopBuilder::buildAccessFunctions(), and contains().

◆ restrictDomain()

void ScopStmt::restrictDomain ( isl::set  NewDomain)

Restrict the domain of the statement.

Parameters
NewDomainThe new statement domain.

Definition at line 1113 of file ScopInfo.cpp.

References assert, Domain, and isl::set::is_subset().

Referenced by polly::Scop::restrictDomains().

◆ setAstBuild()

void polly::ScopStmt::setAstBuild ( isl::ast_build  B)
inline

Set the isl AST build.

Definition at line 1560 of file ScopInfo.h.

References B(), and Build.

Referenced by polly::IslNodeBuilder::createNewAccesses().

◆ setInstructions()

void polly::ScopStmt::setInstructions ( ArrayRef< Instruction * >  Range)
inline

Set the list of instructions for this statement.

It replaces the current list.

Definition at line 1535 of file ScopInfo.h.

References Instructions, and Range.

◆ setInvalidDomain()

void ScopStmt::setInvalidDomain ( isl::set  ID)

Set the invalid context for this statement to ID.

Definition at line 1211 of file ScopInfo.cpp.

References InvalidDomain.

Referenced by polly::ScopBuilder::buildScop().

◆ size()

size_t polly::ScopStmt::size ( ) const
inline

Definition at line 1522 of file ScopInfo.h.

References MemAccs.

Referenced by polly::IslNodeBuilder::generateCopyStmt(), and polly::MemoryAccess::MemoryAccess().

Friends And Related Function Documentation

◆ ScopBuilder

friend class ScopBuilder
friend

Definition at line 1139 of file ScopInfo.h.

Member Data Documentation

◆ BaseName

std::string polly::ScopStmt::BaseName
private

Definition at line 1258 of file ScopInfo.h.

Referenced by getBaseName(), and ScopStmt().

◆ BB

BasicBlock* polly::ScopStmt::BB = nullptr
private

A SCoP statement represents either a basic block (affine/precise case) or a whole region (non-affine case).

Only one of the following two members will therefore be set and indicate which kind of statement this is.

{ The BasicBlock represented by this statement (in the affine case).

Definition at line 1246 of file ScopInfo.h.

Referenced by getBasicBlock(), isBlockStmt(), isCopyStmt(), lookupValueWriteOf(), and represents().

◆ Build

isl::ast_build polly::ScopStmt::Build
private

}

The isl AST build for the new generated AST.

Definition at line 1254 of file ScopInfo.h.

Referenced by getAstBuild(), and setAstBuild().

◆ Domain

isl::set polly::ScopStmt::Domain
private

The iteration domain describes the set of iterations for which this statement is executed.

Example: for (i = 0; i < 100 + b; ++i) for (j = 0; j < i; ++j) S(i,j);

'S' is executed for different values of i and j. A vector of all induction variables around S (i, j) is called iteration vector. The domain describes the set of possible iteration vectors.

In this case it is:

Domain: 0 <= i <= 100 + b
        0 <= j <= i

A pair of statement and iteration vector (S, (5,3)) is called statement instance.

Definition at line 1204 of file ScopInfo.h.

Referenced by polly::ScopBuilder::buildDomain(), getDomain(), getDomainId(), getDomainSpace(), getDomainStr(), getSchedule(), print(), realignParams(), restrictDomain(), and ScopStmt().

◆ Instructions

std::vector<Instruction *> polly::ScopStmt::Instructions
private

Vector for Instructions in this statement.

Definition at line 1264 of file ScopInfo.h.

Referenced by contains(), getInstructions(), insts_begin(), insts_end(), prependInstruction(), printInstructions(), and setInstructions().

◆ InstructionToAccess

DenseMap<const Instruction *, MemoryAccessList> polly::ScopStmt::InstructionToAccess
private

Mapping from instructions to (scalar) memory accesses.

Definition at line 1213 of file ScopInfo.h.

Referenced by addAccess(), getArrayAccessOrNULLFor(), lookupArrayAccessesFor(), removeMemoryAccess(), and removeSingleMemoryAccess().

◆ InvalidDomain

isl::set polly::ScopStmt::InvalidDomain
private

The domain under which this statement is not modeled precisely.

The invalid domain for a statement describes all parameter combinations under which the statement looks to be executed but is in fact not because some assumption/restriction makes the statement/scop invalid.

Definition at line 1183 of file ScopInfo.h.

Referenced by getInvalidDomain(), realignParams(), and setInvalidDomain().

◆ MemAccs

MemoryAccessVec polly::ScopStmt::MemAccs
private

◆ NestLoops

SmallVector<Loop *, 4> polly::ScopStmt::NestLoops
private

◆ Parent

Scop& polly::ScopStmt::Parent
private

Polyhedral description.

The Scop containing this ScopStmt.

Definition at line 1176 of file ScopInfo.h.

Referenced by ensureValueRead(), getIslCtx(), getParent(), realignParams(), removeMemoryAccess(), and removeSingleMemoryAccess().

◆ PHIReads

DenseMap<PHINode *, MemoryAccess *> polly::ScopStmt::PHIReads
private

Map from PHI nodes to its read access in this statement.

Definition at line 1233 of file ScopInfo.h.

Referenced by addAccess(), lookupPHIReadOf(), and removeAccessData().

◆ PHIWrites

DenseMap<PHINode *, MemoryAccess *> polly::ScopStmt::PHIWrites
private

Map from PHI nodes to its incoming value when coming from this statement.

Non-affine subregions can have multiple exiting blocks that are incoming blocks of the PHI nodes. This map ensures that there is only one write operation for the complete subregion. A PHI selecting the relevant value will be inserted.

Definition at line 1230 of file ScopInfo.h.

Referenced by addAccess(), lookupPHIWriteOf(), and removeAccessData().

◆ R

Region* polly::ScopStmt::R = nullptr
private

The region represented by this statement (in the non-affine case).

Definition at line 1249 of file ScopInfo.h.

Referenced by getRegion(), isCopyStmt(), isRegionStmt(), lookupPHIWriteOf(), and lookupValueWriteOf().

◆ SurroundingLoop

Loop* polly::ScopStmt::SurroundingLoop
private

The closest loop that contains this statement.

Definition at line 1261 of file ScopInfo.h.

Referenced by getSurroundingLoop().

◆ ValueReads

DenseMap<Value *, MemoryAccess *> polly::ScopStmt::ValueReads
private

The set of values defined elsewhere required in this ScopStmt and their MemoryKind::Value READ MemoryAccesses.

Definition at line 1217 of file ScopInfo.h.

Referenced by addAccess(), lookupValueReadOf(), and removeAccessData().

◆ ValueWrites

DenseMap<Instruction *, MemoryAccess *> polly::ScopStmt::ValueWrites
private

The set of values defined in this ScopStmt that are required elsewhere, mapped to their MemoryKind::Value WRITE MemoryAccesses.

Definition at line 1221 of file ScopInfo.h.

Referenced by addAccess(), lookupValueWriteOf(), and removeAccessData().


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