Commit Graph

4456 Commits

Author SHA1 Message Date
Brian Gaeke 1a7668a9fd Implement replaceMachineCodeForFunction() for x86.
llvm-svn: 9204
2003-10-17 18:27:46 +00:00
Brian Gaeke 2e24fcadf5 Refactor jump insertion code from CompilationCallback() into insertJumpAtAddr().
Make insertFarJumpAtAddr() return void, because nothing uses its return value.
Remove some commented-out code.
Implement replaceMachineCodeForFunction() for SPARC.

llvm-svn: 9203
2003-10-17 18:27:37 +00:00
Brian Gaeke 240fc39b07 Add prototype for replaceMachineCodeForFunction().
llvm-svn: 9202
2003-10-17 18:27:25 +00:00
Misha Brukman de360f88c8 Return the Module that we just materialized.
llvm-svn: 9201
2003-10-17 18:27:13 +00:00
Brian Gaeke d2bc5ac045 Tidy up doxygen comment for getPointerToFunction().
Add prototypes for recompileAndRelinkFunction() and runJITOnFunction().

llvm-svn: 9200
2003-10-17 18:27:12 +00:00
Brian Gaeke 3b5f24513c Refactor running the JIT passes on a single function into the new method,
runJITOnFunction().

Add new method for recompiling and patching in new versions of functions,
recompileAndRelinkFunction().

llvm-svn: 9199
2003-10-17 18:27:00 +00:00
Brian Gaeke 09d40333a2 Remove extra blank line.
llvm-svn: 9196
2003-10-17 18:09:10 +00:00
Chris Lattner 1facf89eaf Do not crash on empty structures
llvm-svn: 9195
2003-10-17 18:03:54 +00:00
Chris Lattner 0aa8eaf7bf Tighten up handling of checks for shift instructions
llvm-svn: 9191
2003-10-17 05:11:44 +00:00
Alkis Evlogimenos 8faf8d93d5 Eliminate some extraneous code in SlotCalculator::insertVal().
Rename SlotCalculator::getValSlot() to SlotCalculator::getSlot(),
       SlotCalculator::insertValue() to SlotCalculator::getOrCreateSlot(),
       SlotCalculator::insertVal() to SlotCalculator::insertValue(), and
       SlotCalculator::doInsertVal() to SlotCalculator::doInsertValue().

llvm-svn: 9190
2003-10-17 02:02:40 +00:00
Brian Gaeke c05684ad22 Fix typo in comment.
llvm-svn: 9187
2003-10-16 23:45:05 +00:00
Brian Gaeke 13b9395071 Fix a typo in a comment, and zap a blank line.
llvm-svn: 9184
2003-10-16 23:33:38 +00:00
Misha Brukman 0659ddc455 Add separator between different types of readers.
llvm-svn: 9183
2003-10-16 21:19:54 +00:00
Misha Brukman 1273147daf JIT.cpp:
* #include "llvm/ModuleProvider"
* alphabetize #includes
* omit extraneous parens in pointer expressions

VM.cpp:
* #include "llvm/ModuleProvider"
* alphabetize #includes

llvm-svn: 9182
2003-10-16 21:19:34 +00:00
Misha Brukman 260b0c88a0 * Reorder includes as per the style guide
* Move the constructors from .h file here
* Document ExecutionEngine::create()
* Catch exception possibly thrown by ModuleProvider::releaseModule()

llvm-svn: 9181
2003-10-16 21:18:05 +00:00
Chris Lattner 6187774380 Minor cleanups
llvm-svn: 9177
2003-10-16 20:12:13 +00:00
Chris Lattner 068ad84038 Add support for 'weak' linkage.
llvm-svn: 9171
2003-10-16 18:29:00 +00:00
Chris Lattner 2d05c60bac Add support for 'weak' linkage.
For now, we translate linkonce into weak linkage in the bytecode format because
we don't have enough bits to represent it.  We will rev the bytecode version
soon anyways, so this will be fixed in the near future.

llvm-svn: 9170
2003-10-16 18:28:50 +00:00
Chris Lattner 079edeb919 Completely rewrite support for the Value::use_* list. Now, all operations on
this list (except use_size()) are constant time.  Before the killUse method
(used whenever something stopped using a value) was linear time, and thus
very very slow for large programs.

This speeds GCCAS up _substantially_ on large programs: almost 2x for 176.gcc:

176.gcc:     77.07s -> 37.38s
177.mesa:     7.59s ->  5.57s
252.eon:     21.02s -> 19.52s (*)
253.perlbmk: 11.40s -> 13.05s
254.gap:      7.25s -> 7.42s

252.eon would speed up a whole lot more, but optimization time is being
dominated by the inlining pass, which needs to be fixed.

llvm-svn: 9160
2003-10-16 16:53:07 +00:00
Chris Lattner 50b6858e2e This code does not require random access use_lists
llvm-svn: 9156
2003-10-16 16:49:12 +00:00
Chris Lattner 5dbb244edb Eliminate using declaration
Rewrite code to work with use_lists what are either random access or bidirectional

llvm-svn: 9155
2003-10-16 16:48:53 +00:00
Chris Lattner 9177d11367 #include vector which we will need here soon
llvm-svn: 9144
2003-10-15 22:09:32 +00:00
Brian Gaeke 828449f9fe Fix up error message.
llvm-svn: 9139
2003-10-15 20:46:58 +00:00
Chris Lattner f95d9b99b3 Decrease usage of use_size()
llvm-svn: 9135
2003-10-15 16:48:29 +00:00
Chris Lattner f77a856f3b Cleanup
llvm-svn: 9133
2003-10-15 16:42:21 +00:00
Chris Lattner 1499851ef6 Generalize abstract interpreter interface to allow linking in an arbitrary number of shared objects
llvm-svn: 9129
2003-10-14 21:52:52 +00:00
Misha Brukman 1d2d8ec853 Order #includes as per the style guide.
llvm-svn: 9128
2003-10-14 21:42:11 +00:00
Misha Brukman 56a8642a42 Enabling incremental bytecode loading in the JIT:
* FunctionPassManager ctor now takes in a ModuleProvider
* run() materializes function before running passes on it

