[PATCH] D34982: [Polly][WIP] Fully-Indexed static expansion

Bonfante Nicolas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 26 08:01:58 PDT 2017


niosega marked 8 inline comments as done.
niosega added inline comments.


================
Comment at: lib/Transform/MaximalStaticExpansion.cpp:218
+          emitRemark(SAI->getName() +
+                         " expansion leads to a partial read access.",
+                     MA->getAccessInstruction());
----------------
Meinersbur wrote:
> The consequence would not be a partial read access, but it would need to read the original value the element had before entering the SCoP. That's a special case similar to having more than one write.
Are you sure ?

Because if I remember well. Let say that we are analyzing this code : 

```
  for (i = 0; i < Ni; i++) {
    B[j] = i;
    for (int j = 0; j<Nj; j++) {
      B[j] = j;
    }
    A[i] = B[i]; 
```

 When I try to set the new access relation for the B read, the setNewAccessRelation method of class MemoryAccess failed with the assert "Partial READ accesses not supported". 


================
Comment at: lib/Transform/MaximalStaticExpansion.cpp:307
+           "The upper bound is not a positive integer.");
+    Sizes.push_back(UpperBound.get_num_si() + 1);
+  }
----------------
Meinersbur wrote:
> [Nit] The UpperBound could overflow a long. Add an assertion for that?
How can I efficiently check that there is an overflow ? 


================
Comment at: lib/Transform/MaximalStaticExpansion.cpp:328-331
+    auto Constraints = isl::constraint::alloc_equality(ls);
+    Constraints = Constraints.set_coefficient_si(isl::dim::out, dim, 1);
+    Constraints = Constraints.set_coefficient_si(isl::dim::in, dim, -1);
+    NewAccessMap = NewAccessMap.add_constraint(Constraints);
----------------
Meinersbur wrote:
> [Style] This could be simpler using
> ```
> NewAccessMap = NewAccessMap->equate(isl::dim::in, dim. isl::dim::out, dim);
> ```
> or, even, better, use `basic_map::equal`.
I'd like to use isl_basic_map_equal but I did not find the documentation of this method on the online isl doc. There is also no example of uses in Polly. Can you explain me how it works ?


https://reviews.llvm.org/D34982





More information about the llvm-commits mailing list