Commit Graph

43 Commits

Author SHA1 Message Date
Dan Gohman c731c97fac Use empty() member functions when that's what's being tested for instead
of comparing begin() and end().

llvm-svn: 42585
2007-10-03 19:26:29 +00:00
Tanya Lattner ab11b1c702 Inliner pass header file was moved.
llvm-svn: 37665
2007-06-19 22:29:50 +00:00
Chris Lattner 3b6f75cb2f Fix PR1395, by passing the ID correctly
llvm-svn: 36894
2007-05-06 23:13:56 +00:00
Devang Patel 8c78a0bff0 Drop 'const'
llvm-svn: 36662
2007-05-03 01:11:54 +00:00
Devang Patel e95c6ad802 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 09f162ca6a Do not use typeinfo to identify pass in pass manager.
llvm-svn: 36632
2007-05-01 21:15:47 +00:00
Chris Lattner f94bed3f13 the inliner pass now passes targetdata down through the inliner api's
llvm-svn: 33677
2007-01-30 23:28:39 +00:00
Reid Spencer 5301e7c605 For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid
confusion with external linkage types.

llvm-svn: 33663
2007-01-30 20:08:39 +00:00
Chris Lattner 1631bcb1d4 Eliminate static ctors due to Statistic objects
llvm-svn: 32693
2006-12-19 22:09:18 +00:00
Chris Lattner 700b873130 Detemplatize the Statistic class. The only type it is instantiated with
is 'unsigned'.

llvm-svn: 32279
2006-12-06 17:46:33 +00:00
Bill Wendling 8f13b5c43e Replace #include <iostream> with llvm_* streams.
llvm-svn: 31924
2006-11-26 10:02:32 +00:00
Chris Lattner 82928ca290 second patch to fix PR992/993.
llvm-svn: 31610
2006-11-09 23:36:08 +00:00
Chris Lattner 924f4fee8b Minimal patch to fix PR992/PR993
llvm-svn: 31608
2006-11-09 23:17:45 +00:00
Reid Spencer de46e48420 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 5de3b8b262 Change the callgraph representation to store the callsite along with the
target CG node.  This allows the inliner to properly update the callgraph
when using the pruning inliner.  The pruning inliner may not copy over all
call sites from a callee to a caller, so the edges corresponding to those
call sites should not be copied over either.

This fixes PR827 and Transforms/Inline/2006-07-12-InlinePruneCGUpdate.ll

llvm-svn: 29120
2006-07-12 18:29:36 +00:00
Chris Lattner cd60d38b30 Remove some dead variables.
Fix a nasty bug in the memcmp optimizer where we used the wrong variable!

llvm-svn: 28269
2006-05-12 23:35:26 +00:00
Chris Lattner c597b8a55e Make iostream #inclusion explicit
llvm-svn: 25514
2006-01-22 23:32:06 +00:00
Chris Lattner f6d6823f09 Let the inliner update the callgraph to reflect the changes it makes, instead
of doing it ourselves.  This fixes Transforms/Inline/2006-01-14-CallGraphUpdate.ll

llvm-svn: 25321
2006-01-14 20:09:18 +00:00
Chris Lattner 49c4d536bd Fix 80 column violations
llvm-svn: 25279
2006-01-13 18:06:56 +00:00
Misha Brukman b1c9317bb4 Remove trailing whitespace
llvm-svn: 21427
2005-04-21 23:48:37 +00:00
Chris Lattner 6455c51ab6 Fix the inliner to always delete any edges from the external call node to
a function being deleted.  Due to optimizations done while inlining, there
can be edges from the external call node to a function node that were not
apparent any longer.

This fixes the compiler crash while compiling 175.vpr

llvm-svn: 16399
2004-09-18 21:37:03 +00:00
Reid Spencer 7c16caa336 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Chris Lattner 4956a32c9e Fix another really nasty regression that Anshu pointed out. In cases where
dangling constant users were removed from a function, causing it to be dead,
we never removed the call graph edge from the external node to the function.

In most cases, this didn't cause a problem (by luck).  This should definitely
go into 1.3

llvm-svn: 15570
2004-08-08 03:29:50 +00:00
Misha Brukman 63b38bd2ed Fix #includes of i*.h => Instructions.h as per PR403.
llvm-svn: 15334
2004-07-29 17:30:56 +00:00
Chris Lattner e2774757fe Fix a performance regression from the CPR patch, simplify code
llvm-svn: 14974
2004-07-18 21:34:16 +00:00
Chris Lattner 2da5eee33c Fix a rather serious bug in previous checkin
llvm-svn: 14957
2004-07-18 06:56:58 +00:00
Reid Spencer cb3fb5d4f5 bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage

llvm-svn: 14953
2004-07-18 00:44:37 +00:00
Chris Lattner 7d30a6c145 Fix the inliner to be deterministic, not letting its output depend on the
relative location of Function objects in memory.

llvm-svn: 14260
2004-06-20 04:11:48 +00:00
Chris Lattner 6f02714a10 Fix a bug in my previous checkin
llvm-svn: 13717
2004-05-24 06:24:46 +00:00
Chris Lattner 6754b827c6 Fix cases where we missed inlining some more obvious candidates because the
caller was in an SCC.

llvm-svn: 13693
2004-05-23 21:22:17 +00:00
Chris Lattner be8bb804c5 Fix an incredibly nasty iterator invalidation problem. I am too spoiled by ilists :)
Eventually it would be nice if CallGraph maintained an ilist of CallGraphNode's instead
of a vector of pointers to them, but today is not that day.

llvm-svn: 13100
2004-04-21 20:44:33 +00:00
Chris Lattner a9691fe70d Fix typeo
llvm-svn: 13089
2004-04-21 14:23:18 +00:00
Chris Lattner c87784f1fc REALLY fix PR324: don't delete linkonce functions until after the SCC traversal
is done, which avoids invalidating iterators in the SCC traversal routines

llvm-svn: 13088
2004-04-20 22:06:53 +00:00
Chris Lattner 514934051a Fix PR324 and testcase: Inline/2004-04-20-InlineLinkOnce.llx
llvm-svn: 13080
2004-04-20 20:20:59 +00:00
Chris Lattner be43544429 Actually update the call graph as the inliner changes it. This allows us to
execute other CallGraphSCCPasses after the inliner without crashing.

llvm-svn: 12861
2004-04-12 05:37:29 +00:00
Chris Lattner 08f201bee5 Stop printing Function*
llvm-svn: 12857
2004-04-12 04:06:56 +00:00
Chris Lattner 4d25c86b52 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 a82f131abb Finegrainify namespacification
Print out the costs for functions that AREN'T inlined as well

llvm-svn: 10135
2003-11-21 21:45:31 +00:00
Brian Gaeke 960707c335 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
Chris Lattner 984e11792f Do NOT inline self recursive calls into other functions. This is causing the
pool allocator no end of trouble, and doesn't make a lot of sense anyway.  This
does not solve the problem with mutually recursive functions, but they are much less common.

llvm-svn: 9828
2003-11-09 05:05:36 +00:00
Chris Lattner b45d9077cb Strip off CPR's manually, because if we don't, the inliner doesn't delete dead
functions.  GRR

llvm-svn: 9641
2003-10-31 21:05:58 +00:00
John Criswell 482202a601 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 d075cc282b 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