[dragonegg] r183496 - Don't bother trying to detect whether the always-inliner is needed or not, let
Duncan Sands
baldrick at free.fr
Fri Jun 7 01:55:35 PDT 2013
Author: baldrick
Date: Fri Jun 7 03:55:35 2013
New Revision: 183496
URL: http://llvm.org/viewvc/llvm-project?rev=183496&view=rev
Log:
Don't bother trying to detect whether the always-inliner is needed or not, let
it do the detecting itself.
Modified:
dragonegg/trunk/src/Backend.cpp
Modified: dragonegg/trunk/src/Backend.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Backend.cpp?rev=183496&r1=183495&r2=183496&view=diff
==============================================================================
--- dragonegg/trunk/src/Backend.cpp (original)
+++ dragonegg/trunk/src/Backend.cpp Fri Jun 7 03:55:35 2013
@@ -746,9 +746,9 @@ static void createPerModuleOptimizationP
PerModulePasses->add(new DataLayout(TheModule));
TheTarget->addAnalysisPasses(*PerModulePasses);
- bool NeedAlwaysInliner = false;
Pass *InliningPass;
if (!LLVMIROptimizeArg)
+ // If the user asked for no LLVM optimization, then don't do any inlining.
InliningPass = 0;
else if (flag_inline_small_functions && !flag_no_inline) {
// Inline small functions. Figure out a reasonable threshold to pass llvm's
@@ -764,18 +764,9 @@ static void createPerModuleOptimizationP
Threshold = 225;
InliningPass = createFunctionInliningPass(Threshold);
} else {
- // If full inliner is not run, check if always-inline is needed to handle
- // functions that are marked as always_inline.
+ // Run the always-inline pass to handle functions marked as always_inline.
// TODO: Consider letting the GCC inliner do this.
- for (Module::iterator I = TheModule->begin(), E = TheModule->end(); I != E;
- ++I)
- if (I->getAttributes().hasAttribute(AttributeSet::FunctionIndex,
- Attribute::AlwaysInline)) {
- NeedAlwaysInliner = true;
- break;
- }
-
- InliningPass = NeedAlwaysInliner ? createAlwaysInlinerPass() : 0;
+ InliningPass = createAlwaysInlinerPass();
}
PassBuilder.OptLevel = ModuleOptLevel();
More information about the llvm-commits
mailing list