[PATCH] D22120: Move inline threshold related flags to InlineSimple.cpp

Easwaran Raman via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 8 18:17:26 PDT 2016


I haven't updated the patch. I talked to Chandler offline and I'm modifying
my patch based on that conversation. Will upload the updated version soon.

On Mon, Aug 8, 2016 at 6:12 PM, Xinliang David Li <davidxl at google.com>
wrote:

> Did you forget to update the patch ?
>
> David
>
> On Mon, Aug 8, 2016 at 5:53 PM, Easwaran Raman <eraman at google.com> wrote:
> > eraman marked 2 inline comments as done.
> >
> > ================
> > Comment at: lib/Transforms/IPO/InlineSimple.cpp:79-81
> > @@ +78,5 @@
> > +
> > +  // Generate the parameters to tune the inline cost analysis based on
> > +  // commandline options.
> > +  InlineParams getInlineParams(int Threshold) {
> > +    InlineParams Params;
> > ----------------
> > chandlerc wrote:
> >> Sorry, I guess I wasn't clear before...
> >>
> >> I'm specifically suggesting keeping all of this logic inside of
> InlineCost.cpp as how the *default* parameters get set.
> >>
> >> If we need the ability to get custom parameters which still reflect the
> command line flags, there should be some API in InlineCost.h that the
> inliner queries to get the necessary params.
> >>
> >>
> >> My goal here stems from two related principles:
> >> - The tunable flags and the constants that interact are are
> fundamentally in the same unit domain should live in a single place
> (InlineCost.{h,cpp}).
> >> - The inliner *passes* should have no real logic to compute thresholds,
> they should call well documented APIs provided by the cost layer.
> >>
> >> A minor secondary goal -- the inliner shouldn't have to do extra work
> to get the defaults. Those should just be used. It is when an inliner pass
> wants to deviate from the defaults that it should take explicit steps and
> call explicit flags.
> > Thanks for the clarification. I have moved getInlineParams and other
> associated logic that computes the threshold from the flags to
> InlineCost.cpp. SimpleInliner now calls one of these methods to get an
> InlineParams object which gets passed to getInlineCost.
> >
> >
> > https://reviews.llvm.org/D22120
> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160808/ba275e04/attachment.html>


More information about the llvm-commits mailing list