[MergeFuncs] Fix callsite attributes in thunk generation
authorJF Bastien <jfb@google.com>
Thu, 10 Sep 2015 18:08:35 +0000 (18:08 +0000)
committerJF Bastien <jfb@google.com>
Thu, 10 Sep 2015 18:08:35 +0000 (18:08 +0000)
commit50c9e6310eceb4696b3fb7ea9845cd9c868d4dfc
treedc201d44f7c297a10fd019f9f8379c61d9a8c0b7
parent6ff608fb18a8d0613885b0a6d947c55924ae76ad
[MergeFuncs] Fix callsite attributes in thunk generation

This change correctly sets the attributes on the callsites
generated in thunks. This makes sure things such as sret, sext, etc.
are correctly set, so that the call can be a proper tailcall.

Also, the transfer of attributes in the replaceDirectCallers function
appears to be unnecessary, but until this is confirmed it will remain.

Author: jrkoenig
Reviewers: dschuff, jfb
Subscribers: llvm-commits, nlewycky
Differential revision: http://reviews.llvm.org/D12581

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247313 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/MergeFunctions.cpp
test/Transforms/MergeFunc/apply_function_attributes.ll
test/Transforms/MergeFunc/inttoptr-address-space.ll
test/Transforms/MergeFunc/inttoptr.ll