This change should be NFC. It's posted for review mostly to make sure others are happy with the names I'm introducing for "exact full unroll" and "bounded full unroll". The motivation here is that our cost model for bounded unrolling is too aggressive - it gives benefits for exits we aren't going to prune - but I also just think the new version of the code is a lot easier to follow.
Details
Diff Detail
Event Timeline
Further simplify - despite structure of existing code, shouldFullUnroll doesn't modify it's UP param.
I'm not sure i'm ready to comment on that whole logic, or whether the change is NFC, but the names don't seem particularly wrong there.
LGTM, thanks!
llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp | ||
---|---|---|
957 | nit: it might also be a good opportunity to limit the scope of UnrollFactor to this block, e.g. by if (auto UnrollFactor = shouldFullUnroll(L, TTI, DT, SE, EphValues, TripCount, UCE, UP)) {} |
llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp | ||
---|---|---|
951 | All copies of some exit test, not necessarily the latch exit test. |
All copies of some exit test, not necessarily the latch exit test.