This is pulled out of D75069, where I somewhat accidentally removed some unneeded block masks when we don't have any reductions. This is the same thing as a separate patch, and shouldn't have any effect on codegen.
Details
Diff Detail
Event Timeline
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | ||
---|---|---|
1307 | Quick question on terminology and "inside" and "outside". |
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | ||
---|---|---|
1307 | Ideally this would go with D75069, where inloop vs outside loop reductions are introduced. Until then this might not be the best language on it's own, but I was planning to commit the two close together in any case. Outside loop reductions are what you would expect from reductions right now: loop: l = load a = add a, l vecreduce(a) Inside loop reductions put the reduction into the loop: loop: l = load a = a + vecreduce(l) So in the short term, this should probably be called "hasReductions()". But with D75069 should make more sense. |
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | ||
---|---|---|
1307 | Thanks for clarifying. I got it, and yes, together with D75069 it makes sense. |
Update this to be a little simpler, not including hasOutOfLoopReductions which turned out to not be needed in the followup.
Quick question on terminology and "inside" and "outside".
getReductionVars() returns "reduction variables found in the loop". Here you're actually checking if there are inside loop reductions. But having inside reductions means there's a statement/loop after the vectorised loop that sums the partial reductions/sums, correct? If so, it's probably worth clarifying this a bit.