[llvm-bugs] [Bug 46081] New: Consecutive and adjacent calls to memcpy are not merged.

via llvm-bugs llvm-bugs at lists.llvm.org
Tue May 26 11:49:20 PDT 2020


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

            Bug ID: 46081
           Summary: Consecutive and adjacent calls to memcpy are not
                    merged.
           Product: clang
           Version: 10.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: peter.fordham at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

In this example memcpy is called 1024 times with consequtive calls to directly
adjacent ememory locations. This could be reduce to a single call to memcpy.
https://godbolt.org/z/taKi4G

Replacing the assignment in the loop with std::copy, here
https://godbolt.org/z/H3DsN9 correctly only calls memcpy once.

-- 
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/20200526/0ecdc452/attachment.html>


More information about the llvm-bugs mailing list