[llvm-commits] [llvm] r82778 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp

Eli Friedman eli.friedman at gmail.com
Fri Sep 25 16:56:43 PDT 2009


On Fri, Sep 25, 2009 at 1:40 PM, Sandeep Patel <deeppatel1987 at gmail.com> wrote:
> On Fri, Sep 25, 2009 at 8:22 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
>> On Fri, Sep 25, 2009 at 11:37 AM, Sandeep Patel <deeppatel1987 at gmail.com> wrote:
>>> Why aren't the front-ends responsible for selecting the intrinsics again?
>>
>> Because there's no compelling reason to move it to the frontend... and
>> there aren't corresponding intrinsics for some of the math functions.
>
> Only the frontend knows that the function matches the proper signature
> and was declared in the proper header file.

The backend can tell if the function signature is sane.  At least in
C, it's legal to declare most library functions without including any
headers, so I'm not sure what the "proper header file" means.

> Doing matching by name like this in the backend is just bound to cause
> trouble for freestanding and kernel folks (like me).

This has been discussed; the consensus, as far as I know, is that we
need a function attribute for such cases.  We don't want to introduce
LLVM intrinsics for every C library function.

-Eli



More information about the llvm-commits mailing list