[polly] r243215 - Fix formatting of recent alias-analysis commit
Tobias Grosser
tobias at grosser.es
Sat Jul 25 05:31:03 PDT 2015
Author: grosser
Date: Sat Jul 25 07:31:03 2015
New Revision: 243215
URL: http://llvm.org/viewvc/llvm-project?rev=243215&view=rev
Log:
Fix formatting of recent alias-analysis commit
Modified:
polly/trunk/include/polly/ScopInfo.h
polly/trunk/lib/Analysis/ScopInfo.cpp
polly/trunk/lib/CodeGen/IslAst.cpp
Modified: polly/trunk/include/polly/ScopInfo.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=243215&r1=243214&r2=243215&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopInfo.h (original)
+++ polly/trunk/include/polly/ScopInfo.h Sat Jul 25 07:31:03 2015
@@ -715,7 +715,7 @@ public:
/// @brief Pair of minimal/maximal access vectors representing
/// read write and read only accesses
- using MinMaxVectorPairTy = std::pair<MinMaxVectorTy *,MinMaxVectorTy *>;
+ using MinMaxVectorPairTy = std::pair<MinMaxVectorTy *, MinMaxVectorTy *>;
/// @brief Vector of pair of minimal/maximal access vectors representing
/// non read only and read only accesses for each alias group.
Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=243215&r1=243214&r2=243215&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Sat Jul 25 07:31:03 2015
@@ -1467,9 +1467,9 @@ static __isl_give isl_set *getAccessDoma
/// @brief Wrapper function to calculate minimal/maximal accesses to each array.
static bool calculateMinMaxAccess(__isl_take isl_union_map *Accesses,
- __isl_take isl_union_set *Domains,
- __isl_take isl_set *AssumedContext,
- Scop::MinMaxVectorTy *MinMaxAccesses){
+ __isl_take isl_union_set *Domains,
+ __isl_take isl_set *AssumedContext,
+ Scop::MinMaxVectorTy *MinMaxAccesses) {
Accesses = isl_union_map_intersect_domain(Accesses, Domains);
isl_union_set *Locations = isl_union_map_range(Accesses);
@@ -1582,7 +1582,7 @@ bool Scop::buildAliasGroups(AliasAnalysi
// If we don't have read only pointers check if there are at least two
// non read only pointers, otherwise clear the alias group.
- if (ReadOnlyPairs.empty() && NonReadOnlyBaseValues.size() <= 1){
+ if (ReadOnlyPairs.empty() && NonReadOnlyBaseValues.size() <= 1) {
AG.clear();
continue;
}
@@ -1603,15 +1603,14 @@ bool Scop::buildAliasGroups(AliasAnalysi
for (MemoryAccess *MA : AG)
Accesses = isl_union_map_add_map(Accesses, MA->getAccessRelation());
- bool Valid = calculateMinMaxAccess(Accesses, getDomains(),
- getAssumedContext(),
- MinMaxAccessesNonReadOnly);
+ bool Valid = calculateMinMaxAccess(
+ Accesses, getDomains(), getAssumedContext(), MinMaxAccessesNonReadOnly);
// Bail out if the number of values we need to compare is too large.
// This is important as the number of comparisions grows quadratically with
// the number of values we need to compare.
if (!Valid || (MinMaxAccessesNonReadOnly->size() + !ReadOnlyPairs.empty() >
- RunTimeChecksMaxArraysPerGroup)){
+ RunTimeChecksMaxArraysPerGroup)) {
for (MinMaxAccessTy &MMA : *(MinMaxAccessesNonReadOnly)) {
isl_pw_multi_aff_free(MMA.first);
isl_pw_multi_aff_free(MMA.second);
@@ -1629,9 +1628,9 @@ bool Scop::buildAliasGroups(AliasAnalysi
for (MemoryAccess *MA : ReadOnlyPair.second)
Accesses = isl_union_map_add_map(Accesses, MA->getAccessRelation());
- Valid = calculateMinMaxAccess(Accesses, getDomains(),getAssumedContext(),
+ Valid = calculateMinMaxAccess(Accesses, getDomains(), getAssumedContext(),
MinMaxAccessesReadOnly);
- MinMaxVectorPairTy pair(MinMaxAccessesNonReadOnly,MinMaxAccessesReadOnly);
+ MinMaxVectorPairTy pair(MinMaxAccessesNonReadOnly, MinMaxAccessesReadOnly);
MinMaxAliasGroups.push_back(pair);
if (!Valid)
@@ -1788,39 +1787,38 @@ void Scop::printContext(raw_ostream &OS)
}
void Scop::printAliasAssumptions(raw_ostream &OS) const {
- int noOfGroups=0;
- for (const MinMaxVectorPairTy &Pair : MinMaxAliasGroups){
+ int noOfGroups = 0;
+ for (const MinMaxVectorPairTy &Pair : MinMaxAliasGroups) {
if (Pair.second->size() == 0)
noOfGroups += 1;
else
noOfGroups += Pair.second->size();
}
- OS.indent(4) << "Alias Groups (" << noOfGroups << "):\n";
+ OS.indent(4) << "Alias Groups (" << noOfGroups << "):\n";
if (MinMaxAliasGroups.empty()) {
OS.indent(8) << "n/a\n";
return;
}
- for (const MinMaxVectorPairTy &Pair : MinMaxAliasGroups){
+ for (const MinMaxVectorPairTy &Pair : MinMaxAliasGroups) {
// If the group has no read only accesses print the write accesses.
- if (Pair.second->empty()){
+ if (Pair.second->empty()) {
OS.indent(8) << "[[";
- for (MinMaxAccessTy &MMANonReadOnly : *(Pair.first)){
- OS << " <" << MMANonReadOnly.first << ", "
- << MMANonReadOnly.second << ">";
+ for (MinMaxAccessTy &MMANonReadOnly : *(Pair.first)) {
+ OS << " <" << MMANonReadOnly.first << ", " << MMANonReadOnly.second
+ << ">";
}
OS << " ]]\n";
}
- for (MinMaxAccessTy &MMAReadOnly : *(Pair.second)){
+ for (MinMaxAccessTy &MMAReadOnly : *(Pair.second)) {
OS.indent(8) << "[[";
- OS << " <" << MMAReadOnly.first << ", "
- << MMAReadOnly.second << ">";
- for (MinMaxAccessTy &MMANonReadOnly : *(Pair.first)){
- OS << " <" << MMANonReadOnly.first << ", "
- << MMANonReadOnly.second << ">";
+ OS << " <" << MMAReadOnly.first << ", " << MMAReadOnly.second << ">";
+ for (MinMaxAccessTy &MMANonReadOnly : *(Pair.first)) {
+ OS << " <" << MMANonReadOnly.first << ", " << MMANonReadOnly.second
+ << ">";
}
OS << " ]]\n";
}
Modified: polly/trunk/lib/CodeGen/IslAst.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/IslAst.cpp?rev=243215&r1=243214&r2=243215&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/IslAst.cpp (original)
+++ polly/trunk/lib/CodeGen/IslAst.cpp Sat Jul 25 07:31:03 2015
@@ -305,26 +305,22 @@ static __isl_give isl_ast_node *AtEachDo
// Build alias check condition given a pair of minimal/maximal access.
static __isl_give isl_ast_expr *buildCondition(__isl_keep isl_ast_build *Build,
- Scop::MinMaxAccessTy *It0,
- Scop::MinMaxAccessTy *It1){
- isl_ast_expr *NonAliasGroup,*MinExpr, *MaxExpr;
- MinExpr =
- isl_ast_expr_address_of(isl_ast_build_access_from_pw_multi_aff(
- Build, isl_pw_multi_aff_copy(It0->first)));
- MaxExpr =
- isl_ast_expr_address_of(isl_ast_build_access_from_pw_multi_aff(
- Build, isl_pw_multi_aff_copy(It1->second)));
- NonAliasGroup = isl_ast_expr_le(MaxExpr, MinExpr);
- MinExpr =
- isl_ast_expr_address_of(isl_ast_build_access_from_pw_multi_aff(
- Build, isl_pw_multi_aff_copy(It1->first)));
- MaxExpr =
- isl_ast_expr_address_of(isl_ast_build_access_from_pw_multi_aff(
- Build, isl_pw_multi_aff_copy(It0->second)));
- NonAliasGroup =
- isl_ast_expr_or(NonAliasGroup, isl_ast_expr_le(MaxExpr, MinExpr));
+ Scop::MinMaxAccessTy *It0,
+ Scop::MinMaxAccessTy *It1) {
+ isl_ast_expr *NonAliasGroup, *MinExpr, *MaxExpr;
+ MinExpr = isl_ast_expr_address_of(isl_ast_build_access_from_pw_multi_aff(
+ Build, isl_pw_multi_aff_copy(It0->first)));
+ MaxExpr = isl_ast_expr_address_of(isl_ast_build_access_from_pw_multi_aff(
+ Build, isl_pw_multi_aff_copy(It1->second)));
+ NonAliasGroup = isl_ast_expr_le(MaxExpr, MinExpr);
+ MinExpr = isl_ast_expr_address_of(isl_ast_build_access_from_pw_multi_aff(
+ Build, isl_pw_multi_aff_copy(It1->first)));
+ MaxExpr = isl_ast_expr_address_of(isl_ast_build_access_from_pw_multi_aff(
+ Build, isl_pw_multi_aff_copy(It0->second)));
+ NonAliasGroup =
+ isl_ast_expr_or(NonAliasGroup, isl_ast_expr_le(MaxExpr, MinExpr));
- return NonAliasGroup;
+ return NonAliasGroup;
}
void IslAst::buildRunCondition(__isl_keep isl_ast_build *Build) {
@@ -345,11 +341,11 @@ void IslAst::buildRunCondition(__isl_kee
for (auto RWAccIt0 = MinMaxReadWrite->begin(); RWAccIt0 != RWAccEnd;
++RWAccIt0) {
for (auto RWAccIt1 = RWAccIt0 + 1; RWAccIt1 != RWAccEnd; ++RWAccIt1)
- RunCondition = isl_ast_expr_and(RunCondition,
- buildCondition(Build,RWAccIt0,RWAccIt1));
+ RunCondition = isl_ast_expr_and(
+ RunCondition, buildCondition(Build, RWAccIt0, RWAccIt1));
for (Scop::MinMaxAccessTy &ROAccIt : *MinMaxReadOnly)
- RunCondition = isl_ast_expr_and(RunCondition,
- buildCondition(Build,RWAccIt0,&ROAccIt));
+ RunCondition = isl_ast_expr_and(
+ RunCondition, buildCondition(Build, RWAccIt0, &ROAccIt));
}
}
}
More information about the llvm-commits
mailing list