Minor cleanup: As these are no longer passed to UnrollLoop(), there is no need to modify them in computeUnrollCount(). Make them non-reference parameters.
Details
Diff Detail
Event Timeline
llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp | ||
---|---|---|
770 | It would be nice to get rid of UseUpperBound as well, but apparently this is still being used by LoopUnrollAndJam in https://github.com/llvm/llvm-project/blob/876de062f94650f9ded56a22b062236f711fcd18/llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp#L177. No test coverage though :( |
llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp | ||
---|---|---|
770 | Ouch, this code is all around terrible isn't it? | |
1164–1165 | I may be missing something, but I think you're changing behavior here. computeUnrollCount appears to indirectly control ULO.Count via this line. Unless I'm misreading this? If I'm not, I'm surprised tests don't cover this. |
llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp | ||
---|---|---|
1164–1165 | I think this is just dead code and have dropped it. UnrollLoop() will clamp the unroll count to the max trip count itself, so this is redundant. Note that TripCount and TripMultiple are also used in the UP.Runtime adjustment below, but computeUnrollCount() only changes TripCount and TripMultiple when fully unrolling, so it shouldn't matter for runtime unrolling. |
It would be nice to get rid of UseUpperBound as well, but apparently this is still being used by LoopUnrollAndJam in https://github.com/llvm/llvm-project/blob/876de062f94650f9ded56a22b062236f711fcd18/llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp#L177. No test coverage though :(