[LLVMbugs] [Bug 11896] New: [DSE] Dead store elimination doesn't know about memset_pattern or calloc

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jan 31 03:41:20 PST 2012


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

             Bug #: 11896
           Summary: [DSE] Dead store elimination doesn't know about
                    memset_pattern or calloc
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: clattner at apple.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


The example in PR5117 is now optimized to:

  %call = tail call i8* @calloc(i64 10000, i64 4) nounwind
  %0 = bitcast i8* %call to i32*
  call void @llvm.memset.p0i8.i64(i8* %call, i8 0, i64 40000, i32 4, i1 false)
  call void @memset_pattern16(i8* %call, i8* bitcast ([4 x i32]*
@.memset_pattern to i8*), i64 40000) nounwind

The first memset is dead, because calloc provides zero-filled memory.  Further,
the memset_pattern makes both the memset and the calloc-ness dead.  This could
be replaced with a call to malloc + memset_pattern16.

-Chris

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