[cfe-users] llvm-mca markers prevent loop vectorization

Simon Pilgrim via cfe-users cfe-users at lists.llvm.org
Wed Jun 5 13:25:21 PDT 2019


This is a known (but poorly documented) issue. Please can you raise a 
bug on this?

On 05/06/2019 18:43, Max Marrone via cfe-users wrote:
> The docs for llvm-mca 
> <https://llvm.org/docs/CommandGuide/llvm-mca.html#using-markers-to-analyze-specific-code-blocks> suggest 
> using inline assembly to mark the region that llvm-mca should examine, 
> i.e.
>
> __asm volatile("# LLVM-MCA-BEGIN");
> // ...
> __asm volatile("# LLVM-MCA-END");
>
> However, these directives seem to interfere with auto-vectorization.
>
> <source>:8:3: remark: loop not vectorized: call instruction cannot be 
> vectorized [-Rpass-analysis=loop-vectorize]
>                 __asm volatile("# LLVM-MCA-BEGIN sum_marked");
>                 ^
>
> <source>:6:2: remark: loop not vectorized: read with atomic ordering 
> or volatile read [-Rpass-analysis=loop-vectorize]
>         for (size_t index = 0; index < count; index++)
>         ^
>
> <https://godbolt.org/z/NSQchu>
> Compiler Explorer link. <https://godbolt.org/z/NSQchu>
>
> Any ideas for a workaround, other than compiling unmarked source and 
> then manually inserting markers into the emitted assembly?
>
> _______________________________________________
> cfe-users mailing list
> cfe-users at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20190605/4f6a3050/attachment.html>


More information about the cfe-users mailing list