[polly] r223621 - Simplify computation of reduction dependences

Tobias Grosser tobias at grosser.es
Sun Dec 7 14:51:46 PST 2014


Author: grosser
Date: Sun Dec  7 16:51:45 2014
New Revision: 223621

URL: http://llvm.org/viewvc/llvm-project?rev=223621&view=rev
Log:
Simplify computation of reduction dependences

This simplifies the construction of the input for the reduction dependence
computation and at the same time removes an assumption that expects the schedule
to be of 2D + 1 form (the odd dimensions giving textual order, the even
dimensions the loop iterations).

Modified:
    polly/trunk/lib/Analysis/Dependences.cpp

Modified: polly/trunk/lib/Analysis/Dependences.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/Dependences.cpp?rev=223621&r1=223620&r2=223621&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/Dependences.cpp (original)
+++ polly/trunk/lib/Analysis/Dependences.cpp Sun Dec  7 16:51:45 2014
@@ -102,17 +102,11 @@ void Dependences::collectInfo(Scop &S, i
         // but as we transformed the access domain we need the scattering
         // to match the new access domains, thus we need
         //   [Stmt[i0, i1] -> MemAcc_A[i0 + i1]] -> [0, i0, 2, i1, 0]
+        isl_map *Scatter = Stmt->getScattering();
+        Scatter = isl_map_apply_domain(
+            Scatter, isl_map_reverse(isl_map_domain_map(isl_map_copy(accdom))));
         accdom = isl_map_range_map(accdom);
-
-        isl_map *stmt_scatter = Stmt->getScattering();
-        isl_set *scatter_dom = isl_map_domain(isl_map_copy(accdom));
-        isl_set *scatter_ran = isl_map_range(stmt_scatter);
-        isl_map *scatter =
-            isl_map_from_domain_and_range(scatter_dom, scatter_ran);
-        for (unsigned u = 0, e = Stmt->getNumIterators(); u != e; u++)
-          scatter =
-              isl_map_equate(scatter, isl_dim_out, 2 * u + 1, isl_dim_in, u);
-        *AccessSchedule = isl_union_map_add_map(*AccessSchedule, scatter);
+        *AccessSchedule = isl_union_map_add_map(*AccessSchedule, Scatter);
       }
 
       if (MA->isRead())





More information about the llvm-commits mailing list