Details
Diff Detail
- Build Status
Buildable 7505 Build 7505: arc lint + arc unit
Event Timeline
| lib/Transforms/Scalar/LoopUnrollPass.cpp | ||
|---|---|---|
| 813 | This check should actually be present along all paths from this function? | |
| 839 | What happens if we early return from this function with result as true, but UP.Count > UP.MaxCount? Perhaps we should be setting the max value at the caller of this function : tryToUnrollLoop() {
....
// computeUnrollCount() decides whether it is beneficial to use upper bound to fully
// unroll the loop.
bool UseUpperBound = false;
bool IsCountSetExplicitly =
computeUnrollCount(L, TTI, DT, LI, SE, &ORE, TripCount, MaxTripCount,
TripMultiple, LoopSize, UP, UseUpperBound);
if (!UP.Count)
return false;
// Unroll factor (Count) must be less or equal to TripCount.
if (TripCount && UP.Count > TripCount)
UP.Count = TripCount;
// Add the check after this?
} | |
| lib/Transforms/Scalar/LoopUnrollPass.cpp | ||
|---|---|---|
| 839 | I think this is the only place that MaxCount wasn't being honored where it should be. The earlier checks that return early are:
| |
LGTM.
Just clarifying: this just honours the user defined max count right (if user hasn't defined the value, it would be UINT_MAX).
That, or the value set by the target hook getUnrollingPreferences(), which is how I originally ran into the bug, when implementing D34533
This check should actually be present along all paths from this function?