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

Max Marrone via cfe-users cfe-users at lists.llvm.org
Wed Jun 5 10:43:45 PDT 2019


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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20190605/b70fad3c/attachment.html>


More information about the cfe-users mailing list