summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Next round of APFloat changes.Dale Johannesen2007-09-061-2/+2
| | | | | | | | | | | | | | Use APFloat in UpgradeParser and AsmParser. Change all references to ConstantFP to use the APFloat interface rather than double. Remove the ConstantFP double interfaces. Use APFloat functions for constant folding arithmetic and comparisons. (There are still way too many places APFloat is just a wrapper around host float/double, but we're getting there.) llvm-svn: 41747
* Fix a comment typo noticed by Sandro Magi.Reid Spencer2007-08-111-1/+1
| | | | llvm-svn: 41018
* Add comments to fallsthrough cases. Also, this fixes PR1492Anton Korobeynikov2007-06-031-0/+3
| | | | llvm-svn: 37405
* Check arguments & return types of main(). Abort in case of no match.Anton Korobeynikov2007-06-031-0/+32
| | | | llvm-svn: 37404
* Compute the correct word number.Zhou Sheng2007-05-241-1/+1
| | | | llvm-svn: 37322
* Unbreak C++ build.Jeff Cohen2007-03-121-0/+1
| | | | llvm-svn: 35067
* Fix all of last night's JIT failures in Prolangs-C++ by finishing theReid Spencer2007-03-061-42/+151
| | | | | | implementation of getConstantValue(). llvm-svn: 34988
* 1. Make StoreValueToMemory a little more efficient by not requiring callerReid Spencer2007-03-061-2/+2
| | | | | | | | to make a copy of the GenericValue. 2. Fix a copy & paste bug in StoreValueToMemory where 64-bit values were truncated to 32 llvm-svn: 34958
* Simplify things significantly because GenericValue now has a single integerReid Spencer2007-03-061-281/+72
| | | | | | | | | field, of type APInt, instead of multiple integer fields. Also, get rid of the special endianness code in StoreValueToMemory and LoadValueToMemory. ExecutionEngine is always used to execute on the host platform so this is now unnecessary. llvm-svn: 34946
* Deal with error handling better.Reid Spencer2007-03-031-3/+5
| | | | llvm-svn: 34887
* Avoid memory leakage by having caller construct the APInt for theReid Spencer2007-03-031-5/+4
| | | | | | destination value of LoadValueFromMemory. llvm-svn: 34883
* Implement loading and storing of APInt values from memory.Reid Spencer2007-03-031-8/+16
| | | | llvm-svn: 34874
* For PR1195:Reid Spencer2007-02-151-1/+1
| | | | | | | Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and PackedTyID -> VectorTyID. No functional changes. llvm-svn: 34293
* From Dan Gohman:Chris Lattner2007-02-141-2/+2
| | | | | | | | | | While preparing http://llvm.org/PR1198 I noticed several asserts protecting unprepared code from i128 types that weren't actually failing when they should because they were written as assert("foo") instead of something like assert(0 && "foo"). This patch fixes all the cases that a quick grep found. llvm-svn: 34267
* eliminate use of TargetData::getIndexedOffset that takes a vectorChris Lattner2007-02-101-2/+3
| | | | llvm-svn: 34163
* Privatize StructLayout::MemberOffsets, adding an accessorChris Lattner2007-02-101-1/+1
| | | | llvm-svn: 34156
* For PR411:Reid Spencer2007-02-051-1/+1
| | | | | | | | Adjust to changes in Module interface: getMainFunction() -> getFunction("main") getNamedFunction(X) -> getFunction(X) llvm-svn: 33922
* For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoidReid Spencer2007-01-301-4/+4
| | | | | | confusion with external linkage types. llvm-svn: 33663
* For PR1043:Reid Spencer2007-01-191-6/+2
| | | | | | | | | | | | | | This is the final patch for this PR. It implements some minor cleanup in the use of IntegerType, to wit: 1. Type::getIntegerTypeMask -> IntegerType::getBitMask 2. Type::Int*Ty changed to IntegerType* from Type* 3. ConstantInt::getType() returns IntegerType* now, not Type* This also fixes PR1120. Patch by Sheng Zhou. llvm-svn: 33370
* Fix a regression in the last patch. When constructing a BitMask, be carefulReid Spencer2007-01-181-0/+4
| | | | | | | not to overflow 64-bits and end up with a 0 mask. This caused i64 values to always be stored as 0 with lots of consequential damage to nightly test. llvm-svn: 33335
* Make sure we truncate stored values to their bit width.Reid Spencer2007-01-181-30/+40
| | | | llvm-svn: 33317
OpenPOWER on IntegriCloud