[LLVMdev] First attempt at recognizing pointer reduction
Renato Golin
renato.golin at linaro.org
Mon Oct 21 11:00:09 PDT 2013
Hi Arnold,
To sum up my intentions, I want to understand how the reduction/induction
variable detection works in LLVM, so that I can know better how to detect
different patterns in memory, not just the stride vectorization.
For instance, even if the relationship between each loop would be
complicated, I know that in each loop, all three reads are sequential. So,
at least, I could use a Load<3> rather than three loads. I guess this is
why Nadav was hinting for the SLP vectorizer, not the loop vec. Since the
operation on all three loaded values are exactly the same AND the writes
are also sequential, I can reduce that to: load<3> -> op<3> -> store<3>.
That should work even on machines that don't have de-interleaved access
(assuming they're pointers to simple types, etc).
On 21 October 2013 17:29, Arnold Schwaighofer <aschwaighofer at apple.com>wrote:
> can you post a hand-created vectorized IR of how a reduction would work on
> your example?
>
I'm not there yet, just trying to understand the induction/reduction code
first and what comes out of it.
I think the right approach to get examples like this is that we need to
> recognize strided pointer inductions (we only support strides by one
> currently).
>
I see. I'll have a look at IK_PtrInduction and see what patterns I can spot.
Do you envisage a new IK type for strided induction, or just work with the
PtrInduction to extend the concept of a non-unit stride (ie. separate Step
from ElementSize)?
cheers,
--renato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131021/4320c3b6/attachment.html>
More information about the llvm-dev
mailing list