[llvm-bugs] [Bug 50817] New: Failure to perform extract with variable index from splat vector

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jun 23 06:42:57 PDT 2021


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

            Bug ID: 50817
           Summary: Failure to perform extract with variable index from
                    splat vector
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: llvm-dev at redking.me.uk
                CC: llvm-bugs at lists.llvm.org, spatel+llvm at rotateright.com

https://c.godbolt.org/z/rq43Wqc5a

#include <x86intrin.h>

auto adjust_splat(float x, float y, int i) {
    __m128 r = _mm_set1_ps(x);
    r[i & 3] += y;
    return r;
}
auto adjust_splat2(float x, float y, int i) {
    __m128 r = _mm_set1_ps(x);
    r[i & 3] = x + y;
    return r;
}

If the variable-index of an extract from a splatted vector is known to be
inrange, we should be safe to use the original scalar directly. 

Not sure if this can be done in IR or we wait until SelectionDAG?

-- 
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/20210623/424aa053/attachment.html>


More information about the llvm-bugs mailing list