[PATCH] D95521: [SCEV] Apply loop guards to trailing zero bits

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 31 02:05:17 PST 2021


fhahn added inline comments.


================
Comment at: llvm/test/Transforms/LoopUnroll/runtime-unroll-assume-no-remainder.ll:7
+
+define dso_local void @assumeDivisibleTC(i8* noalias nocapture %a, i8* noalias nocapture readonly %b, i32 %n, i1 %c) local_unnamed_addr {
+; CHECK-LABEL: @assumeDivisibleTC(
----------------
could you also add version of this test that checks `%cmp` in the guard condition, instead of an `assume`?


================
Comment at: llvm/test/Transforms/LoopUnroll/runtime-unroll-assume-no-remainder.ll:45
+entry:
+  br i1 %c, label %bail.out, label %do.work
+
----------------
is this extra branch needed?


================
Comment at: llvm/test/Transforms/LoopUnroll/runtime-unroll-assume-no-remainder.ll:57
+
+for.body.preheader:                               ; preds = %do.work
+  br label %for.body
----------------
the extra blocks should not be needed for unrolling.


================
Comment at: llvm/test/Transforms/LoopUnroll/runtime-unroll-assume-no-remainder.ll:68
+  %i.011 = phi i32 [ %inc, %for.body ], [ 0, %for.body.preheader ]
+  %idxprom = zext i32 %i.011 to i64
+  %arrayidx = getelementptr inbounds i8, i8* %b, i64 %idxprom
----------------
can we either change `%i.011` to i64 or the users to use `i32` instead of the extension?


================
Comment at: llvm/test/Transforms/LoopUnroll/runtime-unroll-assume-no-remainder.ll:80
+declare void @llvm.assume(i1 noundef) nofree nosync nounwind willreturn
+!0 = distinct !{!0, !1, !2}
+!1 = !{!"llvm.loop.mustprogress"}
----------------
should not be needed for unrolling.


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

https://reviews.llvm.org/D95521



More information about the llvm-commits mailing list