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

Chris Lattner clattner at apple.com
Mon Sep 22 13:35:26 PDT 2008


On Sep 22, 2008, at 11:21 AM, Devang Patel wrote:

>
> On Sep 21, 2008, at 8:43 PM, Chris Lattner wrote:
>
>>> +    else {
>>> +      // The inliner pass won't be inserted based on command line  
>>> options.
>>> +      // Use AlwaysInliner to handle functions that are marked as  
>>> always_inline.
>>> +      bool NeedAlwaysInliner = false;
>>> +      for (Module::iterator I = TheModule->begin(), E = TheModule- 
>>> >end();
>>> +         I != E; ++I)
>>> +        if (!I->isDeclaration() && I->getNotes() ==  
>>> FN_NOTE_AlwaysInline) {
>>> +          NeedAlwaysInliner = true;
>>> +          break;
>>> +        }
>>> +      if (NeedAlwaysInliner)
>>> +        PM->add(createAlwaysInlinerPass());
>>
>> Please don't do this loop here, just unconditionally add it to the  
>> passmgr.  Is there some advantage to checking here (in llvmgcc)  
>> rather than in the pass itself?
>
>
> Only one advantage is a small convenience to llvm developers. When  
> we are using -analyze or -print or intentionally running selected  
> pass for debugging/testing then you do not want PassManager to annoy  
> you. This is not a big deal, and I do not see any advantage for end  
> users.

How would it be annoying?  I don't understand.  It is just an  
optimization to speed up the pass.

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20080922/cb34e65d/attachment.html>


More information about the llvm-commits mailing list