[llvm-bugs] [Bug 25612] New: Optimize vadd_s64(vget_low_s64(x), vget_high_s64(x)) as vaddvq_s64(x)

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Nov 23 10:07:07 PST 2015


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

            Bug ID: 25612
           Summary: Optimize vadd_s64(vget_low_s64(x), vget_high_s64(x))
                    as vaddvq_s64(x)
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: AArch64
          Assignee: unassignedbugs at nondot.org
          Reporter: lennox at cs.columbia.edu
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 15338
  --> https://llvm.org/bugs/attachment.cgi?id=15338&action=edit
Test code with sample functions and test they are identical

On Aarch64, clang/LLVM misses an optimization for vadd_s64(vget_low_s64(x),
vget_high_s64(x)).  It can be emitted as addp.2d, in the same way as
vaddvq_s64.

The reason someone would write the former rather than the latter is that the
former is also valid armv7 Neon intrinsic code, whereas the latter is
aarch64-only.  (This arose in actual code, Neon optimizations for the Opus
audio codec.)

See attached test code. The two test functions optimize as:

func1:
        ext     v1.16b, v0.16b, v0.16b, #8
        add     d0, d0, d1
        fmov    x0, d0
        ret


func2:
        addp    d0, v0.2d
        fmov    x0, d0
        ret

even though they have identical behavior.

-- 
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/20151123/dd2cda9d/attachment.html>


More information about the llvm-bugs mailing list