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: unassignedb...@nondot.org
          Reporter: mikael.hol...@ericsson.com
                CC: llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to