[llvm-bugs] [Bug 46847] New: [SimplifyCFG?] Common code sinking: failure to merge stores to the same ptr

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jul 25 09:23:00 PDT 2020


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

            Bug ID: 46847
           Summary: [SimplifyCFG?] Common code sinking: failure to merge
                    stores to the same ptr
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: lebedev.ri at gmail.com
                CC: llvm-bugs at lists.llvm.org

void src(uint32_t& Storage) {
  if(Storage == 1)
    Storage |= INT_MIN;
  ++Storage;
}
void tgt(uint32_t& Storage) {
  ++Storage;
  if(Storage == 2)
    Storage |= INT_MIN;
}

^ these are identical https://alive2.llvm.org/ce/z/aJN6Sz
but in the first case we fail to flatten the cfg, and merge stores

https://godbolt.org/z/8Yq9TE

-- 
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/20200725/050fd852/attachment.html>


More information about the llvm-bugs mailing list