[llvm-commits] [llvm-gcc-4.2] r55718 - /llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
Chris Lattner
clattner at apple.com
Sun Sep 21 20:43:09 PDT 2008
On Sep 3, 2008, at 1:01 PM, Devang Patel wrote:
> Author: dpatel
> Date: Wed Sep 3 15:01:27 2008
> New Revision: 55718
>
> URL: http://llvm.org/viewvc/llvm-project?rev=55718&view=rev
> Log:
> Use AlwaysInliner to handle always_inline functions, if regular
> inliner is not used.
Ok
> + 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?
-Chris
>
> + }
> if (optimize > 2)
> PM->add(createArgumentPromotionPass()); // Scalarize
> uninlined fn args
> if (!flag_no_simplify_libcalls)
> @@ -431,7 +444,7 @@
> if (optimize > 1 && flag_unit_at_a_time)
> PM->add(createConstantMergePass()); // Merge dup global
> constants
> }
> -
> +
> if (emit_llvm_bc) {
> // Emit an LLVM .bc file to the output. This is used when passed
> // -emit-llvm -c to the GCC driver.
>
>
> _______________________________________________
> 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