[all-commits] [llvm/llvm-project] 369c9b: [MemCpyOpt] Require writable object during call sl...

Nikita Popov via All-commits all-commits at lists.llvm.org
Thu Nov 9 06:55:58 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 369c9b791bc3f380e884bcad444287998c32ae16
      https://github.com/llvm/llvm-project/commit/369c9b791bc3f380e884bcad444287998c32ae16
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-11-09 (Thu, 09 Nov 2023)

  Changed paths:
    M llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
    M llvm/test/Transforms/MemCpyOpt/callslot.ll
    M llvm/test/Transforms/MemCpyOpt/callslot_deref.ll
    M llvm/test/Transforms/MemCpyOpt/callslot_noalias.ll
    M llvm/test/Transforms/MemCpyOpt/loadstore-sret.ll
    M llvm/test/Transforms/MemCpyOpt/memcpy.ll
    M llvm/test/Transforms/MemCpyOpt/sret.ll

  Log Message:
  -----------
  [MemCpyOpt] Require writable object during call slot optimization (#71542)

Call slot optimization may introduce writes to the destination object
that occur earlier than in the original function. We currently already
check that that the destination is dereferenceable and aligned, but we
do not make sure that it is writable. As such, we might introduce a
write to read-only memory, or introduce a data race.

Fix this by checking that the object is writable. For arguments, this is
indicated by the new writable attribute. Tests using
sret/dereferenceable are updated to use it.




More information about the All-commits mailing list