OSDN Git Service

[DeadArgumentElim] Clone function level metadatas
authorRong Xu <xur@google.com>
Mon, 2 Apr 2018 17:27:38 +0000 (17:27 +0000)
committerRong Xu <xur@google.com>
Mon, 2 Apr 2018 17:27:38 +0000 (17:27 +0000)
commit282ca2a3b13320f792e3c7123bc1be4bbd6e3138
treef337a3b190c5d508c336798a0982c340c7e2cd30
parentb96411e42907531d9f0364ce9f90ccae365dcaf8
[DeadArgumentElim] Clone function level metadatas

Some Function level metadatas, such as function entry count, are not cloned in
DeadArgumentElim. This happens a lot in lto/thinlto because of DeadArgumentElim
after internalization.

This patch clones the metadatas in the original function to the new function.

Differential Revision: https://reviews.llvm.org/D44127

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328991 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/DeadArgumentElimination.cpp
test/Transforms/DeadArgElim/func_metadata.ll [new file with mode: 0644]