Auto vectorization diagnostic infos?

AhmidouAhmidou Posts: 181 ✭✭

Hi,
I was just wondering if there was a way to output the successfully auto vectorized loops while compiling KL code? I've seen that LLVM have some flags related to that, but I can't find the option with KL tool.

Thanks

Tagged:

Comments

  • borjaborja Administrator, Fabric Employee Posts: 480 admin
    edited August 2016

    HI @Ahmidou

    Not sure it is possible to inspect this right now. Will ask the core team!

    Borja Morales
    Technical Product Manager
    Fabric Software Inc.

  • pzionpzion Moderator, Fabric Employee Posts: 118 Fabric Employee

    Hi Ahmidou,

    The only way I know how to do this right now is in the KL tool, and just looking at the output using the --asm flag. In general, however, I would recommend using the vecAdd etc. methods functions that are automatically created for structures whose members are all the same integer or floating-point type; this should guarantee that a vector operation is used if possible on the target hardware.

    Peter Zion
    Fabric Engine

  • AhmidouAhmidou Posts: 181 ✭✭

    Hey @Peter Zion, I'm coming back to this, so I should look for xmm*, or ymm* instruction in the assembly is that right?
    Also there shouldn't be any penalty of using them? I'm asking because I'm wondering why the math lib wasn't build with with them.

    Thanks

  • pzionpzion Moderator, Fabric Employee Posts: 118 Fabric Employee

    It's possible that there is a penalty for using them under certain circumstances where is would make the optimizer have trouble managing the use of the registers, but it's unlikely -- fortunately it's really easy to try it and compare. I'm not sure why the Math extension doesn't use them..

    Peter Zion
    Fabric Engine

  • AhmidouAhmidou Posts: 181 ✭✭

    All right, thanks!
    I'm also wondering how will it choose between sse and avx? is it based on the platform?
    My CPU supports avx but only the xmm registers seems to be used.

Sign In or Register to comment.