[PATCH] D58399: [Inliner] Don't initialize ComputeFullInlineCost to be always true because of ORE

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 19 16:18:47 PST 2019


wmi marked an inline comment as done.
wmi added inline comments.


================
Comment at: lib/Analysis/InlineCost.cpp:2008-2012
+  OptimizationRemarkEmitter NewORE(Callee);
+  if (!ORE &&
+      Callee->getContext().getDiagHandlerPtr()->isMissedOptRemarkEnabled(
+          DEBUG_TYPE))
+    ORE = &NewORE;
----------------
wmi wrote:
> chandlerc wrote:
> > you can just set `ORE` to `nullptr` here?
> I don't get the idea. Could you explain it? Setting ORE to nullptr here then it won't compute the full inline cost even if -Rpass=inline* is used.
Easwaran discussed with me offline. I think he has the same suggestion with you -- pass RemarksEnabled as another parameter of getInlineCost and set ORE here, so as to avoid creating another Emitter inside of getInlineCost. I will update the patch accordingly.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D58399





More information about the llvm-commits mailing list