https://bugs.llvm.org/show_bug.cgi?id=36211

            Bug ID: 36211
           Summary: [DSE] merge memset into earlier store constant
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedb...@nondot.org
          Reporter: spatel+l...@rotateright.com
                CC: llvm-bugs@lists.llvm.org

If I've understood correctly, this is an example of the optimization request
made in bug 36129:

declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1)

define void @merge_memset_into_earlier_constant_store(i8* %p) {
  %p8 = bitcast i8* %p to i64*
  store i64 0, i64* %p8, align 1
  %p5 = getelementptr i8, i8* %p, i64 5
  tail call void @llvm.memset.p0i8.i64(i8* align 1 %p5, i8 42, i64 3, i1 false)
  ret void
}

----------------------------------------------------------------------------

DSE knows how to merge constant stores when they are actual store instructions,
but it doesn't know how to handle this case where we overwrite the last 3 bytes
of p[8] using a memset().

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to