Add support to GVN for performing sret return slot optimization. This means that...
authorOwen Anderson <resistor@mac.com>
Mon, 18 Feb 2008 09:24:53 +0000 (09:24 +0000)
committerOwen Anderson <resistor@mac.com>
Mon, 18 Feb 2008 09:24:53 +0000 (09:24 +0000)
commit5aa4f2a0857563b4ad9115c614afed9501aa58f4
treed1def04f316ef138fc6afe4cb5a91349cfe71054
parent874a892c9969fbbe50a5017868c2f82923632b29
Add support to GVN for performing sret return slot optimization.  This means that, if an sret function tail calls
another sret function, it should pass its own sret parameter to the tail callee, allowing it to fill in the correct
return value.  llvm-gcc does not emit this by default.  Instead, it allocates space in the caller for the sret of
the tail call and then uses memcpy to copy the result into the caller's sret parameter.  This optimization detects
and optimizes that case.

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