[PATCH] D25584: [polly codegen] Handle multi-dimensional invariant load.

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 14 01:06:25 PDT 2016


jdoerfert added a comment.

Assuming all checks prior to code generation can handle this case properly this is the "right way" to fix this. One modification and it should be good to go.



================
Comment at: lib/CodeGen/IslNodeBuilder.cpp:1115
+    // This special case parallels the special case for loads in
+    // ScopDetection::hasValidArraySizes.
+    if (const SCEVUnknown *Unknown = dyn_cast<SCEVUnknown>(Dim)) {
----------------
I do not get the comment.


================
Comment at: lib/CodeGen/IslNodeBuilder.cpp:1116
+    // ScopDetection::hasValidArraySizes.
+    if (const SCEVUnknown *Unknown = dyn_cast<SCEVUnknown>(Dim)) {
+      if (auto *BaseIAClass =
----------------
To get all SCEVUnknowns that might be loads which are somewhere referenced in the dimension size we need to do it somewhat like:

```
SetVector<Value *> Values;
findValues(ParamSCEV, SE, Values);                                                                  
for (auto *Val : Values) {
  if (auto *BaseIAClass = S.lookupInvariantEquivClass(Val) {
    ...


```


================
Comment at: lib/CodeGen/IslNodeBuilder.cpp:1128
+    } else {
+      assert(!hasScalarDepsInsideRegion(Dim, &S.getRegion(), nullptr, false));
+    }
----------------
I do not see the need here but OK.


Repository:
  rL LLVM

https://reviews.llvm.org/D25584





More information about the llvm-commits mailing list