[llvm-bugs] [Bug 52055] New: Failure to optimize integer vector conversion to float vector properly when integer vector is larger

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Oct 3 14:55:20 PDT 2021


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

            Bug ID: 52055
           Summary: Failure to optimize integer vector conversion to float
                    vector properly when integer vector is larger
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: gabravier at gmail.com
                CC: llvm-bugs at lists.llvm.org

typedef int v8si __attribute__((vector_size(32)));
typedef float v4sf __attribute__((vector_size(16)));

void low (v4sf *dst, v8si *srcp)
{
  v8si src = *srcp;
  *dst = (v4sf) { (float)src[0], (float)src[1], (float)src[2], (float)src[3] };
}

This can be optimized equivalently to replacing the first statement with `auto
src = *(int __attribute__((vector_size(16)))*)srcp;` (non-withstanding
aliasing). This optimization is done by GCC, but not by LLVM.

-- 
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/20211003/6588a48a/attachment.html>


More information about the llvm-bugs mailing list