Commit Graph

409 Commits

Author SHA1 Message Date
Chris Lattner
21949d9088 Remove dependence on structure index type. s/MT/FT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10726 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-09 06:02:51 +00:00
Chris Lattner
0898c78a52 Merging constants can cause further room for improvement. Iterate until
we converge


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10618 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-28 07:19:08 +00:00
Chris Lattner
b97238079d Fix memory corruption bug PR193
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10586 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-22 23:49:36 +00:00
Chris Lattner
eb12cd67dd Implement RaiseAllocations/FreeCastConstantExpr.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10305 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-07 01:42:08 +00:00
Chris Lattner
ab25f5a6c1 Delete dead line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10164 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-22 02:26:17 +00:00
Chris Lattner
3788c242be Fix bug: Transforms/PruneEH/2003-11-21-PHIUpdate.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10163 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-22 02:20:36 +00:00
Chris Lattner
6d1db01284 Considering that CI is not even IN SCOPE here, I wooda thought the compiler
would have caught this.  *sigh*


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10142 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 21:57:29 +00:00
Chris Lattner
1e2385b941 Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10138 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 21:54:22 +00:00
Chris Lattner
1192283096 Get rid of using decls, finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10137 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 21:52:10 +00:00
Chris Lattner
869adc283c * 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10136 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 21:46:09 +00:00
Chris Lattner
a51bcb50b0 Finegrainify namespacification
Print out the costs for functions that AREN'T inlined as well


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10135 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 21:45:31 +00:00
Chris Lattner
03fb8b2a42 * Finegrainify namespacification
* Implement FuncResolve/2003-11-20-BogusResolveWarning.ll
   ... which eliminates a large number of annoying warnings.  I know misha
   will miss them though!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10123 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-20 21:21:31 +00:00
Chris Lattner
f8485c6434 Start using the nicer terminator auto-insertion API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10111 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-20 18:25:24 +00:00
Chris Lattner
143df9a1bb When spewing out warnings during function resolution, do not vomit out pages
and pages of non-symbolic types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10109 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-20 18:19:35 +00:00
Misha Brukman
444fdea19d This file was somehow missing a top-level comment line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10055 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-17 19:35:17 +00:00
Brian Gaeke
d0fde30ce8 Put all LLVM code into the llvm namespace, as per bug 109.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-11 22:41:34 +00:00
Chris Lattner
d77922f1a2 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9828 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-09 05:05:36 +00:00
Chris Lattner
b045e14111 Untypo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9827 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-09 05:04:25 +00:00
Chris Lattner
d7222ec801 Fix bug: PR93
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9752 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-06 19:18:49 +00:00
Chris Lattner
b6e0631a94 Fix the problem with running cleanups in bugpoint: We were deleting arguments
of intrinsic functions, causing the verifier to fail.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9745 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-05 21:53:41 +00:00
Chris Lattner
fdcc3acb7b Split behavior into two pieces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9741 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-05 21:43:02 +00:00
Chris Lattner
d6d0d8c18d Fix PR78
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9648 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-02 02:06:27 +00:00
Chris Lattner
bb9ae1512e Strip off CPR's manually, because if we don't, the inliner doesn't delete dead
functions.  GRR


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9641 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-31 21:05:58 +00:00
Chris Lattner
6ace4daa57 Fix bug: ConstantMerge/2003-10-28-MergeExternalConstants.ll & PR64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9579 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-29 06:01:26 +00:00
Chris Lattner
fe2143d87d Check in statistifying patch for Bill
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9572 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-28 23:14:59 +00:00
Chris Lattner
2e8dfb8221 Propagating constants to arguments can make other arguments constant. For now
do something dumb, and inefficient, but more complete.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9542 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-27 21:09:00 +00:00
Chris Lattner
2e56dd82b3 We might as well strip off any CPRs before propagation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9437 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-23 18:49:23 +00:00
Chris Lattner
ff5bf9c62b * We were forgetting to pass varargs arguments through a call
* Add a work around for bug PR56, gross but necessary for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9428 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-23 17:44:53 +00:00
Chris Lattner
d358e6fed5 Check in initial version of ipcp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9423 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-23 16:52:27 +00:00
Chris Lattner
c3afd9bf4b Make this pass substantially stronger by having it delete dead return values
as well as arguments.  Now it can delete arguments and return values which are
only passed into other arguments or are returned, if they are dead.  This causes
it to delete several hundred extra args/retvals from the C++ hello world program,
shrinking it by about 2K.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9398 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-23 03:48:17 +00:00
Chris Lattner
ce94319558 This important patch fixes two warnings in the linker which can occur from linking
valid pieces of code


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9390 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-22 23:03:38 +00:00
Chris Lattner
6be5e567ce Update the 'used' flag correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9366 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-22 04:43:18 +00:00
Chris Lattner
4cb766af4a Loop over the module, not the symbol table. This makes the code handle
unused external functions again


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9365 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-22 04:42:20 +00:00
Chris Lattner
efd47ba3ac Implement FunctionResolve/2003-10-21-GlobalResolveHack.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9363 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-22 03:35:34 +00:00
Chris Lattner
5858e1e3f3 Fix bug: FunctionResolve/2003-10-21-GlobalTypeDifference.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9359 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 23:17:56 +00:00
John Criswell
856ba76200 Added LLVM copyright header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9321 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 15:17:13 +00:00
John Criswell
e488e9360b Added LLVM copyright notice to Makefiles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9312 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 22:26:57 +00:00
John Criswell
b576c94c15 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9298 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 19:43:21 +00:00
Chris Lattner
bacc773d20 Reorder for minor efficiency gain
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9285 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 05:54:26 +00:00
Chris Lattner
3b237fcd38 Change the Opcode enum for PHI nodes from "Instruction::PHINode" to "Instruction::PHI" to be more consistent with the other instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9269 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-19 21:34:28 +00:00
Chris Lattner
fd05924946 Decrease usage of use_size()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9135 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-15 16:48:29 +00:00
Chris Lattner
8b716f66ad Whoops, we inserted into the wrong set. What's up with the dead set anyway?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9094 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 16:49:21 +00:00
Chris Lattner
46e033d28d Use external df iterators to avoid revisiting blocks in functions with
multiple setjmp calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9093 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 16:44:50 +00:00
Chris Lattner
cf3056db0f Regularize header file comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9071 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 03:32:08 +00:00
Chris Lattner
6d3906be28 Minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9067 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 01:02:33 +00:00
Chris Lattner
bb2d4de409 Checkin an improvement contributed by Bill:
Only transform call sites in a setjmp'ing function which are reachable from
the setjmp.  If the call dominates the setjmp (for example), the called
function cannot longjmp to the setjmp.

