[LLVMbugs] [Bug 5574] New: bitcast thwarts dead store elimination

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Nov 20 15:04:19 PST 2009


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

           Summary: bitcast thwarts dead store elimination
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Scalar Optimizations
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: nlewycky at google.com
                CC: llvmbugs at cs.uiuc.edu


In this reduced testcase, the lifetime.end isn't killing the store:

  declare void @llvm.lifetime.start(i64, i8* nocapture) nounwind
  declare void @llvm.lifetime.end(i64, i8* nocapture) nounwind

  define void @test(i32* %P) {
    %Q = getelementptr i32* %P, i32 1
    %R = bitcast i32* %Q to i8*
    call void @llvm.lifetime.start(i64 4, i8* %R)
    store i32 0, i32* %Q  ;; This store is dead.
    call void @llvm.lifetime.end(i64 4, i8* %R)
    ret void
  }

this is reduced from real-world code where %P represents a stack and %Q is
stacktop.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list