summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorwhitequark <whitequark@whitequark.org>2018-05-15 11:31:07 +0000
committerwhitequark <whitequark@whitequark.org>2018-05-15 11:31:07 +0000
commit8f0ab258bd9701c755946890331ccada29b781b7 (patch)
tree8dc8a53d4fe6bf7a7e97a7045c7b59e99d3afee6 /clang/lib
parentce5d3d657a25a04331b8a66798b06cd602bf3c4f (diff)
downloadbcm5719-llvm-8f0ab258bd9701c755946890331ccada29b781b7.tar.gz
bcm5719-llvm-8f0ab258bd9701c755946890331ccada29b781b7.zip
[MergeFunctions] Fix merging of small weak functions
When two interposable functions are merged, we cannot replace uses and have to emit calls to a common internal function. However, writeThunk() will not actually emit a thunk if the function is too small. This leaves us in a broken state where mergeTwoFunctions already rewired the functions, but writeThunk doesn't do anything. This patch changes the implementation so that: * writeThunk() does just that. * The direct replacement of calls is moved into mergeTwoFunctions() into the non-interposable case only. * isThunkProfitable() is extracted and will be called for the non-iterposable case always, and in the interposable case only if uses are still left after replacement. This issue has been introduced in https://reviews.llvm.org/D34806, where the code for checking thunk profitability has been moved. Differential Revision: https://reviews.llvm.org/D46804 Reviewed By: whitequark llvm-svn: 332342
Diffstat (limited to 'clang/lib')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud