Allow call-slop optzn for destinations with a suitable dereferenceable attribute
authorBjorn Steinbrink <bsteinbr@gmail.com>
Thu, 16 Oct 2014 19:43:08 +0000 (19:43 +0000)
committerBjorn Steinbrink <bsteinbr@gmail.com>
Thu, 16 Oct 2014 19:43:08 +0000 (19:43 +0000)
commit6eaa62af77fbf5f950741b284672b676665ba07f
tree334d26269e517e6586ff111804229a4599fa6dd1
parent0ab5b9f64756835a291eea9ca4dff283a3cb2ded
Allow call-slop optzn for destinations with a suitable dereferenceable attribute

Summary:
Currently, call slot optimization requires that if the destination is an
argument, the argument has the sret attribute. This is to ensure that
the memory access won't trap. In addition to sret, we can also allow the
optimization to happen for arguments that have the new dereferenceable
attribute, which gives the same guarantee.

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D5832

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219950 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/MemCpyOptimizer.cpp
test/Transforms/MemCpyOpt/callslot_deref.ll [new file with mode: 0644]