[llvm-dev] Detect auto vectorization in LLVM IR

mats petersson via llvm-dev llvm-dev at lists.llvm.org
Mon Aug 7 09:10:38 PDT 2017


Why do you need to know the original basic-block? Surely if you are
replacing vector of 8*float with 4*float, all you need to do is double up
the actual operations? Anything else is unlikely to work in ALL cases,
since the outer code may do non-obvious things based on having [for
example] 8 elements per vector - it may have unrolled all or part of a
loop, just to give a single example. [And watch for conversions from
8*float to 8*int and similar operations, that later lead to a conditional
statement - this could get quite a challenge in the "unvectorize" case, as
you need to understand how to split the conditions apart and maintain the
same functionality.

I personally would have thought it easier to only let the vectorizer
generate 4*float IR in the first place.... :)

--
Mats

On 7 August 2017 at 17:01, Yihan Pang via llvm-dev <llvm-dev at lists.llvm.org>
wrote:

> Hi All,
>
> Is there an easy way to detect whether auto vectorization had happened
> in the IR level. Currently, I am trying to modify SIMD width at IR
> level (changing from <8 *float > to <4 *float> etc). However, I am
> having hard time to detect the exact basic block that is used for
> vector.body. For now I am using more a worse method that detecting
> instruction pattern that existed in the vector.body of my IR which i
> am certain will not be able to apply to broader cases.
>
>
> Best,
> Yihan
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170807/4f84ed2b/attachment.html>


More information about the llvm-dev mailing list