summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* fix one more fp80 case (used only by Interpreter)Dale Johannesen2009-03-241-21/+5
| | | | | | and streamline code here a bit. llvm-svn: 67636
* Change JIT for different layout of fp80.Dale Johannesen2009-03-241-5/+5
| | | | llvm-svn: 67629
* Add support to the JIT for true non-lazy operation. When a call to a functionNate Begeman2009-02-181-0/+1
| | | | | | | | | | | | | | | | | | | | that has not been JIT'd yet, the callee is put on a list of pending functions to JIT. The call is directed through a stub, which is updated with the address of the function after it has been JIT'd. A new interface for allocating and updating empty stubs is provided. Add support for removing the ModuleProvider the JIT was created with, which would otherwise invalidate the JIT's PassManager, which is initialized with the ModuleProvider's Module. Add support under a new ExecutionEngine flag for emitting the infomration necessary to update Function and GlobalVariable stubs after JITing them, by recording the address of the stub and the name of the GlobalValue. This allows code to be copied from one address space to another, where libraries may live at different virtual addresses, and have the stubs updated with their new correct target addresses. llvm-svn: 64906
* allow main to have any integer type.Chris Lattner2009-02-041-1/+1
| | | | llvm-svn: 63743
* Add support for deleting a module provider from a JIT in such a way that it ↵Nate Begeman2009-01-231-1/+19
| | | | | | does not cause the owned module to be fully materialized. llvm-svn: 62864
* rename methods in System/Host to be more consistent.Chris Lattner2009-01-221-4/+4
| | | | llvm-svn: 62776
* Add the private linkage.Rafael Espindola2009-01-151-2/+2
| | | | llvm-svn: 62279
* Rename getABITypeSize to getTypePaddedSize, asDuncan Sands2009-01-121-5/+5
| | | | | | suggested by Chris. llvm-svn: 62099
* More debug output.Evan Cheng2008-11-071-1/+1
| | | | llvm-svn: 58868
* Improve JIT debugging outputs format consistency.Evan Cheng2008-11-061-5/+4
| | | | llvm-svn: 58807
* Debugging output tweak.Evan Cheng2008-11-051-2/+2
| | | | llvm-svn: 58737
* 80 col violation.Evan Cheng2008-11-041-2/+2
| | | | llvm-svn: 58684
* Support for allocation of TLS variables in the JIT. Allocation of a globalNicolas Geoffray2008-10-251-12/+15
| | | | | | | | variable is moved to the execution engine. The JIT calls the TargetJITInfo to allocate thread local storage. Currently, only linux/x86 knows how to allocate thread local global variables. llvm-svn: 58142
* little optimization: reuse getPointerToGlobalIfAvailable(CGV) value in ↵Nuno Lopes2008-10-141-1/+1
| | | | | | emitGlobals() llvm-svn: 57484
* Add a "loses information" return value to APFloat::convertDale Johannesen2008-10-091-1/+2
| | | | | | | and APFloat::convertToInteger. Restore return value to IEEE754. Adjust all users accordingly. llvm-svn: 57329
* Rename APFloat::convertToAPInt to bitcastToAPInt toDale Johannesen2008-10-091-8/+8
| | | | | | | make it clearer what the function does. No functional change. llvm-svn: 57325
* Add runStaticConstructorsDestructors which runs ctors / dtors of a single ↵Evan Cheng2008-09-301-32/+40
| | | | | | module. Patch by David Chisnall. llvm-svn: 56849
* Add DisableGVCompilation which forces the JIT to assert when it tries to ↵Evan Cheng2008-09-241-0/+1
| | | | | | allocate space for a GlobalVariable. llvm-svn: 56557
* Preliminary support for systems which require changing JIT memory regions ↵Evan Cheng2008-09-181-1/+2
| | | | | | privilege from read / write to read / executable. llvm-svn: 56303
* Avoid a warning about isTargetNullPtr being unused in release builds.Dan Gohman2008-08-261-0/+2
| | | | llvm-svn: 55350
* Add new parameter Fast to createJIT to enable the fast codegen path.Evan Cheng2008-08-081-3/+4
| | | | llvm-svn: 54523
* Rewrite JIT handling of GlobalVariables so theyDale Johannesen2008-08-071-0/+2
| | | | | | | | | | | | | | are allocated in the same buffer as the code, jump tables, etc. The default JIT memory manager does not handle buffer overflow well. I didn't introduce this and I'm not attempting to fix it here, but it is more likely to be hit now since we're putting more stuff in the buffer. This affects one test that I know of so far, MultiSource/Benchmarks/NPB-serial/is. llvm-svn: 54442
* Don't forget to initialize SymbolSearchingDisabled.Evan Cheng2008-06-171-0/+1
| | | | llvm-svn: 52414
* Fix a couple issues with the JIT and multiple modules:Nate Begeman2008-05-211-0/+17
| | | | | | | | | | | | 1. The "JITState" object creates a PassManager with the ModuleProvider that the jit is created with. If the ModuleProvider is removed and deleted, the PassManager is invalid. 2. The Global maps in the JIT were not invalidated with a ModuleProvider was removed. This could lead to a case where the Module would be freed, and a new Module with Globals at the same addresses could return invalid results. llvm-svn: 51384
* Fix ExecutionEngine's constant code to work properly when structs and arraysDan Gohman2008-05-201-17/+8
| | | | | | will become first-class types. llvm-svn: 51293
* Add CommonLinkage; currently tentative definitionsDale Johannesen2008-05-141-1/+1
| | | | | | | | | | are represented as "weak", but there are subtle differences in some cases on Darwin, so we need both. The intent is that "common" will behave identically to "weak" unless somebody changes their target to do something else. No functional change as yet. llvm-svn: 51118
* Make ExecutionEngine::updateGlobalMapping return the old mapping.Chris Lattner2008-04-041-5/+18
| | | | llvm-svn: 49206
* Fix formatting.Duncan Sands2008-03-101-2/+2
| | | | llvm-svn: 48151
* Load the symbols first so that the interpreter constructor can find them whenNick Lewycky2008-03-081-9/+5
| | | | | | it tries to initialize them. llvm-svn: 48046
* Simplify code using convertFromZeroExtendedInteger with an APIntDan Gohman2008-02-291-6/+6
| | | | | | by using the new convertFromAPInt directly. llvm-svn: 47739
* Unbreak build with gcc 4.3: provide missed includes and silence most ↵Anton Korobeynikov2008-02-201-1/+2
| | | | | | annoying warnings. llvm-svn: 47367
* Support vector constant zeros, thanks to Zack Rusin for the testcase.Chris Lattner2008-02-151-3/+3
| | | | llvm-svn: 47148
* Enable exception handling int JITNicolas Geoffray2008-02-131-0/+2
| | | | llvm-svn: 47079
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Change the PointerType api for creating pointer types. The old functionality ↵Christopher Lamb2007-12-171-2/+3
| | | | | | of PointerType::get() has become PointerType::getUnqual(), which returns a pointer in the generic address space. The new prototype of PointerType::get() requires both a type and an address space. llvm-svn: 45082
* These are more correctly called signaling NaNs.Duncan Sands2007-12-151-1/+1
| | | | llvm-svn: 45059
* Teach the interpreter to read and write memory in theDuncan Sands2007-12-141-59/+94
| | | | | | | | | | endianness of the target not of the host. Done by the simple expedient of reversing bytes for primitive types if the host and target endianness don't match. This is correct for integer and pointer types. I don't know if it is correct for floating point types. llvm-svn: 45039
* Remove host endianness info from TargetData andDuncan Sands2007-12-121-2/+3
| | | | | | | | put it in a new header System/Host.h instead. Instead of getting the endianness from configure, calculate it directly. llvm-svn: 44959
* Fix PR1836: in the interpreter, read and write apintsDuncan Sands2007-12-101-24/+47
| | | | | | | | | | | | | | | | using the minimum possible number of bytes. For little endian targets run on little endian machines, apints are stored in memory from LSB to MSB as before. For big endian targets on big endian machines they are stored from MSB to LSB which wasn't always the case before (if the target and host endianness doesn't match values are stored according to the host's endianness). Doing this requires knowing the endianness of the host, which is determined when configuring - thanks go to Anton for this. Only having access to little endian machines I was unable to properly test the big endian part, which is also the most complicated... llvm-svn: 44796
* simplify creation of the interpreter, make ExecutionEngine ctor protected,Chris Lattner2007-12-061-6/+0
| | | | | | delete one ExecutionEngine ctor, minor cleanup. llvm-svn: 44646
* My compiler complains that "x always evaluates to true"Duncan Sands2007-11-281-2/+6
| | | | | | | | | | | | | | | | | | | | | | | in this call: Result.IntVal = APInt(80, 2, x); What is x? uint16_t x[8]; I deduce that the APInt constructor being used is this one: APInt(uint32_t numBits, uint64_t val, bool isSigned = false); rather than this one: APInt(uint32_t numBits, uint32_t numWords, const uint64_t bigVal[]); That doesn't seem right! This fix compiles but is otherwise completely untested. llvm-svn: 44400
* Executive summary: getTypeSize -> getTypeStoreSize / getABITypeSize.Duncan Sands2007-11-011-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The meaning of getTypeSize was not clear - clarifying it is important now that we have x86 long double and arbitrary precision integers. The issue with long double is that it requires 80 bits, and this is not a multiple of its alignment. This gives a primitive type for which getTypeSize differed from getABITypeSize. For arbitrary precision integers it is even worse: there is the minimum number of bits needed to hold the type (eg: 36 for an i36), the maximum number of bits that will be overwriten when storing the type (40 bits for i36) and the ABI size (i.e. the storage size rounded up to a multiple of the alignment; 64 bits for i36). This patch removes getTypeSize (not really - it is still there but deprecated to allow for a gradual transition). Instead there is: (1) getTypeSizeInBits - a number of bits that suffices to hold all values of the type. For a primitive type, this is the minimum number of bits. For an i36 this is 36 bits. For x86 long double it is 80. This corresponds to gcc's TYPE_PRECISION. (2) getTypeStoreSizeInBits - the maximum number of bits that is written when storing the type (or read when reading it). For an i36 this is 40 bits, for an x86 long double it is 80 bits. This is the size alias analysis is interested in (getTypeStoreSize returns the number of bytes). There doesn't seem to be anything corresponding to this in gcc. (3) getABITypeSizeInBits - this is getTypeStoreSizeInBits rounded up to a multiple of the alignment. For an i36 this is 64, for an x86 long double this is 96 or 128 depending on the OS. This is the spacing between consecutive elements when you form an array out of this type (getABITypeSize returns the number of bytes). This is TYPE_SIZE in gcc. Since successive elements in a SequentialType (arrays, pointers and vectors) need to be aligned, the spacing between them will be given by getABITypeSize. This means that the size of an array is the length times the getABITypeSize. It also means that GEP computations need to use getABITypeSize when computing offsets. Furthermore, if an alloca allocates several elements at once then these too need to be aligned, so the size of the alloca has to be the number of elements multiplied by getABITypeSize. Logically speaking this doesn't have to be the case when allocating just one element, but it is simpler to also use getABITypeSize in this case. So alloca's and mallocs should use getABITypeSize. Finally, since gcc's only notion of size is that given by getABITypeSize, if you want to output assembler etc the same as gcc then getABITypeSize is the size you want. Since a store will overwrite no more than getTypeStoreSize bytes, and a read will read no more than that many bytes, this is the notion of size appropriate for alias analysis calculations. In this patch I have corrected all type size uses except some of those in ScalarReplAggregates, lib/Codegen, lib/Target (the hard cases). I will get around to auditing these too at some point, but I could do with some help. Finally, I made one change which I think wise but others might consider pointless and suboptimal: in an unpacked struct the amount of space allocated for a field is now given by the ABI size rather than getTypeStoreSize. I did this because every other place that reserves memory for a type (eg: alloca) now uses getABITypeSize, and I didn't want to make an exception for unpacked structs, i.e. I did it to make things more uniform. This only effects structs containing long doubles and arbitrary precision integers. If someone wants to pack these types more tightly they can always use a packed struct. llvm-svn: 43620
* add a mechanism for the JIT to invoke a function to lazily create functions ↵Chris Lattner2007-10-221-2/+2
| | | | | | as they are referenced. llvm-svn: 43210
* LoadLibraryPermanently doesn't throw.Chris Lattner2007-10-211-3/+3
| | | | llvm-svn: 43207
* Add a convenience method for creating EE's.Chris Lattner2007-10-211-0/+4
| | | | llvm-svn: 43206
* Add removeModuleProvider()Devang Patel2007-10-151-0/+15
| | | | llvm-svn: 43002
* convertFromInteger, as originally written, expected sign-extendedNeil Booth2007-10-071-2/+2
| | | | | | | | input. APInt unfortunately zero-extends signed integers, so Dale modified the function to expect zero-extended input. Make this assumption explicit in the function name. llvm-svn: 42732
* Constant fold int-to-long-double conversions;Dale Johannesen2007-09-301-2/+2
| | | | | | | | use APFloat for int-to-float/double; use round-to-nearest for these (implementation-defined, seems to match gcc). llvm-svn: 42484
* Change APFloat::convertFromInteger to take the incomingDale Johannesen2007-09-211-3/+5
| | | | | | | | | | bit width instead of number of words allocated, which makes it actually work for int->APF conversions. Adjust callers. Add const to one of the APInt constructors to prevent surprising match when called with const argument. llvm-svn: 42210
* Implement x86 long double in jit (not reallyDale Johannesen2007-09-171-3/+83
| | | | | | complete, but common cases work) llvm-svn: 42043
OpenPOWER on IntegriCloud