[LLVMbugs] [Bug 22583] New: [EarlyCSE] Missed trivial dead store case

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Feb 13 16:33:58 PST 2015


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

            Bug ID: 22583
           Summary: [EarlyCSE] Missed trivial dead store case
           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

Early CSE currently does not handle this case:
; Function Attrs: readonly
declare void @readmem() #0

define void @test(i64* %ptr) {
  %v = load i64* %ptr
  store i64 %v, i64* %ptr
  call void @readmem()
  ret void
}

attributes #0 = { readonly }

The store is dead since it's writing back the same value which was read.  Given
both are simple (non volatile, non ordered) the store can just be removed.

EarlyCSE has all the information to do this.  Load is part of the available
load set.  We know we haven't crossed an ordering set (if available load set is
non-empty).

-- 
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/20150214/f1da728b/attachment.html>


More information about the llvm-bugs mailing list