[PATCH] Consider error-reporting calls cold in BPI

Chandler Carruth chandlerc at google.com
Tue Nov 12 00:27:15 PST 2013


On Mon, Nov 11, 2013 at 10:04 PM, Hal Finkel <hfinkel at anl.gov> wrote:

> ----- Original Message -----
> >
> >
> >
> >
> > On Sat, Nov 9, 2013 at 5:44 AM, Hal Finkel < hfinkel at anl.gov > wrote:
> >
> >
> > Okay, I've attached a patch that adds this into SimplifyLibCalls. In
> > this incarnation, I've added the functionality at the top-level of
> > SimplifyLibCalls itself (which makes it different from all of the
> > other simplifications). My rationale for this is that adding the
> > cold hint should not depend on the builtin status of the functions.
> > I'm not sure how much I like this. Thoughts?
> > I think it should depend on the builtin status of the functions. If
> > we're in a freestanding environment, there is no reason to believe
> > that the meanings for the various file descriptors continue to hold.
>
> Chandler, Meador, et al.,
>
> Thanks for your feedback! I've attached a new version (which makes this
> look much like all of the other optimizations). Please review.
>

While I deeply question the fundamental design here, I suspect your patch
should follow it.

+    ErrorReportingOpt ER(/* StreamArg = */ 0);
+    (void) ER.callOptimizer(Callee, CI, B);
+

The way the rest of the simplify lib calls works is for specific lib calls
to subclass a more more specialized base class to provide delegated
optimizations, not to build an instance of the class...

Bah, maybe just put this in a couple of static function and use a more
boring design? Seems simpler.

-Chandler


>  -Hal
>
> --
> Hal Finkel
> Assistant Computational Scientist
> Leadership Computing Facility
> Argonne National Laboratory
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131112/e6dc245a/attachment.html>


More information about the llvm-commits mailing list