[PATCH] D73129: [LoopUnrollAndJam] Correctly update LoopInfo when unroll and jam more than 2-levels loop nests.

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 22 12:33:02 PST 2020


jdoerfert added inline comments.


================
Comment at: llvm/test/Transforms/LoopUnrollAndJam/loopnest.ll:94
+}
+declare void @bar(i64, i64, i64) nounwind readnone
+
----------------
Whitney wrote:
> fhahn wrote:
> > if that's readnone nounwind and the result is unused, it will just be removed (by simplifyLoopAfterUnroll probably). If you need actual loop body, it's probably better to drop the attributes.
> They are required for unroll and jam to be safely performed.  i.e. Without those attributes, unroll and jam is not performed. 
That makes sense but @fhahn has a point. We should try not to introduce test cases that are "trivial" in some sense.

I think `A[i][j][k] = 0` was an OK choice. I personally have a harder time understanding check lines and differences if I don't see all of it. Also, the above is arguably the minimal test case for 3 loops already, with ` A[i][j][k] = 0` the simplest useful example I can think of.

Nit: Make the loop bounds different for each loop. That way you can spot them more easily.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73129





More information about the llvm-commits mailing list