This calls emitOptimizationRemark from the loop unroller and vectorizer
at the point where they make a positive transformation.
Details
Diff Detail
Event Timeline
Thanks for working on this!
include/llvm/Analysis/LoopInfo.h | ||
---|---|---|
465 | Why are you looking in the pre-header first? That does not seem to make sense because the start of the preheader could be pretty far away from the start of the loop. Maybe looking in the preheader makes sense, but you should specifically look for the *last* location somehow I'd think. | |
lib/Transforms/Utils/LoopUnroll.cpp | ||
242 | This message should be improved. If I unroll a loop with 5 iterations, I've not unrolled it 5 times -- then I'd have 25 iterations ;) How about: "completely unrolled loop with N iterations". | |
246 | Here too, maybe something like: "unrolled loop by a factor of N" | |
lib/Transforms/Vectorize/LoopVectorize.cpp | ||
1201 | Sounds like we're calling this "interleaving factor". The capitalization seems odd here, nothing else is capitalized. |
lib/Transforms/Vectorize/LoopVectorize.cpp | ||
---|---|---|
1197 | Your code will report loop as vectorized even if it was only unrolled. InnerLoopVectorizer LB(L, SE, LI, DT, DL, TLI, VF.Width, UF); LB.vectorize(&LVL); ++LoopsVectorized; } and above. Is it the desired behavior? |
Good point, vectorized with VF == 1 is confusing. We should report the VF == 1 cases as just, 'unrolled with interleaving factor N'.
(We should also also say "interleave factor" or "unrolling interleave factor" in the regular case; we've decided to use the "interleave" terminology for the associated pragma).
You don't need to add metadata to
test/Transforms/LoopVectorize/X86/vectorization-remarks.ll
And if optimization remarks are only emitted in DEBUG (or RELEASE+ASSERTS) build, please add the following line in the beginning of your file. Thanks.
REQUIRES: asserts
Why are you looking in the pre-header first? That does not seem to make sense because the start of the preheader could be pretty far away from the start of the loop.
Maybe looking in the preheader makes sense, but you should specifically look for the *last* location somehow I'd think.