[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)
commitfa946233b4e1ad857ecc4b14cec1f31c40eb94fa
tree3205853dcc4e35bd98bb4a7b5f360da8325337fd
parenta7970f3cf8eb0f3b2f46081aec7be0b70dfe5692
[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

llvm-svn: 247313
llvm/lib/Transforms/IPO/MergeFunctions.cpp
llvm/test/Transforms/MergeFunc/apply_function_attributes.ll
llvm/test/Transforms/MergeFunc/inttoptr-address-space.ll
llvm/test/Transforms/MergeFunc/inttoptr.ll