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

2019-06-05 Thread Max Marrone via cfe-users
The docs for llvm-mca

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.

:8:3: remark: loop not vectorized: call instruction cannot be
vectorized [-Rpass-analysis=loop-vectorize]
__asm volatile("# LLVM-MCA-BEGIN sum_marked");
^

: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++)
^


Compiler Explorer link. 

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@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users


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

2019-06-05 Thread Simon Pilgrim via cfe-users
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 
 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.

:8:3: remark: loop not vectorized: call instruction cannot be 
vectorized [-Rpass-analysis=loop-vectorize]

                __asm volatile("# LLVM-MCA-BEGIN sum_marked");
                ^

: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++)
        ^


Compiler Explorer link. 

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@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users
___
cfe-users mailing list
cfe-users@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users