[llvm-commits] [llvm-gcc-4.2] r51608 - /llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp

Evan Cheng evan.cheng at apple.com
Wed May 28 10:55:28 PDT 2008


On May 28, 2008, at 10:22 AM, Duncan Sands wrote:

> Hi Evan,
>
>> I was looking at c-opts.c:
>
> notice the "c" in c-opts? :)
>
>>   flag_inline_trees = 1;
>>
>>   /* Use tree inlining.  */
>>   if (!flag_no_inline)
>>     flag_no_inline = 1;
>>   if (flag_inline_functions)
>>     flag_inline_trees = 2;
>>
>> flag_no_inline corresponds to -fno-inline, flag_inline_functions
>> corresponds to -finline-functions.
>
> This is how the C front-end does it.
>
>> That is, if flag_inline_trees == 1,
>> the frontend does trivial inlining for functions that are marked
>> DECL_INLINE.
>
> I don't think that's right: the gcc inliner only looks at
> flag_inline_trees != 0 and DECL_INLINE.
>
>> We want to run llvm inliner pass only when
>> flag_inline_trees > 1.
>
> To get the same effect as gcc in a way that works for all languages,
> I think we need to run the inliner if flag_inline_trees != 0 and add
> all functions with !DECL_INLINE to llvm.noinline.  Or would that be
> too expensive?

That doesn't seem like the right solution to me. llvm language doesn't  
have the "inline" keyword. Can we just say llvm ignore the inline hint?

>
>
>> Perhaps it would be simpler to check for flag_inline_functions  
>> instead
>> in llvm-backend.cpp?
>
> It would be simpler, but it would only work the same way as gcc for
> the C like languages, and not for Ada or Fortran.

Is it possible to fix the Ada and Fortran frontend to match the C  
frontend?

Evan

>
>
> Ciao,
>
> Duncan.




More information about the llvm-commits mailing list