Chris Lattner
596d18c8dd
Clean up DEBUG output
...
llvm-svn: 18081
2004-11-21 03:44:32 +00:00
Chris Lattner
ce43d636fe
Allow targets to avoid emitting a stub for EVERY lazily resolved call. In
...
most cases (e.g. direct calls) no stub is needed.
llvm-svn: 18080
2004-11-21 03:37:42 +00:00
Chris Lattner
d8c2739b24
Implement relocation support by adding a target independent resolver interface.
...
llvm-svn: 18069
2004-11-20 23:57:07 +00:00
Chris Lattner
c6c7f2ac58
This method does not exist any longer.
...
llvm-svn: 18061
2004-11-20 23:51:03 +00:00
Chris Lattner
d70e6be604
Add getCurrentPCOffset() and addRelocation() methods.
...
Add stub support for relocations to finishFunction
llvm-svn: 18035
2004-11-20 03:46:14 +00:00
Chris Lattner
5bf6fe1636
Add accessor
...
llvm-svn: 18030
2004-11-20 03:11:07 +00:00
Chris Lattner
2978400c23
Match change in MachineCodeEmitter prototype.
...
llvm-svn: 18009
2004-11-19 20:56:46 +00:00
Chris Lattner
0169ce5e9e
This is a horrible hack to work around libstdc++ bugs :(
...
llvm-svn: 17988
2004-11-19 08:44:07 +00:00
Chris Lattner
89536fedee
Now that we have ghost linkage, we can force resolution of external symbols
...
immediately instead of lazily.
In this program, for example:
int main() {
printf("hello world\n");
printf("hello world\n");
printf("hello world\n");
printf("hello world\n");
}
We used to have to go through compilation callback 4 times (once for each
call to printf), now we don't go to it at all.
Thanks to Misha for noticing this, and for adding the initial ghost linkage
patches.
llvm-svn: 17864
2004-11-15 23:20:04 +00:00
Chris Lattner
583ea4764c
There is no reason to try to materialize the function from bytecode if it
...
already has been. This may be a small speedup.
llvm-svn: 17863
2004-11-15 23:18:09 +00:00
Misha Brukman
8c397821a5
Implement ExecutionEngine::freeMachineCodeForFunction()
...
llvm-svn: 17601
2004-11-07 23:58:46 +00:00
Brian Gaeke
a757bae04f
When emitting debug msgs for function stubs, don't truncate the
...
printed pointer value if sizeof(unsigned) != pointer size. Instead,
use uintptr_t.
llvm-svn: 17338
2004-10-29 18:22:45 +00:00
Reid Spencer
1be896397a
Fix library name.
...
llvm-svn: 17307
2004-10-28 05:37:24 +00:00
Reid Spencer
d3f7233495
Change Library Names Not To Conflict With Others When Installed
...
llvm-svn: 17286
2004-10-27 23:18:45 +00:00
Reid Spencer
1a344dfd95
Changes to support rand48 tests
...
llvm-svn: 17284
2004-10-27 23:03:44 +00:00
Chris Lattner
0dbd792854
Fix the interpreter crash that Michael McCracken found
...
llvm-svn: 17239
2004-10-26 05:35:14 +00:00
Misha Brukman
cfd8a7eb53
Use cleaner quoting and eliminate blank space
...
llvm-svn: 17174
2004-10-22 23:35:57 +00:00
Reid Spencer
e48ba34fd4
We won't use automake
...
llvm-svn: 17155
2004-10-22 03:35:04 +00:00
Reid Spencer
ce514b1c2c
Initial automake generated Makefile template
...
llvm-svn: 17136
2004-10-18 23:55:41 +00:00
Chris Lattner
2fae8a1ef9
Add support for unreachable
...
llvm-svn: 17056
2004-10-16 18:21:33 +00:00
Chris Lattner
8d479b62ad
Add support for undef
...
llvm-svn: 17055
2004-10-16 18:19:26 +00:00
Reid Spencer
e6418ec30f
Update to reflect changes in Makefile rules.
...
llvm-svn: 16950
2004-10-13 11:46:52 +00:00
Reid Spencer
7d9cba7a0f
Initial version of automake Makefile.am file.
...
llvm-svn: 16885
2004-10-10 20:43:57 +00:00
Reid Spencer
c6a8d70cff
Convert code to compile with vc7.1.
...
Patch contributed by Paolo Invernizzi. Thanks Paolo!
llvm-svn: 16368
2004-09-15 17:06:42 +00:00
Reid Spencer
ce7c15737a
Simplify the sys::Memory interface per Chris' request.
...
llvm-svn: 16318
2004-09-13 22:38:11 +00:00
Reid Spencer
b1df891777
Convert the Emitter to use the lib/System "Memory" interface instead of the
...
old SystemUtils.h interface to allocate RWX blocks of memory.
llvm-svn: 16286
2004-09-11 04:31:03 +00:00
Reid Spencer
c4abcbefb1
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
ffaad65b22
Add a special case for argc,argv
...
llvm-svn: 15802
2004-08-16 01:07:04 +00:00
Chris Lattner
923c3d3594
Don't pass too many arguments into runFunction
...
llvm-svn: 15801
2004-08-16 01:05:35 +00:00
Chris Lattner
9cbc5f306a
Finally, add support for calling arbitrary non-varargs functions.
...
llvm-svn: 15799
2004-08-16 00:14:18 +00:00
Chris Lattner
70ddd561fb
Handle all nullary functions, of any valid return type.
...
llvm-svn: 15798
2004-08-15 23:53:06 +00:00
Chris Lattner
ed3a37a9ed
Fine, go all of the way and check that the argument types are correct as well.
...
llvm-svn: 15797
2004-08-15 23:39:59 +00:00
Chris Lattner
9657e92992
These only really work if returning int or void
...
llvm-svn: 15796
2004-08-15 23:34:48 +00:00
Chris Lattner
557b356131
Handle zero arg function case
...
llvm-svn: 15794
2004-08-15 23:31:43 +00:00
Chris Lattner
c5f794403e
Simplify code a bit, print error message always instead of asserting.
...
llvm-svn: 15793
2004-08-15 23:29:50 +00:00
Alkis Evlogimenos
f853362a44
Stop using getValues().
...
llvm-svn: 15487
2004-08-04 08:44:43 +00:00
Reid Spencer
b6c894409b
bug 122:
...
- Replace ConstantPointerRef usage with GlobalValue usage
- Correct isa<Constant> for GlobalValue subclass
llvm-svn: 14951
2004-07-18 00:41:27 +00:00
Chris Lattner
d7870e4b1a
Fixes for PR341
...
llvm-svn: 14848
2004-07-15 02:51:32 +00:00
Chris Lattner
94212f7102
Fixes for PR341
...
llvm-svn: 14847
2004-07-15 02:51:31 +00:00
Chris Lattner
196b4f394f
The cleanup is done. Update comment.
...
llvm-svn: 14761
2004-07-11 08:24:02 +00:00
Chris Lattner
6029e3234e
Make add constantexprs work with all types, fixing the regressions from last night
...
llvm-svn: 14760
2004-07-11 08:01:11 +00:00
Chris Lattner
6bbbf294d1
Goodbye macro hell, hello nice clean simple extensible code. This change
...
also gives the JIT the ability to dynamically load targets. e.g.
lli -load libparisc.so -march=parisc foo.bc
llvm-svn: 14750
2004-07-11 04:02:06 +00:00
Reid Spencer
b28dd1ea9f
Make error message consistent with the rest of LLVM by saying that bytecode
...
is read, not parsed.
llvm-svn: 14677
2004-07-07 21:20:28 +00:00
Reid Spencer
ff9f74082f
Fix for bug 391.
...
Improve exeception handling around bcreader invocations.
llvm-svn: 14674
2004-07-07 21:01:38 +00:00
Reid Spencer
50ec3f9325
Add #include <iostream> since Value.h does not #include it any more.
...
llvm-svn: 14622
2004-07-04 12:19:56 +00:00
Chris Lattner
cc465361d9
Move the IntrinsicLowering header into the CodeGen directory, as per PR346
...
llvm-svn: 14266
2004-06-20 07:49:54 +00:00
Chris Lattner
8a9f1ebd22
Move the IntrinsicLowering header into the CodeGen directory
...
llvm-svn: 14265
2004-06-20 07:46:18 +00:00
Chris Lattner
0cd29ae2cd
Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
...
llvm-svn: 14201
2004-06-17 18:19:28 +00:00
Brian Gaeke
19d2a396da
Add int ferror(FILE *)
...
llvm-svn: 14194
2004-06-16 02:56:40 +00:00
Chris Lattner
2ac00d274f
Implement PR315: abort, don't warn, when missing external functions encountered
...
This fixes some critical problems building libstdc++ on cygwin.
llvm-svn: 13934
2004-06-01 21:49:00 +00:00
Chris Lattner
14dedcd354
Use the SystemUtils.h file to do our dirty work.
...
llvm-svn: 13868
2004-05-28 00:57:27 +00:00
Chris Lattner
d646e15d1a
Remove long unused #includes
...
llvm-svn: 13857
2004-05-27 21:25:44 +00:00
Chris Lattner
8014d498cb
These #includes are long dead
...
llvm-svn: 13856
2004-05-27 21:24:38 +00:00
Chris Lattner
736ca634a7
This code is a real mess, but at least get the JIT *building* on platforms
...
(such as plan 9) without mmap. Of course it won't RUN... but that's another
step. :)
llvm-svn: 13839
2004-05-27 18:03:56 +00:00
Reid Spencer
63530c743e
Get rid of a wart: useless getFILE function is now a cast macro.
...
llvm-svn: 13747
2004-05-25 08:46:15 +00:00
Brian Gaeke
aaeb4c4d23
Generalize the strlen size_t hack, for the benefit of the other external
...
functions with wrappers that either take or return size_ts.
llvm-svn: 13296
2004-05-01 06:42:15 +00:00
Brian Gaeke
96889991bb
Go back to the interpreter main loop after performing intrinsic lowering,
...
because 1) the first instruction might not be a call site, and
2) CS and SF.Caller were not getting set to point to the new call site
anyway (resulting in a crash on e.g. call %llvm.memset).
llvm-svn: 13122
2004-04-23 18:05:28 +00:00
Brian Gaeke
3cde72d6e2
Implement emitWordAt() for the JIT emitter.
...
llvm-svn: 13118
2004-04-23 17:11:14 +00:00
Chris Lattner
8b841e0e35
Add support for the select instruction
...
llvm-svn: 13076
2004-04-20 16:43:21 +00:00
Brian Gaeke
2c02798e86
Add a TargetData to the PassManager regardless of the TargetMachine.
...
This should unbreak the Sparc JIT again.
llvm-svn: 12949
2004-04-14 17:45:52 +00:00
Chris Lattner
27dff42330
Adjust to new interface
...
llvm-svn: 12646
2004-04-04 19:47:06 +00:00
Chris Lattner
5c053bfa99
Adjust to new gep_type_iterator prototypes.
...
llvm-svn: 12644
2004-04-04 17:30:06 +00:00
Chris Lattner
686a74c7ac
Fix PR296: [execution engines] Unhandled cast constant expression
...
llvm-svn: 12435
2004-03-16 08:38:56 +00:00
Chris Lattner
f7bc6fd913
Rename the intrinsic enum values for llvm.va_* from Intrinsic::va_* to
...
Intrinsic::va*. This avoid conflicting with macros in the stdlib.h file.
llvm-svn: 12356
2004-03-13 00:24:00 +00:00
Brian Gaeke
c60efbcee1
My fix for PR274 broke the build on Darwin/PPC. As I'm fairly certain this
...
bug only affects Linux systems that use GLIBC, I'm going to put ifdefs around
the array.
llvm-svn: 12269
2004-03-10 17:38:28 +00:00
Brian Gaeke
acf93be258
Address PR274 - '[JIT] Programs cannot resolve the fstat function'
...
by trying to get the compiler to generate an undefined reference for it
and related functions which live in libc_nonshared.a on Linux.
Linkers... sigh.
llvm-svn: 12256
2004-03-09 05:22:10 +00:00
Chris Lattner
5924de460e
remove obsolete comment
...
llvm-svn: 11872
2004-02-26 07:59:22 +00:00
Brian Gaeke
aba4159be8
Represent va_list in interpreter as a (ec-stack-depth . var-arg-index)
...
pair, and look up varargs in the execution stack every time, instead of
just pushing iterators (which can be invalidated during callFunction())
around. (union GenericValue now has a "pair of uints" member, to support
this mechanism.) Fixes Bug 234.
llvm-svn: 11845
2004-02-25 23:01:48 +00:00
Brian Gaeke
4f0a829a68
Great sparc renaming fallout IV: Sparc --> SparcV9.
...
llvm-svn: 11844
2004-02-25 22:09:36 +00:00
Brian Gaeke
c6de948cd1
Great renaming part II: Sparc --> SparcV9 (also includes command-line options and Makefiles)
...
llvm-svn: 11827
2004-02-25 19:08:12 +00:00
Chris Lattner
2679a58a61
Make the JIT zero out globals with memset instead of an element at a time. This
...
should speed it up a bit on a lot of programs
llvm-svn: 11472
2004-02-15 05:54:06 +00:00
Brian Gaeke
40b9cf9615
Fix off-by-one in Interpreter::getFirstVarArg(), which was punishing
...
any attempts by LLI to use varargs (possibly left over from the introduction
of IntrinsicLowering??)
llvm-svn: 11370
2004-02-13 06:18:39 +00:00
Brian Gaeke
212ffba663
The Interpreter was failing the AtExit UnitTest. This fixes it.
...
llvm-svn: 11367
2004-02-13 05:48:00 +00:00
Chris Lattner
a1757d1d91
Start using the new and improve interface to FunctionType arguments
...
llvm-svn: 11224
2004-02-09 04:14:01 +00:00
Chris Lattner
68fdb35576
rename the "exceptional" destination of an invoke instruction to the 'unwind' dest
...
llvm-svn: 11202
2004-02-08 21:44:31 +00:00
Chris Lattner
ecaa4c58e2
Print out all globals as they are emitted, not just those emitted from
...
emitGlobals
llvm-svn: 11191
2004-02-08 19:33:23 +00:00
Chris Lattner
ffd16b0190
There is no reason to #define fd
...
llvm-svn: 11190
2004-02-08 19:33:07 +00:00
Chris Lattner
becd58c6cb
Print an error message if we can't materialize the bytecode file
...
llvm-svn: 11043
2004-02-01 01:07:25 +00:00
Chris Lattner
c76f82c957
Print an error message if there is an error materialize the bc file.
...
llvm-svn: 11041
2004-02-01 00:32:35 +00:00
Brian Gaeke
7824ed3d12
Don't pass anything to the IntrinsicLowering class that is not_intrinsic,
...
because that makes it abort. Also, fix a typo in a comment.
This checkin brought to you by the "It only takes about 30 seconds to run
ENABLE_LLI tests on Shootout on zion, even if they all dump core" fund.
llvm-svn: 10844
2004-01-14 06:02:53 +00:00
Chris Lattner
46fdc8ce43
Add new ExecutionEngine::getGlobalValueAtAddress method, which can efficiently
...
turn a memory address back into the LLVM global object that starts at that
address. Note that this won't cause any additional datastructures to be built
for clients of the EE that don't need this information.
Also modified some code to not access the GlobalAddress map directly.
llvm-svn: 10674
2003-12-31 20:21:04 +00:00
Chris Lattner
c37577eb9f
Clean up a lot of the code I added yesterday by exposing the IntrinsicLowering
...
implementation from the TargetMachine directly.
llvm-svn: 10636
2003-12-28 21:23:38 +00:00
Chris Lattner
44f1ab7c2f
Pass around IntrinsicLowering instances as appropriate.
...
Reimplement the Interpreters implementation of va_* to be more direct.
llvm-svn: 10627
2003-12-28 09:44:37 +00:00
Chris Lattner
3593bb9dd6
Factor code out of LLI
...
llvm-svn: 10616
2003-12-26 06:50:30 +00:00
Chris Lattner
ddcbddf9e9
No longer run atExit functions from run()
...
rename run to runFunction
Genericize the runFunction code a little bit, though it still stinks
llvm-svn: 10610
2003-12-26 06:13:47 +00:00
Chris Lattner
d7d8336d73
No longer run atExit functions from run()
...
rename run to runFunction
llvm-svn: 10609
2003-12-26 06:13:05 +00:00
Chris Lattner
013d4bee41
This should not be needed anymore
...
llvm-svn: 10558
2003-12-20 10:19:18 +00:00
Chris Lattner
edda0e5d4f
Implement PR135, lazy emission of global variables
...
llvm-svn: 10549
2003-12-20 03:36:47 +00:00
Chris Lattner
214005e5fb
Simple refactorings to prepare for lazy global emission
...
Also, add a stat for the number of globals emitted
llvm-svn: 10547
2003-12-20 02:45:37 +00:00
Chris Lattner
cd8f92bc62
Cleanup the JIT as per PR176. This renames the VM class to JIT, and merges the
...
VM.cpp and JIT.cpp files into JIT.cpp. This also splits some nasty code out
into TargetSelect.cpp so that people hopefully won't notice it. :)
llvm-svn: 10544
2003-12-20 01:46:27 +00:00
Chris Lattner
32658dbaf3
Update for changes in the JIT
...
llvm-svn: 10543
2003-12-20 01:45:17 +00:00
Chris Lattner
1cb1efedb3
Rip JIT specific stuff out of TargetMachine, as per PR176
...
llvm-svn: 10542
2003-12-20 01:22:19 +00:00
Chris Lattner
9047cde657
Finegrainify namespacification
...
llvm-svn: 10465
2003-12-14 23:25:48 +00:00
Brian Gaeke
84101bcdb8
Dynamically get the right-sized member of a GenericValue to hold a size_t, and
...
use it to return the result of strlen.
llvm-svn: 10433
2003-12-12 15:38:06 +00:00
Chris Lattner
f58e098889
Implement the ExecutionEngine::getPointerToFunctionOrStub by forwarding the
...
request on to the TargetMachine if it supports the getJITStubForFunction method
llvm-svn: 10431
2003-12-12 07:12:02 +00:00
Brian Gaeke
fb0c4c3d39
Since we are using a gep_type_iterator, we apparently must get the type
...
index by using I.getOperand() here. This was failing an assertion on
basically every struct access.
llvm-svn: 10426
2003-12-12 05:13:05 +00:00
Brian Gaeke
7fe399f169
Fix typo in comment. Add prototype for getConstantExprValue().
...
llvm-svn: 10390
2003-12-11 00:23:28 +00:00
Brian Gaeke
e7599245cb
Add support for --debug-only=interpreter, to print out instrs before
...
interpreting them.
Move support for getting the value of a ConstantExpr into
getConstantExprValue(), and add support for the rest of the different
kinds of ConstantExprs. (I don't think I like ConstantExprs!)
This requires separate procedures executeShlInst() and executeShrInst().
Reduce the number of references to TheEE.
Get rid of an old comment mentioning annotations.
Fix exitCalled(), which was crashing the Interpreter. This was a
leftover from the return-value code refactoring.
llvm-svn: 10389
2003-12-11 00:22:59 +00:00
Chris Lattner
369445aaa6
implement method
...
llvm-svn: 10321
2003-12-08 08:23:04 +00:00
Chris Lattner
23328c5f69
Use the new method, though noone currently implements it any better than before
...
llvm-svn: 10320
2003-12-08 08:22:48 +00:00