ArgumentPromotion should copy all metadata to new Function

Summary:
ArgumentPromotion had code to specifically move the dbg metadata over to
the new function, but other metadata such as the function_entry_count
!prof metadata was not. Replace code that moved dbg metadata with a call
to copyMetadata. The old metadata is automatically removed when the old
Function is removed.

Reviewers: davidxl

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353537 91177308-0d34-0410-b5e6-96231b3b80d8
2 files changed