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

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 14 15:56:53 PDT 2018


Meinersbur added inline comments.


================
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) {
----------------
dmgreen wrote:
> Meinersbur wrote:
> > `-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?
> The unrolled BB's get merged, usually leaving just the first block, so unfortunately I don't think the preds will show much. I've changed things to check the outer phi nodes, where it can check that the return phi comes from %.pre60.3, in this case.
Correct, as I had to find myself in D50075. Sorry for the incorrect suggestion.

I ended up checking for the number of stores (with only one in the source IR) follows-by a `CHECK-NOT: store`. This does not depend on any instruction naming. To avoid occurrences in the remainder to be matched, add a `CHECK: br i1` to match the end of the BasicBlock before the `CHECK-NOT`. For instance here: https://reviews.llvm.org/D49281#change-CH2qXAAQjJUs


Repository:
  rL LLVM

https://reviews.llvm.org/D50075





More information about the llvm-commits mailing list