[all-commits] [llvm/llvm-project] 80cde0: [MemCpyOpt] Add separate statistic for call slot o...

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Oct 6 09:38:12 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 80cde02e85df3f1903f0a04ccccaf0f84c2854d1
      https://github.com/llvm/llvm-project/commit/80cde02e85df3f1903f0a04ccccaf0f84c2854d1
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2020-10-06 (Tue, 06 Oct 2020)

  Changed paths:
    M llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp

  Log Message:
  -----------
  [MemCpyOpt] Add separate statistic for call slot optimization (NFC)


  Commit: 6b441ca523cd6be9475106408a60989ad1f5ae55
      https://github.com/llvm/llvm-project/commit/6b441ca523cd6be9475106408a60989ad1f5ae55
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2020-10-06 (Tue, 06 Oct 2020)

  Changed paths:
    M llvm/include/llvm/Transforms/Scalar/MemCpyOptimizer.h
    M llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
    M llvm/test/Transforms/MemCpyOpt/callslot.ll

  Log Message:
  -----------
  [MemCpyOpt] Check for throwing calls during call slot optimization

When performing call slot optimization for a non-local destination,
we need to check whether there may be throwing calls between the
call and the copy. Otherwise, the early write to the destination
may be observable by the caller.

This was already done for call slot optimization of load/store,
but not for memcpys. For the sake of clarity, I'm moving this check
into the common optimization function, even if that does need an
additional instruction scan for the load/store case.

As efriedma pointed out, this check is not sufficient due to
potential accesses from another thread. This case is left as a TODO.

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


Compare: https://github.com/llvm/llvm-project/compare/f78bb4d84eee...6b441ca523cd


More information about the All-commits mailing list