Fix the InstCombine to reserve the VP metadata and sets correct call count.
authorDehao Chen <dehao@google.com>
Fri, 31 Mar 2017 15:59:52 +0000 (15:59 +0000)
committerDehao Chen <dehao@google.com>
Fri, 31 Mar 2017 15:59:52 +0000 (15:59 +0000)
commitfed890ea3a948170438a963b60acc158858a7d98
tree55b531fd6959f1a265197845ae2fa36fa9bad240
parentf1a30f18008de1a71e2a82528c3e8689fef070bb
Fix the InstCombine to reserve the VP metadata and sets correct call count.

Summary: Currently the VP metadata was dropped when InstCombine converts a call to direct call. This patch converts the VP metadata to branch_weights so that its hotness is recorded.

Reviewers: eraman, davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

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

llvm-svn: 299228
llvm/lib/IR/Metadata.cpp
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/test/Transforms/InstCombine/cast-call-combine-prof.ll [new file with mode: 0644]