[PATCH] D17526: [LoopUnroll] Respect the convergent attribute.

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 14 16:13:21 PDT 2016

jlebar added inline comments.

Comment at: lib/Transforms/Utils/LoopUnroll.cpp:275-278
@@ -263,1 +274,6 @@
+  );
+  // Don't output the runtime loop prolog if Count is a multiple of
+  // TripMultiple.  Such a prolog is never needed, and is unsafe if the loop
+  // contains a convergent instruction.
+  if (RuntimeTripCount && TripMultiple % Count != 0 &&
       !UnrollRuntimeLoopProlog(L, Count, AllowExpensiveTripCount, LI, SE, DT,
mzolotukhin wrote:
> I think this should go in a separate commit.
Since you approved this patch, I'm going to submit as one commit, I hope that's OK.  Other passes already remove said prelude in the non-convergent case -- the only reason I think you'd want this change is if you're also taking the rest of this patch.

Maybe if this were a huge change and there were some readability benefit to be had from splitting it up, but that also doesn't seem to be the case here.  Keeping this all together also makes our life a bit easier if we have to revert (which is possible if this prolog removal is somehow wrong).


More information about the llvm-commits mailing list