This dramatically reduces the number of invoke instructions created in some
large testcases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9066 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 00:57:16 +00:00
Misha Brukman
cf00c4ab3b Fix spelling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9027 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 17:57:28 +00:00
Chris Lattner
da78b002ca Fix bugzilla bug #5
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8930 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-07 19:33:31 +00:00
Chris Lattner
884d6c4e10 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8893 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-06 15:52:43 +00:00
Misha Brukman
763f5ae902 Credits are now in top-level CREDITS.TXT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8661 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-22 21:57:15 +00:00
Chris Lattner
a2d51afd79 Global variables with APPENDING linkage are very important to keep around!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8632 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 19:00:50 +00:00
Chris Lattner
02a3be020a Rename Function::getEntryNode -> getEntryBlock
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8625 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 14:39:18 +00:00
Chris Lattner
cc838348fc Fix bug raising allocations whose call sites were invoke instructions.
Thanks to brg for tracking down the problem so precisely!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8568 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-16 19:42:21 +00:00
Chris Lattner
1cbcd0fd48 This is effectively a complete rewrite of the globaldce algorithm, resulting
in it being both shorter and more effective.  It no longer depends on the
callgraph, so one FIXME has been fixed.

Additionally, this pass was not able to delete recursive (but dead) functions
if they were pointed to by global variables which were also dead.  In fact
this pass had a lot of problems deleting functions which were only pointed
to by dead globals and other stuff.

