[PATCH] D50075: [UnJ] Improve explicit loop count checks

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 9 14:28:00 PDT 2018


Meinersbur accepted this revision.
Meinersbur added a comment.
This revision is now accepted and ready to land.

In https://reviews.llvm.org/D50075#1183066, @dmgreen wrote:

> There are other pragma tests in pragma.ll, which check combinations of unroll and unroll_and_jam pragmas. The current behaviour if there is both unroll metadata and unroll_and_jam metadata isn't currently very refined. I would expect, at least in the default pipeline, for the unroll metadata to be handled first in one of the early unroll passes.


This is what I am trying to tackle in https://reviews.llvm.org/D49281: Ideally one must not define multiple transformations at all, but if the frontend wants multiple transformations, it has to explicitly define an order.

> Let me know if you think I should change how it works here.

Except the `CHECK-NOT`: LGTM



================
Comment at: test/Transforms/LoopUnrollAndJam/pragma-explicit.ll:9
+; CHECK: %indvars.iv.3 = phi i64 [ 0, %for.cond1.preheader.us ], [ %indvars.iv.next.3, %for.body4.us ]
+; CHECK-NOT: %indvars.iv.4 = phi i64 [ 0, %for.cond1.preheader.us ], [ %indvars.iv.next.4, %for.body4.us ]
+define void @function(i8* noalias nocapture %dst, i32 %dst_stride, i8* noalias nocapture readonly %src, i32 %src_stride, i32 %A, i32 %B, i32 %C, i32 %D, i32 %width, i32 %height) {
----------------
`-NOT` tests are quite fragile. To check that there is no 4th unroll, did you consider checking e.g. the `; preds = ` of the BB that follows the last unroll copy?


https://reviews.llvm.org/D50075





More information about the llvm-commits mailing list