[PATCH] D130189: [LoopInterchange][PR56275] Fix legality in dependence vectors

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 22 13:04:08 PDT 2022


Meinersbur added a comment.

As mentioned in https://github.com/llvm/llvm-project/issues/56275#issuecomment-1183363002, I think both directions need to be considered. `<` or `>` of the `Dependence` object mingels relation between the `Src`/`Dst` argument. Here, it is interpreted as the direction of the loop.

However, with normalizing this could be correct, but only when we bail out with any bidirectional dependencies. See my inline comment. Such subtly should be worth a source comment somewhere.



================
Comment at: llvm/lib/Transforms/Scalar/LoopInterchange.cpp:145-146
               Direction = '=';
             else
-              Direction = '>';
+              Direction = '<';
             Dep.push_back(Direction);
----------------
[serious] A SCEV can be neither `isPositive()`, `isZero()`, nor `isNegative()`. This is for instance that case when it depend on a variable which can be either one of them at runtime. This code implicitly assumes that such a distance is "negative". It should be '*'.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130189/new/

https://reviews.llvm.org/D130189



More information about the llvm-commits mailing list