Fixing this means that the entire EH library should be stripped away now from
programs that don't use sjlj or exceptions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8567 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-16 19:27:31 +00:00
Chris Lattner
77b398cd5f Minor cleanups, give credit, remove code that should not be necessary, and
was a "major hack"  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8524 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-15 05:43:05 +00:00
Chris Lattner
6420f1cd50 Initial checkin of the Setjmp/Longjmp lowering/transformation pass,
contributed by the masterful Bill Wendling!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8520 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-15 04:56:27 +00:00
Chris Lattner
c9d3e5721b Ugh, a bug fix needed because of the bug in the CallGraph code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8519 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-15 04:52:00 +00:00
Chris Lattner
ad9b5f31ea Fix bug: PruneEH/2003-09-14-ExternalCall.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8516 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-15 02:22:50 +00:00
Misha Brukman
7bc439a4b6 Spell `definitely' correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8466 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-11 15:31:17 +00:00
Chris Lattner
065a616ada Fix spell-o's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8431 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 05:29:43 +00:00
Chris Lattner
ee5457cbe8 Eliminate support for the llvm.unwind intrinisic, using the Unwind instruction instead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8411 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 19:44:26 +00:00
Chris Lattner
36143fc444 Add support for the unwind instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8408 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 18:54:55 +00:00
Chris Lattner
758fefc0f0 Final cleanup: remove dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8291 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 18:01:36 +00:00
Chris Lattner
273328e8e0 Not only is this a lot smaller, it actually works if there is already a
function with the right name in the module.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8290 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 16:53:46 +00:00
Chris Lattner
a0201eaca8 Dead files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8289 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 16:49:57 +00:00
Chris Lattner
09a670587a If "These should be used only by the auto-parallelization pass", we might as
well put them INTO the auto-par pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8288 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 16:49:38 +00:00
Chris Lattner
60a3518cf9 Moved all of the cilkifier stuff into lib/Transforms/IPO, as it really is not
support stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8287 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 16:45:30 +00:00
Chris Lattner
aa9214524d Minor cleanups
Do not #include Parallelize.h, it's just a subset of Cilkifier.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8285 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 16:42:16 +00:00
Chris Lattner
2dbfa03fd8 Change the RaiseAllocations pass to be a Pass instead of a BasicBlock pass.
This makes it more efficient: it doesn't have to scan the whole program, so
it performs work proportional to the number of malloc/free calls in the
program, not the size of the program.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8280 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 03:14:56 +00:00
Chris Lattner
237ef567f6 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8257 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-31 19:10:30 +00:00
Chris Lattner
f6fb96f559 Add accessor function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8253 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-31 16:30:07 +00:00
Chris Lattner
3e64b2e1a4 Initial checkin of the -prune-eh pass, a very simple exception handling removal pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8250 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-31 02:47:32 +00:00
Chris Lattner
e544533874 Inline invoke instructions as well as call instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8107 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-24 06:59:28 +00:00
Chris Lattner
6a67393e19 Big diff for a small change: delete inlined functions if all callees have
inlined the function.
Implements: Inline/inline_dce.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8101 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-24 05:03:14 +00:00
Chris Lattner
a0f85e56c9 Fix bug: FunctionResolve/2003-08-23-ArgumentWarning.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8076 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-23 20:03:05 +00:00
Chris Lattner
b29170fa40 Unless we CANNOT merge the arguments, do so
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7999 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-20 23:50:38 +00:00
Misha Brukman
5560c9d49c Spell `necessary' correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7944 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-18 14:43:39 +00:00
Chris Lattner
250d91b4bf Fix FIXME by removing FIXME
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7832 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 22:15:04 +00:00
John Criswell
478b3a9682 Removing the pool allocator from the main CVS tree.
Use the poolalloc module in CVS from now on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7810 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 15:36:15 +00:00
Sumant Kowshik
233d0758a1 Bug fix: Some nodes pointed to by globals may not be marked incomplete and need to be tracked to find pool arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7763 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-12 00:45:13 +00:00
Chris Lattner
1f28e8ce4d Fix handling of 'free' if it has absolutely no prototype
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7721 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-11 15:05:08 +00:00
John Criswell
7d3c5795f9 Fixed a segfault in gccld.
The original code does not work because the value from WorkList.end() is
invalidated once WorkList.erase() is called.  To ensure proper functionality,
we must ensure that WorkList.erase() is always called before WorkList.end().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7673 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-07 14:43:13 +00:00
Sumant Kowshik
8e37bd0330 Added code for pool allocating only the pool-allocatable data structures in the presence of collapsed nodes + a couple of bug fixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7662 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-07 05:29:28 +00:00
Chris Lattner
8043127860 Remove unnecessary use of NonCopyable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7641 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-06 17:16:24 +00:00
Chris Lattner
c8afdc150c Minor changes:
* Expand most tabs into spaces
  * Move #define DEBUG_TYPE to top of file to avoid warning


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7611 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 18:44:12 +00:00
Sumant Kowshik
f67e7fc7b1 Major bug fixes including a memory leak and tracking some exceptional conditions. Also added support for including global and indirect call information in the DS graphs used by the pool allocation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7605 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 17:01:54 +00:00
Chris Lattner
6806f5614d DEBUG got moved to Support/Debug.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7492 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 22:15:03 +00:00
Chris Lattner
1078d11854 Fix bug: FunctionResolve/2003-07-23-CPR-Reference.ll
This fixes a long time annoyance which caused prototypes for bzero, bcopy,
bcmp, fputs, and fputs_unlocked to never get deleted.  Grr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7285 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 22:03:18 +00:00
Chris Lattner
8bc95a176a Eliminate using declarations, adjust for new DSGraph API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6992 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 03:14:44 +00:00
Chris Lattner
cf6bac3b56 Allow the inlining limit to be controlled from the command line!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6929 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-28 15:57:04 +00:00
Chris Lattner
b12b75365a Add support to globaldce for deleting dead function prototypes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6918 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-26 05:41:18 +00:00
Chris Lattner
81d4e14449 When internalizing global ctor/dtor list, also mark it constant. This is gross, but
until DSA is working all of the time and is totally reliable, we do this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6917 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-26 05:30:40 +00:00
Chris Lattner
9b2a14b6f1 Add argument to DAE to allow operation on non-internal functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6895 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-25 04:12:49 +00:00
Chris Lattner
1c6d6c996a Fix the build. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6797 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-20 14:36:52 +00:00
Chris Lattner
31f612589f Changes to privatize NodeType
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6795 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-19 21:15:26 +00:00
Chris Lattner
a3df1ff807 Remove a bunch of complicated code. The functionality is implemented in instcombine instead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6782 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-19 16:59:19 +00:00
Chris Lattner
97f4b664cd Handle arguments passed in through the va_arg area
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6769 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-18 16:25:51 +00:00
Chris Lattner
08227e4f17 Initial checkin of DAE pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6759 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 22:21:05 +00:00
Chris Lattner
4432d8f3b5 Fix compilation problem on GCC 2.9x
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6667 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-07 20:29:58 +00:00
Sumant Kowshik
9271ade15b Made changes suggested by Chris
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6606 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-04 08:03:57 +00:00
Chris Lattner
c16e631e94 Fix bug: FunctionResolve/2003-05-31-AllInternalDecls.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6486 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-31 21:57:06 +00:00
Chris Lattner
12ce59d3c5 Fix bug: FuncResolve/2003-05-31-InternalDecl.ll
Count resolutions correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6482 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-31 21:08:45 +00:00
Chris Lattner
40c4959e9f Simplify funcresolve a bit more
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6480 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-31 20:44:46 +00:00
Chris Lattner
567cceea49 Fix bug: FunctionResolve/2003-05-31-FuncPointerResolve.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6479 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-31 20:33:31 +00:00
Sumant Kowshik
a78220fe2d Added support for function pointers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6420 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-29 22:42:44 +00:00
Chris Lattner
ca398dc398 * Separate all of the grunt work of inlining out into the Utils library.
* Make the function inliner _significantly_ smarter.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6396 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-29 15:11:31 +00:00
Chris Lattner
de579f11ff Remove using declarations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6306 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-22 22:00:07 +00:00
Chris Lattner
88c7c3295d Make the list accept comma separated names
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6295 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-22 20:27:13 +00:00
Chris Lattner
2345d71853 * Revert to old behavior of ignoring a module if it doesn't contain a main
function and no symbols were explicitly marked to be externalized.
* Add new -internalize-public-api-list option that can be used if the symbol
  list is small, and making a new file is annoying.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6289 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-22 19:48:00 +00:00
