[llvm-bugs] [Bug 36211] New: [DSE] merge memset into earlier store constant

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Feb 2 08:48:46 PST 2018


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: unassignedbugs at nondot.org
          Reporter: spatel+llvm at rotateright.com
                CC: llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180202/9f4f295e/attachment.html>


More information about the llvm-bugs mailing list