1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

93 Commits

Author SHA1 Message Date
Evan Cheng
d01a2a18f8 Increasing the inline limit from (overly conservative) 200 to 300. Given each BB costs 20 and each instruction costs 5, 200 means a 4 BB function + 24 instructions (actually less because caller's size also contributes to it).
Furthermore, double the limit when more than 10% of the callee instructions are vector instructions. Multimedia kernels tend to love inlining.

llvm-svn: 48725
2008-03-24 06:37:48 +00:00
Chris Lattner
fb5876f0be Allow clients to specify the inline threshold when creating
the inliner pass.  Patch by Robert Zeh.

llvm-svn: 45903
2008-01-12 06:49:13 +00:00
Chris Lattner
ad9a6ccb83 Remove attribution from file headers, per discussion on llvmdev.
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Anton Korobeynikov
f46167c649 Don't crash on bogus llvm.noinline. This is first part of PR1817 (preventing reduction)
llvm-svn: 44281
2007-11-22 22:30:10 +00:00
Devang Patel
a03e82d7ee Use SmallPtrSet.
llvm-svn: 40560
2007-07-27 18:34:27 +00:00
Devang Patel
d7b401bafd Add BasicInliner interface.
This interface allows clients to inline bunch of functions with module
level call graph information.:wq

llvm-svn: 40486
2007-07-25 18:00:25 +00:00
Chris Lattner
64e8e4af59 fix Transforms/Inline/2007-06-25-WeakInline.ll by not inlining functions
with weak linkage.

llvm-svn: 37723
2007-06-25 21:50:09 +00:00
Tanya Lattner
a2e912bf51 Inliner pass header file was moved.
llvm-svn: 37665
2007-06-19 22:29:50 +00:00
Tanya Lattner
968030663f Formating fixes.
llvm-svn: 37491
2007-06-07 17:12:16 +00:00
Tanya Lattner
9672d69be2 Instruct the inliner to obey the noinline attribute. Add test case.
llvm-svn: 37481
2007-06-06 21:59:26 +00:00
Chris Lattner
8e9063c571 Fix PR1395, by passing the ID correctly
llvm-svn: 36894
2007-05-06 23:13:56 +00:00
Nick Lewycky
c2306ff5b4 Fix typo in comment.
llvm-svn: 36873
2007-05-06 13:37:16 +00:00
Devang Patel
cd45427a87 Drop 'const'
llvm-svn: 36662
2007-05-03 01:11:54 +00:00
Devang Patel
8ee9065162 Use 'static const char' instead of 'static const int'.
Due to darwin gcc bug, one version of darwin linker coalesces
static const int, which defauts PassID based pass identification.

llvm-svn: 36652
2007-05-02 21:39:20 +00:00
Devang Patel
38a66bc82e Do not use typeinfo to identify pass in pass manager.
llvm-svn: 36632
2007-05-01 21:15:47 +00:00
Reid Spencer
8749d297f5 Apply the VISIBILITY_HIDDEN field to the remaining anonymous classes in
the Transforms library. This reduces debug library size by 132 KB, debug
binary size by 376 KB, and reduces link time for llvm tools slightly.

llvm-svn: 33939
2007-02-05 23:32:05 +00:00
Devang Patel
bf44036fbf Inherit CallGraphSCCPass directly from Pass.
llvm-svn: 33514
2007-01-26 00:47:38 +00:00
Reid Spencer
992d9788b3 For PR950:
The long awaited CAST patch. This introduces 12 new instructions into LLVM
to replace the cast instruction. Corresponding changes throughout LLVM are
provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the
exception of 175.vpr which fails only on a slight floating point output
difference.

llvm-svn: 31931
2006-11-27 01:05:10 +00:00
Reid Spencer
4bafa71dc1 For PR786:
Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting
fall out by removing unused variables. Remaining warnings have to do with
unused functions (I didn't want to delete code without review) and unused
variables in generated code. Maintainers should clean up the remaining
issues when they see them. All changes pass DejaGnu tests and Olden.

llvm-svn: 31380
2006-11-02 20:25:50 +00:00
Chris Lattner
2122c2e124 Make inlining costs more accurate.
llvm-svn: 30231
2006-09-09 20:40:44 +00:00
Chris Lattner
a39dcb5377 eliminate RegisterOpt. It does the same thing as RegisterPass.
llvm-svn: 29925
2006-08-27 22:42:52 +00:00
Chris Lattner
67a0c03bb4 Permit inlining functions that contain dynamic allocations now that
InlineFunction handles this case safely.  This implements
Transforms/Inline/dynamic_alloca_test.ll.

llvm-svn: 25288
2006-01-13 19:35:43 +00:00
Chris Lattner
df9c75fb12 teach the inliner about coldcc and noreturn functions
llvm-svn: 22113
2005-05-18 04:30:33 +00:00
Misha Brukman
53e199440e Remove trailing whitespace
llvm-svn: 21427
2005-04-21 23:48:37 +00:00
Chris Lattner
4b688a1c70 This mega patch converts us from using Function::a{iterator|begin|end} to
using Function::arg_{iterator|begin|end}.  Likewise Module::g* -> Module::global_*.

This patch is contributed by Gabor Greif, thanks!

llvm-svn: 20597
2005-03-15 04:54:21 +00:00
Chris Lattner
9d1117ed96 Ignore debugger intrinsics when doing inlining size computations.
llvm-svn: 18109
2004-11-22 17:21:44 +00:00
Chris Lattner
9f035c9fdb Change this back so that I get stable numbers to reflect the change from the
nightly testers

llvm-svn: 17646
2004-11-09 08:05:23 +00:00
Chris Lattner
a9e56ddaa3 VERY large functions that are only called from one place are not really
exciting to inline.  Only inline medium or small sized functions with a
single call site.

llvm-svn: 17588
2004-11-07 21:46:47 +00:00
Chris Lattner
43c0372c0b 'Pass' should now not be derived from by clients. Instead, they should derive
from ModulePass.  Instead of implementing Pass::run, then should implement
ModulePass::runOnModule.

llvm-svn: 16436
2004-09-20 04:48:05 +00:00
Chris Lattner
32ad5d0bab This patch makes the inliner refuse to inline functions that have alloca
instructions in the body of the function (not the entry block).  This fixes
test/Programs/SingleSource/Regression/C/2004-08-12-InlinerAndAllocas.c
and test/Programs/External/SPEC/CINT2000/176.gcc on zion.

This should obviously be pulled into 1.3.

llvm-svn: 15684
2004-08-12 05:45:09 +00:00
Reid Spencer
51149979ce bug 122:
- Minimize redundant isa<GlobalValue> usage

llvm-svn: 14948
2004-07-18 00:32:14 +00:00
Chris Lattner
77beb73ce2 Remove the "really gross hacks" that are there to deal with recursive functions.
Now we collect all of the call sites we are interested in inlining, then inline
them.  This entirely avoids issues with trying to inline a call site we got by
inlining another call site.  This also eliminates iterator invalidation issues.

llvm-svn: 12770
2004-04-08 06:34:31 +00:00
Chris Lattner
b9c53cdb65 Restore old inlining heuristic. As the comment indicates, this is a nasty
horrible hack.

llvm-svn: 12423
2004-03-15 06:38:14 +00:00
Chris Lattner
763b6c41d4 This change makes two big adjustments.
* Be a lot more accurate about what the effects will be when inlining a call
   to a function when an argument is an alloca.
 * Dramatically reduce the penalty for inlining a call in a large function.
   This heuristic made it almost impossible to inline a function into a large
   function, no matter how small the callee is.

llvm-svn: 12363
2004-03-13 23:15:45 +00:00
Chris Lattner
c837881d43 Considering that CI is not even IN SCOPE here, I wooda thought the compiler
would have caught this.  *sigh*

llvm-svn: 10142
2003-11-21 21:57:29 +00:00
Chris Lattner
5f38817de9 * Finegrainify namespacification
* Make the cost metric for passing constants in as arguments to functions MUCH
  more accurate, by actually estimating the amount of code that will be constant
  propagated away.

llvm-svn: 10136
2003-11-21 21:46:09 +00:00
Brian Gaeke
d25f86d683 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
John Criswell
b402729b30 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.

llvm-svn: 9298
2003-10-20 19:43:21 +00:00
Chris Lattner
caf5825a8a Reorder for minor efficiency gain
llvm-svn: 9285
2003-10-20 05:54:26 +00:00
Chris Lattner
f2ed60c0b7 Decrease usage of use_size()
llvm-svn: 9135
2003-10-15 16:48:29 +00:00
Misha Brukman
868eac95dd Fix spelling.
llvm-svn: 9027
2003-10-10 17:57:28 +00:00
Chris Lattner
bbfaf77c5d Fix bugzilla bug #5
llvm-svn: 8930
2003-10-07 19:33:31 +00:00
Chris Lattner
512ab7b5fd Speed up the predicate used to decide when to inline by caching the size
of callees between executions.

On eon, in release mode, this changes the inliner from taking 11.5712s
to taking 2.2066s.  In debug mode, it went from taking 14.4148s to
taking 7.0745s.  In release mode, this is a 24.7% speedup of gccas, in
debug mode, it's a total speedup of 11.7%.

This also makes it slightly more aggressive.  This could be because we
are not judging the size of the functions quite as accurately as before.
When we start looking at the performance of the generated code, this can
be investigated further.

llvm-svn: 8893
2003-10-06 15:52:43 +00:00
Chris Lattner
a37b6a09d3 Heavily refactor code:
* Separate the policy decisions into a derived class [InlineSimple]
  * Move the inlining mechanics into a base class [Inliner]
  * Change the inliner to be an SCCPass, making it more structured and
    eventually pipelinable with other SCC passes

llvm-svn: 8257
2003-08-31 19:10:30 +00:00
Chris Lattner
c9e30ea132 Inline invoke instructions as well as call instructions
llvm-svn: 8107
2003-08-24 06:59:28 +00:00
Chris Lattner
5159ae0f96 Big diff for a small change: delete inlined functions if all callees have
inlined the function.
Implements: Inline/inline_dce.ll

llvm-svn: 8101
2003-08-24 05:03:14 +00:00
Chris Lattner
686e94e760 DEBUG got moved to Support/Debug.h
llvm-svn: 7492
2003-08-01 22:15:03 +00:00
Chris Lattner
17ea08b804 Allow the inlining limit to be controlled from the command line!
llvm-svn: 6929
2003-06-28 15:57:04 +00:00
Chris Lattner
24947af013 * Separate all of the grunt work of inlining out into the Utils library.
* Make the function inliner _significantly_ smarter.  :)

llvm-svn: 6396
2003-05-29 15:11:31 +00:00
Chris Lattner
f1f55e385c Don't inline functions that take variable numbers of arguments!
llvm-svn: 6024
2003-05-08 02:36:43 +00:00