[PATCH] D147954: [SimplifyCFG]Prevent premature simplification of indirect callsites with profile data
Mingming Liu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 18 08:13:17 PDT 2023
mingmingl planned changes to this revision.
mingmingl added a comment.
In D147954#4276844 <https://reviews.llvm.org/D147954#4276844>, @nikic wrote:
> Could you please start by implementing metadata merging, and then return to this patch only if strictly necessary? I'd rather not have another SimplifyCFG option for such a niche use case, if it's possible to get most of the benefit via standard metadata merging.
(quick reply to describe the plan) okay, let me implement something as described and see how it works for this use case
1. do metadata merging for direct callsites 2) conservatively not hoisting/sinking indirect callsites for indirect callsites if `!prof` presents -> indirect-call-promotion pass will clear `!prof` for indirect-callsite (since there are no other uses of this type of value profiles) so the SimplifyCFG pass after indirect-call-promotion should be able to do a full cleanup if the indirect-call is still in the IR but not speculatively devirtualized.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D147954/new/
https://reviews.llvm.org/D147954
More information about the llvm-commits
mailing list