[llvm-bugs] [Bug 42173] New: llvm-mca markers interfere with loop vectorization

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jun 6 16:18:02 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=42173

            Bug ID: 42173
           Summary: llvm-mca markers interfere with loop vectorization
           Product: libraries
           Version: 8.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Loop Optimizer
          Assignee: unassignedbugs at nondot.org
          Reporter: max at marrone.nyc
                CC: llvm-bugs at lists.llvm.org

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,
e.g.

> for(size_t index = 0; index < count; index++)
> {
>     __asm volatile("# LLVM-MCA-BEGIN");
>     result += source[index];
>     __asm volatile("# LLVM-MCA-END");
> }

However, these directives prevent 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++)
>         ^

Compiler Explorer demo, on Clang 8.0.0: https://godbolt.org/z/NSQchu

We should be able to use llvm-mca markers without affecting optimization and
code generation.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190606/674ede4a/attachment.html>


More information about the llvm-bugs mailing list