13#ifndef POLLY_ZONEALGO_H
14#define POLLY_ZONEALGO_H
16#include "llvm/ADT/DenseMap.h"
17#include "llvm/ADT/DenseSet.h"
18#include "llvm/ADT/SmallPtrSet.h"
154 llvm::SmallDenseMap<llvm::PHINode *, isl::union_map>
PerPHIMaps;
335 bool IsCertain =
true);
344 bool IsCertain =
true);
360 void printAccesses(llvm::raw_ostream &OS,
int Indent = 0)
const;
Represent memory accesses in statements.
A class to store information about arrays in the SCoP.
Base class for algorithms based on zones, like DeLICM.
isl::map makeUnknownForDomain(ScopStmt *Stmt) const
Create a statement-to-unknown value mapping.
isl::union_map Schedule
Cached version of the schedule and domains.
llvm::DenseMap< std::pair< ScopStmt *, ScopStmt * >, isl::map > DefToTargetCache
A cache for getDefToTarget().
isl::union_map AllReads
Combined access relations of all MemoryKind::Array READ accesses.
isl::union_set makeEmptyUnionSet() const
bool isNormalizable(MemoryAccess *MA)
Is MA a PHI READ access that can be normalized?
isl::union_map makeEmptyUnionMap() const
isl::set makeValueSet(llvm::Value *V)
Create a set with the llvm::Value V which is available everywhere.
void printAccesses(llvm::raw_ostream &OS, int Indent=0) const
Print the current state of all MemoryAccesses to .
isl::space ParamSpace
Parameter space that does not need realignment.
llvm::LoopInfo * LI
LoopInfo analysis used to determine whether values are synthesizable.
isl::set getDomainFor(ScopStmt *Stmt) const
Get the domain of Stmt.
isl::map makeValInst(llvm::Value *Val, ScopStmt *UserStmt, llvm::Loop *Scope, bool IsCertain=true)
Create a mapping from a statement instance to the instance of an llvm::Value that can be used in ther...
void collectCompatibleElts()
Find the array elements that can be used for zone analysis.
isl::space makeValueSpace(llvm::Value *V)
Create the space for an llvm::Value that is available everywhere.
const char * PassName
The name of the pass this is used from. Used for optimization remarks.
isl::union_map AllReadValInst
The loaded values (llvm::LoadInst) of all reads.
isl::map getScatterFor(ScopStmt *Stmt) const
Get the schedule for Stmt.
void collectIncompatibleElts(ScopStmt *Stmt, isl::union_set &IncompatibleElts, isl::union_set &AllElts)
Find the array elements that violate the zone analysis assumptions.
isl::union_map computeKnownFromMustWrites() const
A reaching definition zone is known to have the definition's written value if the definition is a MUS...
isl::union_map makeNormalizedValInst(llvm::Value *Val, ScopStmt *UserStmt, llvm::Loop *Scope, bool IsCertain=true)
Create and normalize a ValInst.
isl::union_map AllWriteValInst
The value instances written to array elements of all write accesses.
isl::union_map NormalizeMap
For computed PHIs, contains the ValInst they stand for.
isl::union_map computePerPHI(const polly::ScopArrayInfo *SAI)
For each 'execution' of a PHINode, get the incoming block that was executed before.
isl::union_map WriteReachDefZone
All reaching definitions for MemoryKind::Array writes.
void addArrayReadAccess(MemoryAccess *MA)
llvm::DenseMap< llvm::Value *, isl::id > ValueIds
Map llvm::Values to an isl identifier.
void computeNormalizedPHIs()
Compute the normalization map that replaces PHIs by their incoming values.
isl::union_map AllMayWrites
Combined access relations of all MemoryKind::Array, MAY_WRITE accesses.
Scop * S
The analyzed Scop.
isl::map computeUseToDefFlowDependency(ScopStmt *UseStmt, ScopStmt *DefStmt)
For an llvm::Value defined in DefStmt, compute the RAW dependency for a use in every instance of UseS...
isl::id makeValueId(llvm::Value *V)
Create an isl_id that represents V.
llvm::DenseMap< ScopStmt *, isl::map > ScalarReachDefZone
Cached reaching definitions for each ScopStmt.
llvm::SmallDenseMap< llvm::PHINode *, isl::union_map > PerPHIMaps
Cache for computePerPHI(const ScopArrayInfo *)
llvm::DenseSet< llvm::PHINode * > ComputedPHIs
PHIs that have been computed.
isl::union_map computeKnownFromLoad() const
A reaching definition zone is known to be the same value as any load that reads from that array eleme...
isl::map getDefToTarget(ScopStmt *DefStmt, ScopStmt *TargetStmt)
Get a domain translation map from a (scalar) definition to the statement where the definition is bein...
isl::union_map getWrittenValue(MemoryAccess *MA, isl::map AccRel)
Return the ValInst write by a (must-)write access.
Scop * getScop() const
Return the SCoP this object is analyzing.
void computeCommon()
Compute the different zones.
llvm::SmallPtrSet< llvm::PHINode *, 4 > RecursivePHIs
List of PHIs that may transitively refer to themselves.
isl::space ScatterSpace
Space the schedule maps to.
isl::union_map computeKnown(bool FromWrite, bool FromRead) const
Compute which value an array element stores at every instant.
isl::map getScalarReachingDefinition(ScopStmt *Stmt)
Get the reaching definition of a scalar defined in Stmt.
isl::union_set CompatibleElts
Set of array elements that can be reliably used for zone analysis.
isl::union_map AllMustWrites
Combined access relations of all MemoryKind::Array, MUST_WRITE accesses.
std::shared_ptr< isl_ctx > IslCtx
Hold a reference to the isl_ctx to avoid it being freed before we released all of the isl objects.
isl::boolean isNormalized(isl::map Map)
isl::map getAccessRelationFor(MemoryAccess *MA) const
Get the access relation of MA.
void addArrayWriteAccess(MemoryAccess *MA)
bool isCompatibleAccess(MemoryAccess *MA)
Return whether MA can be used for transformations (e.g.
isl::union_map AllWrites
Combined access relations of all MK_Array write accesses (union of AllMayWrites and AllMustWrites).
This file contains the declaration of the PolyhedralInfo class, which will provide an interface to ex...
isl::union_map makeUnknownForDomain(isl::union_set Domain)
Create a domain-to-unknown value mapping.
@ Value
MemoryKind::Value: Models an llvm::Value.
isl::union_map filterKnownValInst(const isl::union_map &UMap)
Return only the mappings that map to known values.
static TupleKindPtr Domain("Domain")