Commit Graph

539 Commits

Author SHA1 Message Date
Reid Spencer 7e80b0b31e For PR950:
Make necessary changes to support DIV -> [SUF]Div. This changes llvm to
have three division instructions: signed, unsigned, floating point. The
bytecode and assembler are bacwards compatible, however.

llvm-svn: 31195
2006-10-26 06:15:43 +00:00
Reid Spencer e0fc4dfc22 For PR950:
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.

llvm-svn: 31063
2006-10-20 07:07:24 +00:00
Chris Lattner 8d2b9a431b Unbreak the JIT
llvm-svn: 30384
2006-09-15 04:56:11 +00:00
Anton Korobeynikov d61d39ec53 Adding dllimport, dllexport and external weak linkage types.
DLL* linkages got full (I hope) codegeneration support in C & both x86
assembler backends.
External weak linkage added for future use, we don't provide any
codegeneration, etc. support for it.

llvm-svn: 30374
2006-09-14 18:23:27 +00:00
Chris Lattner cd34779ef6 Fix a ton of jit failures
llvm-svn: 30292
2006-09-13 16:21:10 +00:00
Evan Cheng 3228e750be Reflect MachineConstantPoolEntry changes.
llvm-svn: 30277
2006-09-12 20:59:59 +00:00
Nate Begeman a0d95a8da9 Behold, more work on relocations. Things are looking pretty good now.
llvm-svn: 30240
2006-09-10 23:03:44 +00:00
Chris Lattner 12e97307a1 Completely rearchitect the interface between targets and the pass manager.
This pass:

1. Splits TargetMachine into TargetMachine (generic targets, can be implemented
any way, like the CBE) and LLVMTargetMachine (subclass of TM that is used by
things using libcodegen and other support).
2. Instead of having each target fully populate the passmgr for file or JIT
   output, move all this to common code, and give targets hooks they can
   implement.
3. Commonalize the target population stuff between file emission and JIT
   emission.
4. All (native code) codegen stuff now happens in a FunctionPassManager, which
   paves the way for "fast -O0" stuff in the CFE later, and now LLC could
   lazily stream .bc files from disk to use less memory.
5. There are now many fewer #includes and the targets don't depend on the
   scalar xforms or libanalysis anymore (but codegen does).
6. Changing common code generator pass ordering stuff no longer requires
   touching all targets.
7. The JIT now has the option of "-fast" codegen or normal optimized codegen,
   which is now orthogonal to the fact that JIT'ing is being done.

llvm-svn: 30081
2006-09-04 04:14:57 +00:00
Chris Lattner ad36544457 eliminate use of TM.getName()
llvm-svn: 30068
2006-09-03 18:37:12 +00:00
Evan Cheng 88c268b621 Remove extra spaces.
llvm-svn: 30025
2006-09-01 18:45:22 +00:00
Evan Cheng 31c99969a9 Last check-in was a mistake...
I've been told apple gcc version number is not guaranteed to increase
monotonically. Change the preprocess condition to make it less risky.

The configuration change is done during the middle 10.4 life cycle so we have
to check __APPLE_CC. For future OS X release, we should be able to assume
-fenable-cxa-atexit is the default.

llvm-svn: 30024
2006-09-01 18:42:59 +00:00
Evan Cheng d176cdf76d *** empty log message ***
llvm-svn: 30023
2006-09-01 18:40:46 +00:00
Evan Cheng 4b8b6ae924 Better comments.
llvm-svn: 30017
2006-09-01 07:09:56 +00:00
Evan Cheng c5fddc566c Yikes. This requires checking apple gcc version.
llvm-svn: 30016
2006-09-01 07:00:46 +00:00
Chris Lattner 0621caef44 initial changes to support JIT'ing from multiple module providers, implicitly
linking the program on the fly.

llvm-svn: 29721
2006-08-16 01:24:12 +00:00
Chris Lattner e3861501e6 Fix handling of asm specifiers for external globals. This unbreaks many programs
on leopard in the jit.

llvm-svn: 29391
2006-07-28 21:11:31 +00:00
Evan Cheng 78bf1074fc Resolve BB references with relocation.
llvm-svn: 29351
2006-07-27 18:21:10 +00:00
Jim Laskey 8307be446f Fixed a typo in Evan's submisson.
llvm-svn: 29345
2006-07-27 13:40:34 +00:00
Evan Cheng 93386e02fe Move synchronizeICache from TargetJITInfo into a static function in JITEmitter.cpp
llvm-svn: 29334
2006-07-27 06:33:55 +00:00
Chris Lattner 2c3e9bab6f Fix warning on linux
llvm-svn: 29314
2006-07-27 00:04:14 +00:00
Evan Cheng f6acb34d23 - Refactor the code that resolve basic block references to a TargetJITInfo
method.
- Added synchronizeICache() to TargetJITInfo. It is called after each block
  of code is emitted to flush the icache. This ensures correct execution
  on targets that have separate dcache and icache.
- Added PPC / Mac OS X specific code to do icache flushing.

