Pulled this code out into a common isInnerLoopIterationCountInvariant
function as it seems generally useful.
Details
Diff Detail
Event Timeline
include/llvm/Transforms/Utils/LoopUtils.h | ||
---|---|---|
493 | Bike shedding names: I was wondering if "consistent" is the right word here. I think what this function does is best described in the implementation: // Get whether count is invariant to the outer loop I think "invariant" is describing it better. | |
lib/Transforms/Utils/LoopUtils.cpp | ||
1522 | nit: I think I would have called SubLoop InnerLoop. |
Ah, sorry, I now see HasConsistentIterationCounts has been suggested in that other ticket. Oh well, as I said, I was bike shedding names (but still think 'invariant' is better :-)) Anyway, please ignore if you disagree.
I suggested the name because the term 'consistent' was used in the D50062 function's comment (which seems to have been replicated here). That is, invariant could have been used in that original comment as well.
I am fine if using 'invariant', I don't have a preference.
Overall, LGTM in either case.
include/llvm/Transforms/Utils/LoopUtils.h | ||
---|---|---|
493 | I suggested the name because the term 'consistent' was used in the D50062 function's comment (which seems to have been replicated here). 'Invariant' would be ok as well. |
Thanks. I'll go with Invariant as it speaks to what the underlying implementation is doing.
Bike shedding names: I was wondering if "consistent" is the right word here. I think what this function does is best described in the implementation:
I think "invariant" is describing it better.