[llvm-bugs] [Bug 49858] New: Failure to convert 'sub' reduction to negated 'add' reduction

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Apr 6 03:34:44 PDT 2021


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

            Bug ID: 49858
           Summary: Failure to convert 'sub' reduction to negated 'add'
                    reduction
           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

Split off from [Bug#42674 Comment#20]

https://godbolt.org/z/vfd8oGvaT

We fail to match subtraction reductions as addition reductions followed by a
negation.

int sub32(const int *data)
{
    int result = 0;
    for(unsigned n=0; n<16; ++n) result -= data[n];
    return result;
}

int sub32(const int *data, int start_value)
{
    int result = start_value;
    for(unsigned n=0; n<16; ++n) result -= data[n];
    return result;
}

-- 
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/20210406/fa8d2edb/attachment.html>


More information about the llvm-bugs mailing list