When an invoke instruction is converted to a call its profile metadata is dropped because it has incompatible format (see https://reviews.llvm.org/D81996).
This patch adds an attempt to convert profile data to format of the call instruction. This used to work well before the patch https://reviews.llvm.org/D80618.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Seems reasonable, but I don't know that much about profile info.. is it actually useful to have "branch_weights" metadata on a call? Isn't it enough that there's profile info on the branch towards the BB that has the call instruction? Or is this data used for something more?
Branch_weights are useful for call instructions as said in the LLVM LangRef (https://llvm.org/docs/BranchWeightMetadata.html).
Let us wait for @xur to comment.
Branch_weights are useful for call instructions as said in the LLVM LangRef (https://llvm.org/docs/BranchWeightMetadata.html).
Let us wait for @xur to comment.
That doc initially says branch weights are only used on terminators, although I see call instructions mentioned further down. It would be good to get it updated :-)
LGTM
(Just for reference, the total bit tripped me up at first, but the reasoning is that we're converting to a call, not proving the call no throw. We could still throw out.)
We probably should extend the call metadata to the two argument form to explicitly model the difference between normal and throw out.