[LLVMbugs] [Bug 2599] New: Missed DSE case

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Jul 25 16:45:21 PDT 2008


           Summary: Missed DSE case
           Product: libraries
           Version: 1.0
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: code-quality
          Severity: normal
          Priority: P2
         Component: Scalar Optimizations
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: clattner at apple.com
                CC: llvmbugs at cs.uiuc.edu

DSE should delete a store to a location when the stored value is the same as
the loaded one.  For example:

void foo(_Complex int *x) {
  *x = ~*x;

compiles to:

define void @foo({ i32, i32 }* %x) nounwind  {
        getelementptr { i32, i32 }* %x, i32 0, i32 0            ; <i32*>:0
        load i32* %0, align 4           ; <i32>:1 [#uses=1]
        getelementptr { i32, i32 }* %x, i32 0, i32 1            ; <i32*>:2
        load i32* %2, align 4           ; <i32>:3 [#uses=1]
        sub i32 0, %3           ; <i32>:4 [#uses=1]
        store i32 %1, i32* %0, align 4
        store i32 %4, i32* %2, align 4
        ret void

The load+store to %0 should be nuked, which would happen if DSE deleted the
store to %0.

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