[PATCH] D71501: Cost Annotation Writer for InlineCost

Artur Pilipenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 20 15:09:47 PST 2020


apilipenko added inline comments.


================
Comment at: llvm/lib/Analysis/InlineCost.cpp:51-57
+static cl::opt<bool> EnableInstructionDetail("print-instruction-detail",
+    cl::Hidden, cl::init(false),
+    cl::desc("Prints information on cost and threshold per instruction"));
+
+static cl::opt<bool> EnableInstructionDelta("print-instruction-delta",
+    cl::Hidden, cl::init(false),
+    cl::desc("Prints deltas of cost and threshold per instruction"));
----------------
Suggest to print all the details under one flag.  


================
Comment at: llvm/lib/Analysis/InlineCost.cpp:108
+
+// This struct is used to store information about inlining an instruction
+struct InliningCostDetail {
----------------
// This struct is used to store information about inline cost of a particular instruction


================
Comment at: llvm/lib/Analysis/InlineCost.cpp:109
+// This struct is used to store information about inlining an instruction
+struct InliningCostDetail {
+  int CostBefore;
----------------
Suggest `InstructionCostDetail`.


================
Comment at: llvm/lib/Analysis/InlineCost.cpp:120-123
+  llvm::DenseMap <const Instruction *, InliningCostDetail> CostThresholdMap;
+
+  virtual void emitInstructionAnnot(const llvm::Instruction *I,
+                                    llvm::formatted_raw_ostream &OS);
----------------
No need to use llvm:: namespace prefix.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71501/new/

https://reviews.llvm.org/D71501





More information about the llvm-commits mailing list