[llvm-commits] [llvm] r151429 - in /llvm/trunk: include/llvm/Transforms/IPO.h include/llvm/Transforms/IPO/InlinerPass.h include/llvm/Transforms/Utils/Cloning.h lib/Transforms/IPO/InlineAlways.cpp lib/Transforms/IPO/InlineSimple.cpp lib/Transforms/IPO/Inliner.cpp lib/Transforms/Utils/InlineFunction.cpp

Duncan Sands baldrick at free.fr
Sun Feb 26 00:22:49 PST 2012


Hi Chad,

>>> Add support for disabling llvm.lifetime intrinsics in the AlwaysInliner. These
>>> are optimization hints, but at -O0 we're not optimizing.  This becomes a problem
>>> when the alwaysinline attribute is abused.
>>> rdar://10921594
>>
>> can you please explain some more for those of us who can't access rdar.  Why is
>> it a problem, and what alwaysinline abuse do you have in mind?
>
> At -O0 the AlwaysInliner pass is run to honor the always_inline attribute.  By default the @llvm.lifetime_start and @llvm.lifetime_end intrinsics were being emitted.  These are compiler hints and at -O0 they're never used and thus should not be emitted.  The particular test case I came across was compiling in 283s at -O0 (fast, huh).  Now it compiles in 1.35s at -O0.

thanks for the explanation.  Why was it taking so long?  Just the insertion of
these intrinsics or something else?  It seems strange to me that compilation
should be slowed down so much - maybe it is a sign that something else is wrong,
some kind of inefficient handling of these intrinsics?

Ciao, Duncan.

   By abuse I mean the developer thinks they're smarted then the compiler, so 
they mark everything with the always_inline attribute.  I'm not saying this is a 
common problem, but regardless these intrinsics are useless at -O0.
>
>> You also forgot to add a testcase.
>
> Yes, you're right.  I will add one soon.  Thanks for keeping me honest, Duncan.
>
>   Chad
>
>>
>> Ciao, Duncan.
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>




More information about the llvm-commits mailing list