[PATCH] D30899: [InlineCost] CallPenalty knob to provide custom values

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 13 18:01:16 PDT 2017


efriedma added inline comments.


================
Comment at: include/llvm/Analysis/InlineCost.h:80
+  InlineCost(int Cost, int Threshold, int CallPenalty)
+      : Cost(Cost), Threshold(Threshold), CallPenalty(CallPenalty) {}
 
----------------
It seems kind of weird to return the CallPenalty here... but I guess you need it in lib/Transforms/IPO/Inliner.cpp?


================
Comment at: include/llvm/Analysis/InlineCost.h:92
   static InlineCost getNever() {
-    return InlineCost(NeverInlineCost, 0);
+    return InlineCost(NeverInlineCost, 0, INT_MIN);
   }
----------------
Using INT_MIN and INT_MAX seems like it's just asking for trouble with overflow... but I guess we don't actually use it in that case?  Seems better to just use 0.


================
Comment at: lib/Analysis/InlineCost.cpp:1235
 
+  updateCallPenaltyValue();
+
----------------
The call penalty should be the same for every callsite; we shouldn't need to update it here... unless you're planning to change that?


https://reviews.llvm.org/D30899





More information about the llvm-commits mailing list