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

            Bug ID: 35143
           Summary: Failure to delete dead store
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedb...@nondot.org
          Reporter: chisophu...@gmail.com
                CC: llvm-bugs@lists.llvm.org

struct S {
  int x[5];
};

S get_S();

void foo() {
  S s = get_S();
  s.x[5] = 8;
}


https://godbolt.org/g/QcpRBY

Clang does not delete the store to `s.x[5] = 8`.


Looking at the IR, the pointer out argument passed to get_S seems to be marked
as `sret`. I don't know if that is strong enough to allow inferring `noescape`
on the pointer, but even manually adding `noescape` I don't see that store
being deleted by the O2 pipeline.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to