[all-commits] [llvm/llvm-project] 7beb65: [flang] Fixed LoopVersioning for array slices. (#6...

Slava Zakharin via All-commits all-commits at lists.llvm.org
Fri Sep 8 09:01:23 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7beb65ae2d9e909c4a63acb808451757e2fb1d07
      https://github.com/llvm/llvm-project/commit/7beb65ae2d9e909c4a63acb808451757e2fb1d07
  Author: Slava Zakharin <szakharin at nvidia.com>
  Date:   2023-09-08 (Fri, 08 Sep 2023)

  Changed paths:
    M flang/lib/Optimizer/Transforms/LoopVersioning.cpp
    M flang/test/Transforms/loop-versioning.fir

  Log Message:
  -----------
  [flang] Fixed LoopVersioning for array slices. (#65703)

The first test case added in the LIT test demonstrates the problem.
Even though we did not consider the inner loop as a candidate for
the transformation due to the array_coor with a slice, we decided to
version the outer loop for the same function argument.
During the cloning of the outer loop we dropped the slicing completely
producing invalid code.

I restructured the code so that we record all arg uses that cannot be
transformed (regardless of the reason), and then fixup the usage
information across the loop nests. I also noticed that we may generate
redundant contiguity checks for the inner loops, so I fixed it
since it was easy with the new way of keeping the usage data.




More information about the All-commits mailing list