[llvm-bugs] [Bug 46458] New: [DSE] Stores in loop that are never read are not eliminated

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jun 25 08:51:07 PDT 2020


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

            Bug ID: 46458
           Summary: [DSE] Stores in loop that are never read are not
                    eliminated
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: florian_hahn at apple.com
                CC: llvm-bugs at lists.llvm.org

In the example below, the stores to the local object P are dead, because they
are never read. However LLVM's DSE does not eliminate them (with or without
MemorySSA): https://godbolt.org/z/DvTikR

void init(int *);
int sum(unsigned N, int y) {

    int P[N];

    init(&P[0]);
    int sum = 0;
    for (unsigned i = 0; i < N; i++) {
        int x = P[i] + y;
        P[i] = x;
        sum += x;
    }
    return sum;
}

-- 
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/20200625/418ce0fc/attachment.html>


More information about the llvm-bugs mailing list