[PATCH] D81687: InlineCostAnnotationPrinterPass - preparational patch. Renaming structs, renaming flag, refactoring

Kirill Naumov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 11 13:47:57 PDT 2020


knaumov created this revision.
knaumov added reviewers: mtrofin, apilipenko, davidxl, fedor.sergeev.
Herald added subscribers: llvm-commits, haicheng, hiraditya, eraman.
Herald added a project: LLVM.

This patch is a preparational stage for introducing a new printing pass and new
functionality to the existing Annotation Writer. Right now, CostAnnotationWriter
deals only with the cost/threshold difference per instruction. I plan to extend
this functionality for this tool to be more useful when looking at the inline
process. This patch deals with several key points:

- Renaming the class inherited from the Annotation Writer to better reflected its future, more generalized purposes : CostAnnotationWriter -> InlineCostAnnotationWriter
- Renaming the flag that enables this annotation to reflect its generalization as well: PrintDebugInstructionDeltas -> PrintInstructionComments
- Instead of storing all the information in the Annotation Writer class, we want to have public API from InlineCostCallAnalyzer class to retrieve information from it. For this purpose, the DenseMap from Instruction to InstructionCostDetail struct is hoisted to the InlineCostCallAnalyzer class and the getter for it is created.
- Some of the tests that used this functionality before were changed appropriately

This patch is the first part of D81016 <https://reviews.llvm.org/D81016>. The second patch will be introducing the printer pass.


https://reviews.llvm.org/D81687

Files:
  llvm/lib/Analysis/InlineCost.cpp
  llvm/test/Transforms/Inline/debuginline-cost-delta.ll
  llvm/test/Transforms/Inline/print-instructions-deltas-unfinished.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81687.270222.patch
Type: text/x-patch
Size: 7598 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200611/f237c871/attachment.bin>


More information about the llvm-commits mailing list