llvm-svn: 29276
2006-07-25 20:40:54 +00:00
Nate Begeman 04810086f1 Fix the build on my old and busted version of OS X
llvm-svn: 29266
2006-07-22 16:59:38 +00:00
Evan Cheng abc9577539 Forgot to #ifdef __APPLE__
llvm-svn: 29264
2006-07-22 00:42:03 +00:00
Evan Cheng 71ebc91c34 Resolve __dso_handle.
llvm-svn: 29259
2006-07-21 23:06:20 +00:00
Chris Lattner 156907198e Remove non-portable optimization that isn't worth it
llvm-svn: 29115
2006-07-12 00:31:47 +00:00
Chris Lattner 1fb6e0d79d Change AllocateRWX/DeallocateRWX do not throw an exception.
llvm-svn: 29057
2006-07-07 17:31:41 +00:00
Chris Lattner b30f735cf3 Adapt to new interface function materialization interface
llvm-svn: 29051
2006-07-07 17:18:09 +00:00
Evan Cheng 6a34939af6 Added jump table address relocation.
llvm-svn: 28908
2006-06-23 01:02:37 +00:00
Chris Lattner 6c79005b0d Simplify TargetData ctor call
llvm-svn: 28832
2006-06-16 18:24:38 +00:00
Chris Lattner e796266d58 Only count instructions as code size, not constant pools and other per-function stuff.
llvm-svn: 28827
2006-06-16 18:09:26 +00:00
Chris Lattner 91f228b291 Simplify interpreter construction.
llvm-svn: 28826
2006-06-16 18:08:38 +00:00
Chris Lattner 71819be586 Fix -pedantic warnings.
llvm-svn: 28636
2006-06-01 17:29:22 +00:00
Chris Lattner e1ade0a523 Fix -pedantic warnings
llvm-svn: 28635
2006-06-01 17:27:11 +00:00
Chris Lattner dcd73534df Silence some -pedantic warnings.
llvm-svn: 28629
2006-06-01 17:12:14 +00:00
Reid Spencer 6e64180f03 For PR786:
Minor tweaks in public headers and a few .cpp files so that LLVM can build
successfully with -pedantic and projects using LLVM with -pedantic don't
get warnings from LLVM. There's still more -pedantic warnings to fix.

llvm-svn: 28453
2006-05-24 19:21:13 +00:00
Chris Lattner aa10fb7ebe Make this print the right start pointer
llvm-svn: 28321
2006-05-16 06:45:50 +00:00
Chris Lattner 63539389ca LoadLibraryPermanently can theoretically throw an exception. Do not propagate
it out of 'ExecutionEngine::create'.  This fixes a problem reported by coverity.

llvm-svn: 28293
2006-05-14 19:01:55 +00:00
Chris Lattner 1fe2d2c600 Fix a hypothetical memory leak, identified by Coverity. In practice, this
object is never deleted though.

llvm-svn: 28256
2006-05-12 18:10:12 +00:00
Owen Anderson 8c2c1e90c4 Refactor a bunch of includes so that TargetMachine.h doesn't have to include
TargetData.h.  This should make recompiles a bit faster with my current
TargetData tinkering.

llvm-svn: 28238
2006-05-12 06:33:49 +00:00
Chris Lattner 22acb80971 For extra sanity checking, fill free'd memory with garbage so we know that
people aren't reusing machine code buffers at all.

llvm-svn: 28228
2006-05-12 00:03:12 +00:00
Chris Lattner 3c729b9e5d Fix some bugs in the freelist manipulation code.
Finally, implement ExecutionEngine::freeMachineCodeForFunction.

llvm-svn: 28227
2006-05-11 23:56:57 +00:00
Chris Lattner 873ef133ce Significantly revamp allocation of machine code to use free lists, real
allocation policies and much more.  All this complexity, and we have no
functionality change, woo! :)

llvm-svn: 28225
2006-05-11 23:08:08 +00:00
Chris Lattner 6d8dd189f6 Move some methods out of line so that MutexGuard.h isn't needed in a public header.
llvm-svn: 28179
2006-05-08 22:00:52 +00:00
Chris Lattner b6277c510c Adjust to use proper TargetData copy ctor
llvm-svn: 28112
2006-05-04 21:18:40 +00:00
Chris Lattner 005d7174c8 minor cleanups, no functionality change
llvm-svn: 28087
2006-05-03 18:55:56 +00:00
Chris Lattner 1d8ee1fc80 Suck block address tracking out of targets into the JIT Emitter. This
simplifies the MachineCodeEmitter interface just a little bit and makes
BasicBlocks work like constant pools and jump tables.

llvm-svn: 28082
2006-05-03 17:10:41 +00:00
Owen Anderson 20a631fde7 Refactor TargetMachine, pushing handling of TargetData into the target-specific subclasses. This has one caller-visible change: getTargetData() now returns a pointer instead of a reference.
This fixes PR 759.

llvm-svn: 28074
2006-05-03 01:29:57 +00:00
Chris Lattner 37c39b9c62 Align function bodies correctly.
llvm-svn: 28073
2006-05-03 01:03:20 +00:00
Chris Lattner 77fe5b4459 Simplify some code. Don't add memory blocks to the Blocks list twice.
llvm-svn: 28071
2006-05-03 00:54:49 +00:00
Chris Lattner d8b192ba3b Change the BasicBlockAddrs map to be a vector, indexed by MBB number.
llvm-svn: 28069
2006-05-03 00:32:55 +00:00