llvm-svn: 9126
2003-10-14 21:38:42 +00:00
Misha Brukman 299f3e650f Enabling incremental bytecode loading in the JIT:
* The VM is now constructed with a ModuleProvider

llvm-svn: 9125
2003-10-14 21:37:41 +00:00
Misha Brukman 2f1e200248 Enabling incremental bytecode loading in the JIT:
* ExecutionEngine and VM can be constructed using a ModuleProvider.

llvm-svn: 9124
2003-10-14 21:36:31 +00:00
Chris Lattner 66da9ef634 Substantial cleanups:
* Add header comment
 * Remove extraneous #includes
 * Move the FileType enum into the GCC class
 * The GCC class is not virtual.
 * Move all of the "constructor" functions into the classes themselves
 * Stop using cl::list as arguments, use std::vector instead (which cl::list
   derives from)
 * Improve comments

llvm-svn: 9121
2003-10-14 21:34:11 +00:00
Chris Lattner 74d64c7d02 Actually return an error if something bad happens, don't just exit.
llvm-svn: 9119
2003-10-14 21:07:25 +00:00
Chris Lattner fdfe370406 Output a contorted sequence of instructions to make sure that we don't access
off the bottom of the stack.  This fixes PR#41

llvm-svn: 9114
2003-10-14 19:09:05 +00:00
Chris Lattner 97c7a8ed1a Disable the leaf function optimization, which is apparently not legal on
X86/linux.  :(  The problem is that a signal delivered while the function
is executing could clobber the functions stack.  This is a partial fix
for PR41.

llvm-svn: 9113
2003-10-14 18:52:41 +00:00
Chris Lattner b4778c73c9 Do not move variable sized allocations to the top of the caller, which might
break dominance relationships, and is otherwise bad.  This fixes bug:
Inline/2003-10-13-AllocaDominanceProblem.ll.  This also fixes miscompilation
of 3 176.gcc source files (reload1.c, global.c, flow.c)

llvm-svn: 9109
2003-10-14 01:11:07 +00:00
Chris Lattner 08ca35b6d6 Do not allow fallthroughs in switch statements. This fixes PR37,
253.perlbmk, and test/Programs/SingleSource/UnitTests/2003-10-13-SwitchTest.c!

llvm-svn: 9101
2003-10-13 20:32:04 +00:00
Brian Gaeke 6855f03c56 Remove WordsEmitted statistic; there's already a non-backend-specific
jello statistic for this (just divide #-bytes-of-code-emitted by 4).

Rewrite head-of-file comment.

llvm-svn: 9098
2003-10-13 19:51:20 +00:00
Chris Lattner abb3b38448 LLI no longer has -abort-on-exception
llvm-svn: 9097
2003-10-13 18:26:49 +00:00
Chris Lattner 8260db9a69 Use the autoconf macro John wrote
llvm-svn: 9095
2003-10-13 17:13:53 +00:00
Chris Lattner 612cafef0a Whoops, we inserted into the wrong set. What's up with the dead set anyway?
llvm-svn: 9094
2003-10-13 16:49:21 +00:00
Chris Lattner 951e7329e8 Use external df iterators to avoid revisiting blocks in functions with
multiple setjmp calls.

llvm-svn: 9093
2003-10-13 16:44:50 +00:00
Chris Lattner f5d946eced Make use of "external" depth-first iterators to avoid revisiting nodes
multiple times.  This reduces the time to construct post-dominance sets a LOT.
For example, optimizing perlbmk goes from taking 12.9894s to 1.4074s.

llvm-svn: 9091
2003-10-13 16:36:06 +00:00
Chris Lattner 0c068c097a Stop using "reverse depth first" order
llvm-svn: 9081
2003-10-13 15:21:58 +00:00
Chris Lattner aa78cc9e5d Minor cleanups
llvm-svn: 9079
2003-10-13 14:57:53 +00:00
Chris Lattner e859403772 Speed up TypesEqual by specializing it for all of the derived types, avoiding
a lot of virtual method dispatch overhead.

llvm-svn: 9078
2003-10-13 14:55:56 +00:00
Chris Lattner a785563692 Avoid calling getTypeSlot more
llvm-svn: 9077
2003-10-13 14:34:59 +00:00
Chris Lattner 1dc3f3fdc0 Avoid creating lots of pointless opaque types, with short lifetimes
llvm-svn: 9076
2003-10-13 14:03:36 +00:00
Chris Lattner c7bc3bb503 This is a header file, hear me roar
llvm-svn: 9075
2003-10-13 05:34:24 +00:00
Chris Lattner ab16a659d7 * Remove extraneous #includes
* Fix a nasty initializer ordering bug.  Any only-CFG passes which registered
  themselves before the CFGOnlyAnalysis vector initialized got forgotten and
  thus got invalidated and recomputed.

In particular, in my compiled version of gccas, the Loop information pass was
being recomputed unnecessarily.

llvm-svn: 9074
2003-10-13 05:33:01 +00:00
Chris Lattner 178957028b Wrap code at 80 columns
llvm-svn: 9073
2003-10-13 05:04:27 +00:00