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

            Bug ID: 51471
           Summary: LICM incorrect load/store promotion in presence of
                    poison
           Product: libraries
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Loop Optimizer
          Assignee: unassignedb...@nondot.org
          Reporter: d.malju...@yandex.ru
                CC: llvm-bugs@lists.llvm.org

Created attachment 25131
  --> https://bugs.llvm.org/attachment.cgi?id=25131&action=edit
reproducer, run with opt -licm

If there are two groups of memory accesses in the loop all to the same memory
but one is done via "poisoned" pointer, basic-aa can just place them into two
non-aliasing sets. LICM would then promote both of these groups leading to a
miscompile: https://llvm.godbolt.org/z/KKxdb5e9v
The load/store with a poison pointer is a dead code and would never execute at
runtime.
Similar IR was produced on an actual example after value propagation through a
switch case.

-- 
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