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

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 26 11:13:53 PDT 2016


mkuper 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) {
----------------
davidxl wrote:
> mkuper wrote:
> > davidxl wrote:
> > > Should PeelCount be a member of UnrollingPreferences class?
> > I think not, but I don't really know.
> > To the best of my understanding, the main point of UnrollingPreferences is to give targets the ability to override the defaults, and I'm not sure this is useful here.
> The Count field in UP is used to specify unrolling factor including heuristic based :
> 
>  // 4rd priority is partial unrolling.
>   // Try partial unroll only when TripCount could be staticaly calculated.
>   if (TripCount) {
>     if (UP.Count == 0)
>       UP.Count = TripCount;
> 
> 
> Conceptually peeling Count should be treated in the same way.
To be honest, I don't understand why Count lives in UnrollingPreferences either. It's never a target preference, it's a derived value.


https://reviews.llvm.org/D25963





More information about the llvm-commits mailing list