[PATCH] CodeGen target hook for emitting intrinsic or libcall for pow*

Eli Bendersky eliben at google.com
Fri Jun 28 10:32:08 PDT 2013


On Fri, Jun 28, 2013 at 9:47 AM, Quentin Colombet <qcolombet at apple.com>wrote:

> Hi Eli,
>
> Just a thought, wouldn’t be better to add a hook in TargetSelectionDAGInfo
> for pow, just like memset and memmove?
> Indeed, I guess that pow intrinsics may have special handling in some
> optimizations and I am afraid we lose those benefits with the proposed
> patch.
>
> What do you think?
>

Hi Quentin,

I suppose it can be useful, but IMHO it's an orthogonal issue to the Clang
change. Some targets (like PNaCl, and possibly others that split the
compilation to two distinct stages with bitcode in between) may decide that
the hardcoded pow-->intrinsic translation Clang currently does is not
necessarily desirable. The patch allows them to state so. It could probably
be generalized even more by providing targets with a stronger tool to state
that they don't want intrinsics to be generated for known lib calls. As for
the SelDAG side, targets can probably already customize it by "legalizing"
ISD::FPOW etc. in a special way? In any case, for split-compilation uses
that's way too late :-)

Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130628/7a7f1c1d/attachment.html>


More information about the cfe-commits mailing list