[LLVMbugs] [Bug 20804] New: [EarlyCSE, Missed Opt] Prefer to remove later store where possible

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Aug 29 13:48:49 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20804

            Bug ID: 20804
           Summary: [EarlyCSE, Missed Opt] Prefer to remove later store
                    where possible
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: listmail at philipreames.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12954
  --> http://llvm.org/bugs/attachment.cgi?id=12954&action=edit
Failing test case for missed optimization

In EarlyCSE, we perform a simple dead store elimination step.  If we encounter
a clobbering store after having already seen a store to the same location, we
can remove the first store.  This is correct, but it would be better to remove
the later store where possible.  This would avoid the need to advance the
generation number and would enable value forwarding across the second store.  

We can only do this if a) the later store doesn't alias any of the current
generations loads, and b) the two stores store the same value.

I've attached a simple test case that shows the desired optimization.

-- 
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/20140829/d218c965/attachment.html>


More information about the llvm-bugs mailing list