Chris Lattner
c7a2c7f0c9 Add option to internalize to allow it to read a file to determine which symbols
should not be internalized


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6288 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-22 19:34:49 +00:00
Chris Lattner
c52b30dcfb Fix bug: FunctionResolve/2003-05-21-MissingArguments.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6273 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-21 20:51:52 +00:00
Chris Lattner
8d8f20e47a Don't inline functions that take variable numbers of arguments!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6024 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-08 02:36:43 +00:00
Chris Lattner
1b27cb7159 Remove using decl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6023 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-08 02:34:52 +00:00
Chris Lattner
1fd95afab3 Fix several bugs:
* Warnings were emitted all of the time and were really annoying
  * Functions could not be resolved unless they had external linkage.  Linkonce
    linkage was not allowed
  * ConstantPointerRef's were not handled when linking functions
    we now actually handle cast (CPR) to X -> cast (NewCPR) to X


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5967 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-28 01:23:29 +00:00
Chris Lattner
e408e25132 Remove unnecesary &*'s
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5872 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-23 16:37:45 +00:00
Chris Lattner
ea2294a498 Implement: FunctionResolve/2003-04-18-ForwardDeclGlobal.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5816 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-19 00:15:27 +00:00
Chris Lattner
156bcf3f65 Global constants CAN be external
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5808 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-18 04:34:29 +00:00
Chris Lattner
fb242b6edc Change the interface to constant expressions to allow automatic folding
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5793 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-16 22:40:51 +00:00
Chris Lattner
4ad02e726d Add new linkage types to support a real frontend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5786 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-16 20:28:45 +00:00
Chris Lattner
dde601d0eb Eliminate tons of bogus warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5686 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-03 19:57:46 +00:00
Chris Lattner
4e2fd7574a Replace assertion with a handler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5653 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-27 20:55:48 +00:00
Chris Lattner
fd595203bd Fix a bug that cause a crash resolving questionable function calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5567 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-14 19:12:29 +00:00
Chris Lattner
a3183be835 Fix a misunderstanding of the standard associative containers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5565 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-14 05:34:36 +00:00
Chris Lattner
617d92c7d9 Fix a problem Sumant was running into
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5499 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-06 22:03:46 +00:00
Chris Lattner
f9c81670d7 Split public interface out into header file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5472 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-03 19:08:18 +00:00
Chris Lattner
41c04f730b Change DSGraph stuff to use hash_(set|map) instead of std::(set|map)
This change provides a small (3%) but consistent speedup


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5460 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-01 04:52:08 +00:00
Chris Lattner
49f2012140 Fix a bug resolving sprintf(...) to sprintf(char*, char*, ...)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5446 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-30 22:38:44 +00:00
Chris Lattner
9943a59cb5 Actually print the function _name_ if there is a problem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5443 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-30 21:33:07 +00:00
Chris Lattner
da902ba970 * Fix function resolution for varargs function to generate incorrect bytecode instead of crashing
* remove using decls
 CVS: ----------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5437 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-30 18:22:32 +00:00
