[llvm-bugs] [Bug 50339] New: [Regression] MemorySSA DSE fails to remove redundant memcpy

via llvm-bugs llvm-bugs at lists.llvm.org
Fri May 14 03:17:35 PDT 2021


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

            Bug ID: 50339
           Summary: [Regression] MemorySSA DSE fails to remove redundant
                    memcpy
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: david.bolvansky at gmail.com
                CC: llvm-bugs at lists.llvm.org

extern char a[32];

void f (const void *s)
{
  char *p = (char*)__builtin_memcpy (a, s, 16) + 16;
  __builtin_memcpy (p - 16, s, 16);
}

Regressed with LLVM 12.

Current IR:
@a = external dso_local local_unnamed_addr global [32 x i8], align 16

define dso_local void @_Z1fPKv(i8* nocapture readonly %0) local_unnamed_addr #0
{
  tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 16
dereferenceable(16) getelementptr inbounds ([32 x i8], [32 x i8]* @a, i64 0,
i64 0), i8* nonnull align 1 dereferenceable(16) %0, i64 16, i1 false)
  tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 16
dereferenceable(16) getelementptr inbounds ([32 x i8], [32 x i8]* @a, i64 0,
i64 0), i8* nonnull align 1 dereferenceable(16) %0, i64 16, i1 false)
  ret void
}



https://godbolt.org/z/vdTGjdTvn

-- 
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/20210514/8fd0e11f/attachment.html>


More information about the llvm-bugs mailing list