[PATCH] D25963: [LoopUnroll] Implement profile-based loop peeling
David Li via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 25 16:41:01 PDT 2016
davidxl added inline comments.
================
Comment at: lib/Transforms/Scalar/LoopUnrollPass.cpp:724
unsigned MaxTripCount, unsigned &TripMultiple, unsigned LoopSize,
- TargetTransformInfo::UnrollingPreferences &UP, bool &UseUpperBound) {
+ unsigned &PeelCount, TargetTransformInfo::UnrollingPreferences &UP,
+ bool &UseUpperBound) {
----------------
Should PeelCount be a member of UnrollingPreferences class?
================
Comment at: lib/Transforms/Scalar/LoopUnrollPass.cpp:887
+ // If the user provided a peel count, use that.
+ bool UserPeelCount = UnrollForcePeelCount.getNumOccurrences() > 0;
+ if (UserPeelCount) {
----------------
I think all the logic here should probably be wrapped in a helper function "computeOptimalPeelCount".
================
Comment at: lib/Transforms/Scalar/LoopUnrollPass.cpp:904
+ if (UP.AllowPeeling && L->getHeader()->getParent()->getEntryCount()) {
+ PeelCount = getPeelCount(L);
+
----------------
getPeelCount looks like a simple wrapper that is only used once. Probably get rid of it.
================
Comment at: lib/Transforms/Utils/LoopUnrollPeel.cpp:63
+
+static void cloneLoopBlocksForPeeling(
+ Loop *L, bool FirstCopy, BasicBlock *InsertTop, BasicBlock *InsertBot,
----------------
Is there common utility to do body cloning?
https://reviews.llvm.org/D25963
More information about the llvm-commits
mailing list