<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 22, 2008, at 11:21 AM, Devang Patel wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 21, 2008, at 8:43 PM, Chris Lattner wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Verdana; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><blockquote type="cite">+    else {<br></blockquote><blockquote type="cite">+      // The inliner pass won't be inserted based on command line options.<br></blockquote><blockquote type="cite">+      // Use AlwaysInliner to handle functions that are marked as always_inline.<br></blockquote><blockquote type="cite">+      bool NeedAlwaysInliner = false;<br></blockquote><blockquote type="cite">+      for (Module::iterator I = TheModule->begin(), E = TheModule->end();<br></blockquote><blockquote type="cite">+         I != E; ++I)<br></blockquote><blockquote type="cite">+        if (!I->isDeclaration() && I->getNotes() == FN_NOTE_AlwaysInline) {<br></blockquote><blockquote type="cite">+          NeedAlwaysInliner = true;<br></blockquote><blockquote type="cite">+          break;<br></blockquote><blockquote type="cite">+        }<br></blockquote><blockquote type="cite">+      if (NeedAlwaysInliner)<br></blockquote><blockquote type="cite">+        PM->add(createAlwaysInlinerPass());<br></blockquote><br>Please don't do this loop here, just unconditionally add it to the passmgr.  <span class="Apple-style-span" style="color: rgb(20, 79, 174); -webkit-text-stroke-width: -1; ">Is there some advantage to checking here (in llvmgcc) rather than in the pass itself?</span></span></blockquote></div><div><br></div>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.<div></div></div></blockquote></div><br><div>How would it be annoying?  I don't understand.  It is just an optimization to speed up the pass.</div><div><br></div><div>-Chris</div></body></html>