[llvm-bugs] [Bug 49859] New: Miscompile with opt -licm -dse (due to bad memoryssa?)

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Apr 6 04:40:58 PDT 2021


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

            Bug ID: 49859
           Summary: Miscompile with opt -licm -dse (due to bad memoryssa?)
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: mikael.holmen at ericsson.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 24721
  --> https://bugs.llvm.org/attachment.cgi?id=24721&action=edit
bbi-54825_man_red.ll reproducer

Running
 opt -enable-new-pm=0 -licm -dse bbi-54825_man_red.ll -S -o -
all stores to %sum are removed by dse. this then makes
  %3 = load i8, i8* %sum, align 1
get the wrong value.

If we instead run
 opt -enable-new-pm=0 -licm bbi-54825_man_red.ll -S -o - | opt -enable-new-pm=0
-dse -S -o -
several stores to %sum remains.

The same thing happens if we remove 
      AU.addPreserved<MemorySSAWrapperPass>();
from LICM.cpp.

Thus I think that LICM doesn't update memoryssa information as it should.

This looks very similar to an old bug:
https://bugs.llvm.org/show_bug.cgi?id=45927

-- 
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/421aed76/attachment.html>


More information about the llvm-bugs mailing list