mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-10 12:59:21 +03:00
[svn r133] Fixed some problems with inlining not happening :P
Fixed problems with certain cases of deeply nested classes/functions.
This commit is contained in:
parent
f420bc1265
commit
5eb88f9e80
17 changed files with 263 additions and 59 deletions
|
@ -13,8 +13,6 @@ using namespace llvm;
|
|||
void llvmdc_optimize_module(Module* m, char lvl, bool doinline)
|
||||
{
|
||||
assert(lvl >= 0 && lvl <= 5);
|
||||
if (lvl == 0)
|
||||
return;
|
||||
|
||||
PassManager pm;
|
||||
pm.add(new TargetData(m));
|
||||
|
@ -24,12 +22,12 @@ void llvmdc_optimize_module(Module* m, char lvl, bool doinline)
|
|||
pm.add(createRaiseAllocationsPass());
|
||||
pm.add(createCFGSimplificationPass());
|
||||
pm.add(createPromoteMemoryToRegisterPass());
|
||||
pm.add(createGlobalOptimizerPass());
|
||||
pm.add(createGlobalDCEPass());
|
||||
}
|
||||
|
||||
if (lvl >= 2)
|
||||
{
|
||||
pm.add(createGlobalOptimizerPass());
|
||||
pm.add(createGlobalDCEPass());
|
||||
pm.add(createIPConstantPropagationPass());
|
||||
pm.add(createDeadArgEliminationPass());
|
||||
pm.add(createInstructionCombiningPass());
|
||||
|
@ -77,5 +75,6 @@ void llvmdc_optimize_module(Module* m, char lvl, bool doinline)
|
|||
|
||||
// level 4 and 5 are linktime optimizations
|
||||
|
||||
pm.run(*m);
|
||||
if (lvl > 0 || doinline)
|
||||
pm.run(*m);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue