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

Quentin Colombet qcolombet at apple.com
Fri Jun 28 10:47:48 PDT 2013



On Jun 28, 2013, at 10:32 AM, Eli Bendersky <eliben at google.com> wrote:

> 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.
Make sense.

> 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.
That would be great and I guess it would be the next step.

I leave to the front-end specialist to comment on your patch :).

Thanks for your answer.

Cheers,

-Quentin 

> 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/0dccfc41/attachment.html>


More information about the cfe-commits mailing list