[llvm-dev] @llvm.memcpy not honoring volatile?

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Wed Jun 5 14:28:22 PDT 2019

On Wed, 5 Jun 2019 at 13:49, Eli Friedman via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> I don’t see any particular reason to guarantee that a volatile memcpy will access each byte exactly once.  How is that useful?

I agree it's probably not that useful, but I think the non-duplicating
property of volatile is ingrained strongly enough that viewing a
memcpy as a single load and store to each unit (in an unspecified
order) should be legitimate; so I think this actually is a bug.

As the documentation says though, it's unwise to depend on the
behaviour of a volatile memcpy.



More information about the llvm-dev mailing list