summaryrefslogtreecommitdiffstats
path: root/polly/include
diff options
context:
space:
mode:
authorMichael Kruse <llvm@meinersbur.de>2019-06-12 04:23:05 +0000
committerMichael Kruse <llvm@meinersbur.de>2019-06-12 04:23:05 +0000
commit549991e48c621d5cf95e4788fe13d4058a11a23c (patch)
tree937642db13983c166114b8b2d075ce096d4b3254 /polly/include
parent04ddf39b44659920ae0f8590464dd21a4f0530bb (diff)
downloadbcm5719-llvm-549991e48c621d5cf95e4788fe13d4058a11a23c.tar.gz
bcm5719-llvm-549991e48c621d5cf95e4788fe13d4058a11a23c.zip
[ScopBuilder] Move hoistInvariantLoads to ScopBuilder. NFC.
Refactor Scop and ScopBuilder class: 1. Move hoistInvariantLoads function from Scop to ScopBuilder class. 2. Private functions (addInvariantLoads, getNonHoistableCtx) are moved to public section of Scop class. hoistInvariantLoads function references these functions. These functions will be moved to ScopBuilder as well in the next steps. Patch by Dominik Adamski <adamski.dominik@gmail.com> Differential Revision: https://reviews.llvm.org/D62925 llvm-svn: 363121
Diffstat (limited to 'polly/include')
-rw-r--r--polly/include/polly/ScopBuilder.h19
-rw-r--r--polly/include/polly/ScopInfo.h43
2 files changed, 31 insertions, 31 deletions
diff --git a/polly/include/polly/ScopBuilder.h b/polly/include/polly/ScopBuilder.h
index 0c1e15a12a6..7de59feb676 100644
--- a/polly/include/polly/ScopBuilder.h
+++ b/polly/include/polly/ScopBuilder.h
@@ -375,6 +375,25 @@ class ScopBuilder {
/// ...
void verifyInvariantLoads();
+ /// Hoist invariant memory loads and check for required ones.
+ ///
+ /// We first identify "common" invariant loads, thus loads that are invariant
+ /// and can be hoisted. Then we check if all required invariant loads have
+ /// been identified as (common) invariant. A load is a required invariant load
+ /// if it was assumed to be invariant during SCoP detection, e.g., to assume
+ /// loop bounds to be affine or runtime alias checks to be placeable. In case
+ /// a required invariant load was not identified as (common) invariant we will
+ /// drop this SCoP. An example for both "common" as well as required invariant
+ /// loads is given below:
+ ///
+ /// for (int i = 1; i < *LB[0]; i++)
+ /// for (int j = 1; j < *LB[1]; j++)
+ /// A[i][j] += A[0][0] + (*V);
+ ///
+ /// Common inv. loads: V, A[0][0], LB[0], LB[1]
+ /// Required inv. loads: LB[0], LB[1], (V, if it may alias with A or LB)
+ void hoistInvariantLoads();
+
/// Collect loads which might form a reduction chain with @p StoreMA.
///
/// Check if the stored value for @p StoreMA is a binary operator with one or
diff --git a/polly/include/polly/ScopInfo.h b/polly/include/polly/ScopInfo.h
index 583b99ef2be..3045b7a4f10 100644
--- a/polly/include/polly/ScopInfo.h
+++ b/polly/include/polly/ScopInfo.h
@@ -2031,42 +2031,11 @@ private:
/// Check if the base ptr of @p MA is in the SCoP but not hoistable.
bool hasNonHoistableBasePtrInScop(MemoryAccess *MA, isl::union_map Writes);
- /// Return the context under which the access cannot be hoisted.
- ///
- /// @param Access The access to check.
- /// @param Writes The set of all memory writes in the scop.
- ///
- /// @return Return the context under which the access cannot be hoisted or a
- /// nullptr if it cannot be hoisted at all.
- isl::set getNonHoistableCtx(MemoryAccess *Access, isl::union_map Writes);
-
- /// Hoist invariant memory loads and check for required ones.
- ///
- /// We first identify "common" invariant loads, thus loads that are invariant
- /// and can be hoisted. Then we check if all required invariant loads have
- /// been identified as (common) invariant. A load is a required invariant load
- /// if it was assumed to be invariant during SCoP detection, e.g., to assume
- /// loop bounds to be affine or runtime alias checks to be placeable. In case
- /// a required invariant load was not identified as (common) invariant we will
- /// drop this SCoP. An example for both "common" as well as required invariant
- /// loads is given below:
- ///
- /// for (int i = 1; i < *LB[0]; i++)
- /// for (int j = 1; j < *LB[1]; j++)
- /// A[i][j] += A[0][0] + (*V);
- ///
- /// Common inv. loads: V, A[0][0], LB[0], LB[1]
- /// Required inv. loads: LB[0], LB[1], (V, if it may alias with A or LB)
- void hoistInvariantLoads();
-
/// Check if @p MA can always be hoisted without execution context.
bool canAlwaysBeHoisted(MemoryAccess *MA, bool StmtInvalidCtxIsEmpty,
bool MAInvalidCtxIsEmpty,
bool NonHoistableCtxIsEmpty);
- /// Add invariant loads listed in @p InvMAs with the domain of @p Stmt.
- void addInvariantLoads(ScopStmt &Stmt, InvariantAccessesTy &InvMAs);
-
/// Create an id for @p Param and store it in the ParameterIds map.
void createParameterId(const SCEV *Param);
@@ -2341,6 +2310,9 @@ public:
InvEquivClassVMap[LoadInst] = ClassRep;
}
+ /// Add invariant loads listed in @p InvMAs with the domain of @p Stmt.
+ void addInvariantLoads(ScopStmt &Stmt, InvariantAccessesTy &InvMAs);
+
/// Remove the metadata stored for @p Access.
void removeAccessData(MemoryAccess *Access);
@@ -2663,6 +2635,15 @@ public:
return MinMaxAliasGroups;
}
+ /// Return the context under which the access cannot be hoisted.
+ ///
+ /// @param Access The access to check.
+ /// @param Writes The set of all memory writes in the scop.
+ ///
+ /// @return Return the context under which the access cannot be hoisted or a
+ /// nullptr if it cannot be hoisted at all.
+ isl::set getNonHoistableCtx(MemoryAccess *Access, isl::union_map Writes);
+
/// Get an isl string representing the context.
std::string getContextStr() const;
OpenPOWER on IntegriCloud