This is an archive of the discontinued LLVM Phabricator instance.

[Inline][Remark][NFC] Optionally provide inline context to inline advisor.
ClosedPublic

Authored by mingmingl on Jun 1 2022, 1:38 PM.

Details

Summary

This patch has no functional change, and is merely a preparation patch for main functional change.

  • Use case of the context information is to annotate inline remark name with context information. See https://reviews.llvm.org/D125495 for use case, and how remark names change (flag gated).
  • The added struct (InlineContext) and enum classes are for general inliner passes, not tied to inline-advisor.

Diff Detail

Event Timeline

mingmingl created this revision.Jun 1 2022, 1:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 1 2022, 1:38 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
mingmingl requested review of this revision.Jun 1 2022, 1:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 1 2022, 1:38 PM
mingmingl updated this revision to Diff 433621.Jun 1 2022, 7:00 PM

Use a general struct name, and add entries for SampleProfileInliner, AlwaysInliner, MLInliner.

Method llvm::AnnotateInlinePassName is supposed to be callable by a general inliner (i.e., not limited to the inliner passes that use an instance of InlineAdvisor).

davidxl accepted this revision.Jun 2 2022, 12:39 PM

LGTM (In the summary, make it clearer that this is the preparation patch (NFC) for main functional change.)

This revision is now accepted and ready to land.Jun 2 2022, 12:39 PM
mingmingl retitled this revision from [Inline][Remark] Optionally provide inline advisor context information to inline advisor. to [Inline][Remark][NFC] Optionally provide inline advisor context information to inline advisor..Jun 2 2022, 12:45 PM
mingmingl edited the summary of this revision. (Show Details)
mingmingl retitled this revision from [Inline][Remark][NFC] Optionally provide inline advisor context information to inline advisor. to [Inline][Remark][NFC] Optionally provide inline context to inline advisor..
mingmingl edited the summary of this revision. (Show Details)
mingmingl updated this revision to Diff 433849.Jun 2 2022, 12:51 PM

Update commit message to the same as Phabricator summary, and a minor comment change

from

/// NOTE pass name is annotated only when `--annotate-inline-phase` is true
 /// and inline advisor constructor provides InlineContext.

to

/// NOTE pass name is annotated only when inline advisor constructor provides InlineContext.
This revision was landed with ongoing or failed builds.Jun 2 2022, 1:15 PM
This revision was automatically updated to reflect the committed changes.