Polly 20.0.0git
|
Statement of the Scop. More...
#include <ScopInfo.h>
Public Types | |
using | MemoryAccessVec = llvm::SmallVector< MemoryAccess *, 8 > |
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 ScopStmt & | operator= (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 MemoryAccessList * | lookupArrayAccessesFor (const Instruction *Inst) const |
Find all array accesses for Inst . | |
MemoryAccess * | getArrayAccessOrNULLFor (const Instruction *Inst) const |
Return the only array access for Inst , if existing. | |
MemoryAccess & | getArrayAccessFor (const Instruction *Inst) const |
Return the only array access for Inst . | |
MemoryAccess * | lookupValueWriteOf (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. | |
MemoryAccess * | lookupValueReadOf (Value *Inst) const |
Return the MemoryAccess that reloads a value, or nullptr if not existing, respectively not yet added. | |
MemoryAccess * | lookupPHIReadOf (PHINode *PHI) const |
Return the MemoryAccess that loads a PHINode value, or nullptr if not existing, respectively not yet added. | |
MemoryAccess * | lookupPHIWriteOf (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. | |
MemoryAccess * | lookupInputAccessOf (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 |
Scop * | getParent () |
const Scop * | getParent () 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_iterator > | insts () 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. | |
MemoryAccess * | ensureValueRead (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 Member Functions | |
void | removeAccessData (MemoryAccess *MA) |
Remove MA from dictionaries pointing to them. | |
Private Attributes | |
Scop & | Parent |
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 |
The memory accesses of this statement. | |
DenseMap< const Instruction *, MemoryAccessList > | InstructionToAccess |
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 |
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 1140 of file ScopInfo.h.
using polly::ScopStmt::const_iterator = MemoryAccessVec::const_iterator |
Definition at line 1518 of file ScopInfo.h.
using polly::ScopStmt::iterator = MemoryAccessVec::iterator |
Definition at line 1517 of file ScopInfo.h.
using polly::ScopStmt::MemoryAccessVec = llvm::SmallVector<MemoryAccess *, 8> |
Definition at line 1144 of file ScopInfo.h.
ScopStmt::ScopStmt | ( | Scop & | parent, |
BasicBlock & | bb, | ||
StringRef | Name, | ||
Loop * | SurroundingLoop, | ||
std::vector< Instruction * > | Instructions | ||
) |
Create the ScopStmt from a BasicBlock.
Definition at line 1186 of file ScopInfo.cpp.
ScopStmt::ScopStmt | ( | Scop & | parent, |
Region & | R, | ||
StringRef | Name, | ||
Loop * | SurroundingLoop, | ||
std::vector< Instruction * > | EntryBlockInstructions | ||
) |
Create an overapproximating ScopStmt for the region R
.
EntryBlockInstructions | The 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 1180 of file ScopInfo.cpp.
Create a copy statement.
Stmt | The parent statement. |
SourceRel | The source location. |
TargetRel | The target location. |
Domain | The original domain under which the copy statement would be executed. |
Definition at line 1193 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().
|
delete |
|
default |
void ScopStmt::addAccess | ( | MemoryAccess * | Access, |
bool | Preprend = false |
||
) |
Add Access
to this statement's list of accesses.
Access | The access to add. |
Prepend | If true, will add Access before all other instructions (instead of appending it). |
Definition at line 1127 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().
|
inline |
Definition at line 1520 of file ScopInfo.h.
References MemAccs.
Referenced by polly::IslNodeBuilder::generateCopyStmt().
|
inline |
Definition at line 1522 of file ScopInfo.h.
References MemAccs.
|
inline |
Return whether L
is boxed within this statement.
Definition at line 1342 of file ScopInfo.h.
References getRegion(), and isBlockStmt().
Referenced by polly::ScopBuilder::buildAccessSingleDim().
|
inline |
Return whether this statement contains Inst
.
Definition at line 1360 of file ScopInfo.h.
References Instructions, isBlockStmt(), and represents().
LLVM_DUMP_METHOD void ScopStmt::dump | ( | ) | const |
|
inline |
Definition at line 1521 of file ScopInfo.h.
References MemAccs.
|
inline |
Definition at line 1523 of file ScopInfo.h.
References MemAccs.
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.
Definition at line 1340 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.
|
inline |
Return the only array access for Inst
.
Inst | The instruction for which to look up the access. |
Definition at line 1434 of file ScopInfo.h.
References assert, and getArrayAccessOrNULLFor().
Referenced by polly::ScopBuilder::checkForReductions(), polly::BlockGenerator::generateArrayStore(), and polly::BlockGenerator::generateLocationAccessed().
|
inline |
Return the only array access for Inst
, if existing.
Inst | The instruction for which to look up the access. |
Definition at line 1411 of file ScopInfo.h.
References assert, and InstructionToAccess.
Referenced by polly::BlockGenerator::copyInstruction(), and getArrayAccessFor().
|
inline |
Get the isl AST build.
Definition at line 1565 of file ScopInfo.h.
References Build.
Referenced by polly::BlockGenerator::buildContainsCondition(), and polly::BlockGenerator::generateBeginStmtTrace().
const char * ScopStmt::getBaseName | ( | ) | const |
Definition at line 1229 of file ScopInfo.cpp.
References BaseName.
Referenced by polly::ScopBuilder::buildDomain(), cbPrintUser(), polly::BlockGenerator::generateBeginStmtTrace(), polly::MemoryAccess::MemoryAccess(), print(), polly::VirtualUse::print(), polly::VirtualInstruction::print(), and ScopStmt().
|
inline |
Get the BasicBlock represented by this ScopStmt (if any).
Definition at line 1318 of file ScopInfo.h.
References BB.
Referenced by polly::ScopBuilder::checkForReductions(), polly::BlockGenerator::copyStmt(), findReferencesInStmt(), polly::BlockGenerator::generateScalarStores(), getEntryBlock(), polly::Scop::removeFromStmtMap(), and represents().
isl::set ScopStmt::getDomain | ( | ) | const |
Get the iteration domain of this ScopStmt.
Definition at line 1237 of file ScopInfo.cpp.
References Domain.
Referenced by polly::ScopBuilder::addInvariantLoads(), polly::MemoryAccess::applyScheduleToAccessRelation(), polly::MemoryAccess::assumeNoOutOfBound(), polly::MemoryAccess::buildAccessRelation(), polly::BlockGenerator::buildContainsCondition(), polly::ScopBuilder::checkForReductions(), polly::ScopBuilder::collectSurroundingLoops(), polly::IslNodeBuilder::createNewAccesses(), polly::MemoryAccess::foldAccessRelation(), polly::BlockGenerator::generateBeginStmtTrace(), polly::BlockGenerator::generateConditionalExecution(), polly::BlockGenerator::generateScalarLoads(), getAccessDomain(), polly::ZoneAlgorithm::getDomainFor(), polly::Scop::getDomains(), polly::MemoryAccess::getPwAff(), getSchedule(), polly::Scop::getStatistics(), polly::MemoryAccess::isLatestPartialAccess(), polly::Scop::restrictDomains(), and polly::MemoryAccess::setNewAccessRelation().
isl::id ScopStmt::getDomainId | ( | ) | const |
Get the id of the iteration domain space.
Definition at line 1241 of file ScopInfo.cpp.
References Domain, and isl::set::get_tuple_id().
isl::space ScopStmt::getDomainSpace | ( | ) | const |
Get the space of the iteration domain.
Definition at line 1239 of file ScopInfo.cpp.
References Domain, and isl::set::get_space().
Referenced by polly::MemoryAccess::buildAccessRelation(), polly::MemoryAccess::createBasicAccessMap(), polly::MemoryAccess::foldAccessRelation(), polly::ZoneAlgorithm::getScatterFor(), getSchedule(), polly::Scop::restrictDomains(), and polly::MemoryAccess::setNewAccessRelation().
std::string ScopStmt::getDomainStr | ( | ) | const |
Get an isl string representing this domain.
Definition at line 1213 of file ScopInfo.cpp.
References Domain.
Referenced by print().
BasicBlock * ScopStmt::getEntryBlock | ( | ) | const |
Return a BasicBlock from this statement.
For block statements, it returns the BasicBlock itself. For subregion statements, return its entry block.
Definition at line 1221 of file ScopInfo.cpp.
References getBasicBlock(), getRegion(), and isBlockStmt().
Referenced by polly::ScopBuilder::buildAccessFunctions(), polly::ScopBuilder::buildAccessRelations(), polly::ScopBuilder::buildScop(), polly::ScopBuilder::collectSurroundingLoops(), polly::BlockGenerator::copyBB(), polly::VirtualUse::create(), polly::Scop::getDomainConditions(), polly::BlockGenerator::getLoopForStmt(), polly::ScopBuilder::getNonHoistableCtx(), polly::hasDebugCall(), polly::Scop::removeFromStmtMap(), polly::Scop::removeStmtNotInDomainMap(), polly::MemoryAccess::updateDimensionality(), and walkReachable().
|
inline |
Definition at line 1531 of file ScopInfo.h.
References Instructions.
Referenced by addInstructionRoots(), polly::ScopBuilder::buildAccessFunctions(), polly::BlockGenerator::copyBB(), findReferencesInStmt(), polly::hasDebugCall(), and polly::Scop::removeFromStmtMap().
|
inline |
Get the invalid context for this statement.
Definition at line 1309 of file ScopInfo.h.
References getInvalidDomain(), and isl::set::params().
Referenced by polly::ScopBuilder::addInvariantLoads().
|
inline |
Get the invalid domain for this statement.
Definition at line 1306 of file ScopInfo.h.
References InvalidDomain.
Referenced by polly::MemoryAccess::buildAccessRelation(), and getInvalidContext().
isl::ctx ScopStmt::getIslCtx | ( | ) | const |
Get an isl_ctx pointer.
Definition at line 1235 of file ScopInfo.cpp.
References polly::Scop::getIslCtx(), and Parent.
Referenced by polly::MemoryAccess::createBasicAccessMap(), and ScopStmt().
Loop * ScopStmt::getLoopForDimension | ( | unsigned | Dimension | ) | const |
Get the loop for a dimension.
Dimension | The dimension of the induction variable |
Definition at line 1231 of file ScopInfo.cpp.
References NestLoops.
Referenced by polly::IslNodeBuilder::createSubstitutions().
unsigned ScopStmt::getNumIterators | ( | ) | const |
Definition at line 1227 of file ScopInfo.cpp.
References NestLoops.
Referenced by polly::MemoryAccess::buildAccessRelation(), and polly::Scop::getStatistics().
|
inline |
Definition at line 1528 of file ScopInfo.h.
References Parent.
Referenced by polly::addReferencesFromStmt(), polly::BlockGenerator::canSyntheziseInStmt(), polly::ScopBuilder::checkForReductions(), polly::ScopBuilder::collectSurroundingLoops(), polly::MemoryAccess::computeBoundsOnAccessRelation(), polly::VirtualUse::create(), polly::IslNodeBuilder::createNewAccesses(), polly::IslNodeBuilder::createSubstitutions(), findReferencesInStmt(), polly::BlockGenerator::generateBeginStmtTrace(), polly::BlockGenerator::generateConditionalExecution(), polly::BlockGenerator::generateScalarLoads(), getSchedule(), polly::VirtualInstruction::getScop(), isEscaping(), polly::MemoryAccess::MemoryAccess(), polly::MemoryAccess::realignParams(), polly::MemoryAccess::setNewAccessRelation(), and polly::BlockGenerator::trySynthesizeNewValue().
|
inline |
Definition at line 1529 of file ScopInfo.h.
References Parent.
|
inline |
Get the region represented by this ScopStmt (if any).
Definition at line 1330 of file ScopInfo.h.
References R.
Referenced by addInstructionRoots(), polly::ScopBuilder::addMemoryAccess(), polly::RegionGenerator::buildExitPHI(), polly::ScopBuilder::buildScop(), polly::BlockGenerator::canSyntheziseInStmt(), polly::ScopBuilder::checkForReductions(), polly::ScopBuilder::collectSurroundingLoops(), contains(), polly::RegionGenerator::copyStmt(), findReferencesInStmt(), polly::RegionGenerator::generateScalarStores(), getEntryBlock(), polly::RegionGenerator::getExitScalar(), polly::hasDebugCall(), polly::Scop::removeFromStmtMap(), and represents().
isl::map ScopStmt::getSchedule | ( | ) | const |
Get the schedule function of this ScopStmt.
Definition at line 1104 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().
std::string ScopStmt::getScheduleStr | ( | ) | const |
Get an isl string representing this schedule.
Definition at line 1215 of file ScopInfo.cpp.
References getSchedule().
Referenced by print().
|
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 1381 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().
|
inline |
The range of instructions in this statement.
Definition at line 1550 of file ScopInfo.h.
References insts_begin(), and insts_end().
Referenced by polly::BlockGenerator::generateBeginStmtTrace().
|
inline |
|
inline |
|
inline |
Return true if this statement represents a single basic block.
Definition at line 1321 of file ScopInfo.h.
References BB.
Referenced by polly::ZoneAlgorithm::addArrayReadAccess(), addInstructionRoots(), polly::ScopBuilder::addMemoryAccess(), polly::ScopBuilder::buildScop(), polly::BlockGenerator::canSyntheziseInStmt(), contains(), polly::BlockGenerator::copyBB(), polly::BlockGenerator::copyStmt(), polly::IslNodeBuilder::createUser(), polly::BlockGenerator::generateScalarStores(), getEntryBlock(), lookupPHIWriteOf(), and represents().
|
inline |
Return true if this is a copy statement.
Definition at line 1324 of file ScopInfo.h.
Referenced by polly::IslNodeBuilder::createUser(), getSurroundingLoop(), and represents().
|
inline |
Return true if this statement does not contain any accesses.
Definition at line 1388 of file ScopInfo.h.
References MemAccs.
Referenced by polly::Scop::simplifySCoP().
|
inline |
Return true if this statement represents a whole region.
Definition at line 1333 of file ScopInfo.h.
References R.
Referenced by polly::ScopBuilder::addMemoryAccess(), polly::ScopBuilder::buildAccessFunctions(), polly::ZoneAlgorithm::collectIncompatibleElts(), polly::ScopBuilder::collectSurroundingLoops(), polly::BlockGenerator::copyBB(), polly::RegionGenerator::copyStmt(), findReferencesInStmt(), polly::hasDebugCall(), lookupValueWriteOf(), and polly::Scop::removeFromStmtMap().
|
inline |
Find all array accesses for Inst
.
Inst | The instruction accessing an array. |
Inst
. If there is no such access, it returns nullptr. Definition at line 1397 of file ScopInfo.h.
References InstructionToAccess.
Referenced by walkReachable().
|
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 1477 of file ScopInfo.h.
References assert, lookupPHIReadOf(), and lookupValueReadOf().
Referenced by ensureValueRead().
|
inline |
Return the MemoryAccess that loads a PHINode value, or nullptr if not existing, respectively not yet added.
Definition at line 1458 of file ScopInfo.h.
References polly::PHI, and PHIReads.
Referenced by lookupInputAccessOf(), and walkReachable().
|
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 1465 of file ScopInfo.h.
References assert, isBlockStmt(), polly::PHI, PHIWrites, and R.
Referenced by polly::ScopBuilder::ensurePHIWrite().
|
inline |
Return the MemoryAccess that reloads a value, or nullptr if not existing, respectively not yet added.
Definition at line 1452 of file ScopInfo.h.
References ValueReads.
Referenced by polly::VirtualUse::create(), polly::ScopBuilder::ensureValueRead(), and lookupInputAccessOf().
|
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 1444 of file ScopInfo.h.
References assert, BB, isRegionStmt(), R, and ValueWrites.
Referenced by polly::ScopBuilder::ensureValueWrite().
|
inline |
Insert an instruction before all other instructions in this statement.
Definition at line 1555 of file ScopInfo.h.
References Instructions.
void ScopStmt::print | ( | raw_ostream & | OS, |
bool | PrintInstructions | ||
) | const |
Print the ScopStmt.
OS | The output stream the ScopStmt is printed to. |
PrintInstructions | Whether to print the statement's instructions as well. |
Definition at line 1252 of file ScopInfo.cpp.
References Domain, getBaseName(), getDomainStr(), getScheduleStr(), isl::set::is_null(), MemAccs, and printInstructions().
Referenced by dump(), and polly::Scop::printStatements().
void ScopStmt::printInstructions | ( | raw_ostream & | OS | ) | const |
Print the instructions in ScopStmt.
Definition at line 1243 of file ScopInfo.cpp.
References Instructions.
Referenced by print().
void ScopStmt::realignParams | ( | ) |
Align the parameters in the statement to the scop context.
Definition at line 1162 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().
|
private |
Remove MA
from dictionaries pointing to them.
Definition at line 1279 of file ScopInfo.cpp.
References assert, polly::MemoryAccess::getAccessInstruction(), polly::MemoryAccess::getAccessValue(), polly::MemoryAccess::isOriginalAnyPHIKind(), polly::MemoryAccess::isOriginalValueKind(), polly::MemoryAccess::isRead(), polly::MemoryAccess::isWrite(), PHIReads, PHIWrites, ValueReads, and ValueWrites.
Referenced by removeMemoryAccess(), and removeSingleMemoryAccess().
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 1302 of file ScopInfo.cpp.
References polly::MemoryAccess::getAccessInstruction(), InstructionToAccess, MemAccs, Parent, polly::Scop::removeAccessData(), and removeAccessData().
void ScopStmt::removeSingleMemoryAccess | ( | MemoryAccess * | MA, |
bool | AfterHoisting = true |
||
) |
Remove MA
from this statement.
In contrast to removeMemoryAccess(), no other access will be eliminated.
MA | The MemoryAccess to be removed. |
AfterHoisting | If 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 1322 of file ScopInfo.cpp.
References assert, polly::MemoryAccess::getAccessInstruction(), InstructionToAccess, MemAccs, Parent, polly::Scop::removeAccessData(), and removeAccessData().
|
inline |
Return whether this statement represents BB
.
Definition at line 1351 of file ScopInfo.h.
References BB, getBasicBlock(), getRegion(), isBlockStmt(), and isCopyStmt().
Referenced by polly::RegionGenerator::addOperandToPHI(), polly::ScopBuilder::buildAccessFunctions(), and contains().
void ScopStmt::restrictDomain | ( | isl::set | NewDomain | ) |
Restrict the domain of the statement.
NewDomain | The new statement domain. |
Definition at line 1121 of file ScopInfo.cpp.
References assert, Domain, and isl::set::is_subset().
Referenced by polly::Scop::restrictDomains().
|
inline |
Set the isl AST build.
Definition at line 1562 of file ScopInfo.h.
Referenced by polly::IslNodeBuilder::createNewAccesses().
|
inline |
Set the list of instructions for this statement.
It replaces the current list.
Definition at line 1537 of file ScopInfo.h.
References Instructions, and Range.
void ScopStmt::setInvalidDomain | ( | isl::set | ID | ) |
Set the invalid context for this statement to ID
.
Definition at line 1219 of file ScopInfo.cpp.
References InvalidDomain.
Referenced by polly::ScopBuilder::buildScop().
|
inline |
Definition at line 1524 of file ScopInfo.h.
References MemAccs.
Referenced by polly::IslNodeBuilder::generateCopyStmt(), and polly::MemoryAccess::MemoryAccess().
|
friend |
Definition at line 1141 of file ScopInfo.h.
|
private |
Definition at line 1260 of file ScopInfo.h.
Referenced by getBaseName(), and ScopStmt().
|
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 1248 of file ScopInfo.h.
Referenced by getBasicBlock(), isBlockStmt(), isCopyStmt(), lookupValueWriteOf(), and represents().
|
private |
}
The isl AST build for the new generated AST.
Definition at line 1256 of file ScopInfo.h.
Referenced by getAstBuild(), and setAstBuild().
|
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 1207 of file ScopInfo.h.
Referenced by polly::ScopBuilder::buildDomain(), getDomain(), getDomainId(), getDomainSpace(), getDomainStr(), getSchedule(), print(), realignParams(), restrictDomain(), and ScopStmt().
|
private |
Vector for Instructions in this statement.
Definition at line 1266 of file ScopInfo.h.
Referenced by contains(), getInstructions(), insts_begin(), insts_end(), prependInstruction(), printInstructions(), and setInstructions().
|
private |
Mapping from instructions to (scalar) memory accesses.
Definition at line 1215 of file ScopInfo.h.
Referenced by addAccess(), getArrayAccessOrNULLFor(), lookupArrayAccessesFor(), removeMemoryAccess(), and removeSingleMemoryAccess().
|
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 1186 of file ScopInfo.h.
Referenced by getInvalidDomain(), realignParams(), and setInvalidDomain().
|
private |
The memory accesses of this statement.
The only side effects of a statement are its memory accesses.
Definition at line 1212 of file ScopInfo.h.
Referenced by addAccess(), begin(), polly::ScopBuilder::buildAccessRelations(), polly::ScopBuilder::checkForReductions(), end(), isEmpty(), print(), removeMemoryAccess(), removeSingleMemoryAccess(), and size().
|
private |
Definition at line 1258 of file ScopInfo.h.
Referenced by polly::ScopBuilder::collectSurroundingLoops(), getLoopForDimension(), and getNumIterators().
|
private |
Polyhedral description.
The Scop containing this ScopStmt.
Definition at line 1179 of file ScopInfo.h.
Referenced by ensureValueRead(), getIslCtx(), getParent(), realignParams(), removeMemoryAccess(), and removeSingleMemoryAccess().
|
private |
Map from PHI nodes to its read access in this statement.
Definition at line 1235 of file ScopInfo.h.
Referenced by addAccess(), lookupPHIReadOf(), and removeAccessData().
|
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 1232 of file ScopInfo.h.
Referenced by addAccess(), lookupPHIWriteOf(), and removeAccessData().
|
private |
The region represented by this statement (in the non-affine case).
Definition at line 1251 of file ScopInfo.h.
Referenced by getRegion(), isCopyStmt(), isRegionStmt(), lookupPHIWriteOf(), and lookupValueWriteOf().
|
private |
The closest loop that contains this statement.
Definition at line 1263 of file ScopInfo.h.
Referenced by getSurroundingLoop().
|
private |
The set of values defined elsewhere required in this ScopStmt and their MemoryKind::Value READ MemoryAccesses.
Definition at line 1219 of file ScopInfo.h.
Referenced by addAccess(), lookupValueReadOf(), and removeAccessData().
|
private |
The set of values defined in this ScopStmt that are required elsewhere, mapped to their MemoryKind::Value WRITE MemoryAccesses.
Definition at line 1223 of file ScopInfo.h.
Referenced by addAccess(), lookupValueWriteOf(), and removeAccessData().