Chris Lattner
f34e1ba79c Initial checkin of pool allocation code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5432 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-29 21:12:13 +00:00
Chris Lattner
0ea3e6dc41 Disable construction of pool allocator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5422 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-24 20:13:20 +00:00
Chris Lattner
019a7c801b Fix references to functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5222 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-13 00:27:23 +00:00
Vikram S. Adve
d86deb689b External routines used to identify Cilk operations inserted by the
parallelization pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4965 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-10 13:08:48 +00:00
Vikram S. Adve
e12c74c07b This file implements a pass that automatically parallelizes a program,
using the Cilk multi-threaded runtime system to execute parallel code.
The current version inserts too many sync() operations in the program
because it does not attempt to optimize their placement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4962 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-10 00:43:34 +00:00
Chris Lattner
da3c8a7674 Fix symbol table problem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4785 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-20 19:32:43 +00:00
Chris Lattner
6e6026b465 - Eliminated the deferred symbol table stuff in Module & Function, it really
wasn't an optimization and it was causing lots of bugs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4779 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-20 18:36:02 +00:00
Chris Lattner
d18015599c Minor changes to cloning interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4770 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-19 22:54:01 +00:00
Chris Lattner
dcd8040d11 Rework inline pass to use cloning infrastructure to do the dirty work
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4766 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-19 21:54:07 +00:00
Chris Lattner
309f19391b Start using the new function cloning header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4764 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-19 20:59:41 +00:00
Chris Lattner
e6aa37388a Move MutatStructTypes.h out of IPO
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4762 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-19 20:49:40 +00:00
Chris Lattner
36b7cc3b06 Rename CloneFunction.h to Cloning.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4760 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-19 20:08:24 +00:00
Chris Lattner
5113eb0c52 Move the function extractor pass from tools/extract into lib/Xform/IPO
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4759 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-19 18:42:59 +00:00
Chris Lattner
a2b8d7bff2 Fix testcase: FunctionResolve/2002-11-09-ExternFn.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4668 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-10 03:36:55 +00:00
Chris Lattner
93fbd733e7 Use the new getMainFunction() method to efficiently locate main
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4630 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-08 20:34:21 +00:00
Chris Lattner
6f23963adc Fix bug: FunctionResolve/2002-11-07-RetMismatch.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4618 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-08 00:38:20 +00:00
Chris Lattner
c966a2acee Really disable pool allocator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4216 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-17 04:57:09 +00:00
Chris Lattner
69da5cf261 - Change Function's so that their argument list is populated when they are
constructed.  Before, external functions would have an empty argument list,
    now a Function ALWAYS has a populated argument list.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4149 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-13 20:57:00 +00:00
Chris Lattner
eaa359586c Account for global variables resolved more accurately.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4143 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-13 17:30:30 +00:00
Chris Lattner
66c25ff438 Use methods that are more explanatory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4142 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-13 17:12:47 +00:00
Chris Lattner
7a11a94183 Stop using DataStructureGraph.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4106 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-10 20:33:46 +00:00