[llvm-bugs] [Bug 28013] Incorrect optimization of memmove in DSE

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jun 25 04:08:07 PDT 2020


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

Florian Hahn <florian_hahn at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
                 CC|                            |florian_hahn at apple.com
 Fixed By Commit(s)|                            |737fa40ffad15482801cc60271a
                   |                            |ed40dd5de9c95

--- Comment #1 from Florian Hahn <florian_hahn at apple.com> ---
Looks like this works as expected with clang version 11.0.0
(git at github.com:llvm/llvm-project.git 14ff6c896344e0440fc1cf7921d96515a9d50d8d)


A quick git log search surfaced the commit below as probably fixing it

commit 737fa40ffad15482801cc60271aed40dd5de9c95
Author: Sanjoy Das <sanjoy at playingwithpointers.com>
Date:   Tue Feb 20 23:19:34 2018 +0000

    [DSE] Don't DSE stores that subsequent memmove calls read from

    Summary:
    We used to remove the first memmove in cases like this:

      memmove(p, p+2, 8);
      memmove(p, p+2, 8);

    which is incorrect.  Fix this by changing isPossibleSelfRead to what was
most
    likely the intended behavior.

    Historical note: the buggy code was added in
https://reviews.llvm.org/rL120974
    to address PR8728.

    Reviewers: rsmith

    Subscribers: mcrosier, llvm-commits, jlebar

    Differential Revision: https://reviews.llvm.org/D43425

    llvm-svn: 325641

-- 
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/20200625/59568c5a/attachment.html>


More information about the llvm-bugs mailing list