[PATCH] D25963: [LoopUnroll] Implement profile-based loop peeling

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 28 13:53:53 PDT 2016


mkuper marked an inline comment as done.
mkuper added inline comments.


================
Comment at: lib/Transforms/Utils/LoopUnrollPeel.cpp:63
+unsigned llvm::getPeelCount(Loop *L, unsigned LoopSize,
+                            TargetTransformInfo::UnrollingPreferences *UP) {
+  if (!canPeel(L))
----------------
davidxl wrote:
> mkuper wrote:
> > davidxl wrote:
> > > Is UP parameter intended to be used?
> > Sorry, I don't quite understand what you mean here. It is used (in line 84 or below). Could you explain?
> Sorry I misread the early return as the regular return. Anyway, if UP is used here, there seems redundant to set UP.PeelCount in the caller of this function.
I think it'd be better for it to be set explicitly in the caller, rather than hidden away in here. (This currently also sets it, but that was unintentional, thanks for noticing).
I'd prefer to pass UP here by const reference, and set UP.PeelCount in the caller.


https://reviews.llvm.org/D25963





More information about the llvm-commits mailing list