summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/Interpreter
Commit message (Collapse)AuthorAgeFilesLines
...
* Split the Add, Sub, and Mul instruction opcodes into separateDan Gohman2009-06-041-30/+26
| | | | | | | | | | | | | | | integer and floating-point opcodes, introducing FAdd, FSub, and FMul. For now, the AsmParser, BitcodeReader, and IRBuilder all preserve backwards compatability, and the Core LLVM APIs preserve backwards compatibility for IR producers. Most front-ends won't need to change immediately. This implements the first step of the plan outlined here: http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt llvm-svn: 72897
* Rename PaddedSize to AllocSize, in the hope that thisDuncan Sands2009-05-091-2/+2
| | | | | | | will make it more obvious what it represents, and stop it being confused with the StoreSize. llvm-svn: 71349
* Instead of passing in an unsigned value for the optimization level, use an enum,Bill Wendling2009-04-292-2/+2
| | | | | | | which better identifies what the optimization is doing. And is more flexible for future uses. llvm-svn: 70440
* The second part of the change from -fast to -O#. This changes the JIT to acceptBill Wendling2009-04-292-2/+2
| | | | | | | an optimization level instead of a simple boolean telling it to generate code "fast" or the other type of "fast". llvm-svn: 70347
* Link against libffi if available, fall back to "no external calls fromNick Lewycky2009-04-131-8/+8
| | | | | | interpreter mode" when it's not. llvm-svn: 68937
* Use CHAR_BIT instead of hard-coding 8 in several places where itDan Gohman2009-04-011-2/+2
| | | | | | | is appropriate. This helps visually differentiate host-oriented calculations from target-oriented calculations. llvm-svn: 68227
* Reapply patch from r62553, with a fix to avoid looking for an ffi.h that isn'tNick Lewycky2009-02-041-496/+212
| | | | | | | | | | | | there. This changes the interpreter to use libffi. After this patch, the interpreter will barely be able to call any external functions if built on a system without libffi installed (just enough to pass 'make check' really). But with libffi, we can now call any function that isn't variadic or taking a struct or vector parameter (but pointer to struct is fine). Patch by Alexei Svitkine! llvm-svn: 63723
* Revert r62553 and r62616 due to issues with portability.Tanya Lattner2009-01-221-206/+496
| | | | llvm-svn: 62777
* Fix typo. Patch by Alexei Svitkine.Duncan Sands2009-01-201-1/+1
| | | | llvm-svn: 62616
* Make the Interpreter use libffi if it's available. Patch from Alexei Svitkine!Nick Lewycky2009-01-201-496/+206
| | | | | | | | | | | This requires a rebuild of 'configure' itself. I will be committing that next, but built with the wrong version of autoconf. Somebody who has the right one, please update it. As a side-note, because of the way autoconf works, all built tools will link against libffi, not just lli. If you know how to fix this, please let me know ... llvm-svn: 62553
* don't assert and die on out of range (undefined) shifts. This fixesChris Lattner2009-01-161-4/+16
| | | | | | PR3334. llvm-svn: 62352
* Rename getABITypeSize to getTypePaddedSize, asDuncan Sands2009-01-121-2/+2
| | | | | | suggested by Chris. llvm-svn: 62099
* Removed trailing whitespace from Makefiles.Misha Brukman2009-01-091-2/+2
| | | | llvm-svn: 61991
* Tidy up #includes, deleting a bunch of unnecessary #includes.Dan Gohman2009-01-051-1/+0
| | | | llvm-svn: 61715
* Add <cstdio> include where needed by gcc-4.4.Duncan Sands2008-10-081-0/+1
| | | | | | Patch by Samuel Tardieu. llvm-svn: 57291
* Large mechanical patch.Devang Patel2008-09-251-2/+2
| | | | | | | | | | | | | | | s/ParamAttr/Attribute/g s/PAList/AttrList/g s/FnAttributeWithIndex/AttributeWithIndex/g s/FnAttr/Attribute/g This sets the stage - to implement function notes as function attributes and - to distinguish between function attributes and return value attributes. This requires corresponding changes in llvm-gcc and clang. llvm-svn: 56622
* s/ParameterAttributes/Attributes/gDevang Patel2008-09-231-1/+0
| | | | llvm-svn: 56513
* Initial support for the CMake build system.Oscar Fuentes2008-09-221-0/+5
| | | | llvm-svn: 56419
* Add new parameter Fast to createJIT to enable the fast codegen path.Evan Cheng2008-08-082-2/+4
| | | | llvm-svn: 54523
* Use strcpy instead of sprintf here. This avoids a GCC 4.3 format-stringDan Gohman2008-08-051-1/+1
| | | | | | | warning. There wasn't actually a problem here, because the contents of the string are known. llvm-svn: 54385
* Add a new hidden option to the interpreter to cause it to printChris Lattner2008-07-081-0/+8
| | | | | | | out every volatile load and store. This is useful for tracking down insane volatile memory bugs. llvm-svn: 53241
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-0/+4
| | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
* fix warnings with assertions disabled.Chris Lattner2008-04-061-21/+6
| | | | llvm-svn: 49285
* Update gcc 4.3 warnings fix patch with recent head changesAnton Korobeynikov2008-02-201-11/+12
| | | | llvm-svn: 47368
* Unbreak build with gcc 4.3: provide missed includes and silence most ↵Anton Korobeynikov2008-02-203-1/+4
| | | | | | annoying warnings. llvm-svn: 47367
* Added memmove to interpreter external functions list. Patch by Daniel Dunbar.Evan Cheng2008-02-201-0/+9
| | | | llvm-svn: 47363
* Use empty() instead of comparing size() with zero.Dan Gohman2008-01-291-3/+3
| | | | llvm-svn: 46514
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-294-8/+8
| | | | llvm-svn: 45418
* remove attribution from lib Makefiles.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45415
* Add explicit keywords, and fix a minor typo that they uncovered.Dan Gohman2007-12-141-1/+1
| | | | llvm-svn: 45034
* Add a guard to cxxabi header as other platform mayZhou Sheng2007-12-121-0/+12
| | | | | | not support it. llvm-svn: 44914
* Fixed PR1629.Zhou Sheng2007-12-121-0/+40
| | | | | | | Make lli interpreter correctly call external functions sin()/cos(), __cxa_guard_acquire() and __cxa_guard_release(). llvm-svn: 44910
* It looks like this has been broken for some time -Duncan Sands2007-12-101-2/+2
| | | | | | get it to compile. llvm-svn: 44791
* simplify creation of the interpreter, make ExecutionEngine ctor protected,Chris Lattner2007-12-062-13/+5
| | | | | | delete one ExecutionEngine ctor, minor cleanup. llvm-svn: 44646
* Add some convenience methods for querying attributes, andDuncan Sands2007-11-281-12/+9
| | | | | | use them. llvm-svn: 44403
* Executive summary: getTypeSize -> getTypeStoreSize / getABITypeSize.Duncan Sands2007-11-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix an assertion abort on sparc. malloc(0) is allowed toGabor Greif2007-10-111-1/+3
| | | | | | return NULL. llvm-svn: 42871
* #ifdef out unsafe tracing code, which fixes PR1689Chris Lattner2007-09-211-15/+17
| | | | llvm-svn: 42205
* rename APInt::toString -> toStringUnsigned for symmetry with toStringSigned()Chris Lattner2007-08-231-2/+3
| | | | | | Add an APSInt::toString() method. llvm-svn: 41309
* Add a comment: don't expect from external function resolver in interpreterAnton Korobeynikov2007-07-301-0/+5
| | | | | | things, it wasn't designed to handle. llvm-svn: 40608
* More explicit keywords.Dan Gohman2007-07-301-1/+1
| | | | llvm-svn: 40589
* VStudio compiler errors and placing Function*->ExFunc map under ↵Chuck Rose III2007-07-271-4/+5
| | | | | | | | | | | | | ManagedStatic control. This commit fixes two things. One is a pair of VStudio compiler errors stemming from variables which defined within the for loop statement and also within the body of the for loop. I fixed these by renaming one of the two variables. Additionally, I've made the Function*->ExFunc map in ExternalFunctions.cpp a ManagedStatic object, so that cleanup will be done on llvm_shutdown. In repeated uses of the interpreter, where the same Function* address may get used for completely differnet functions, this was causing a crash. llvm-svn: 40558
* For PR1486:Reid Spencer2007-06-012-2/+2
| | | | | | | Avoid overwriting the APInt instance with 0 bytes which causes the bitwidth to be set to 0 (illegal) producing a subsequent assert. llvm-svn: 37391
* On Linux platforms and at optimization levels -O1 and above, llvm-gcc canReid Spencer2007-05-191-3/+14
| | | | | | | turn "putchar" calls into _IO_putc calls which is a lower-level interface. This patch allows these calls to be executed by lli in interpreter mode. llvm-svn: 37254
* Print integer values as both decimal and hexadecimal for convenienceReid Spencer2007-05-171-1/+1
| | | | | | of verifying result values when debugging. llvm-svn: 37156
* Avoid a "loss of precision" error in gcc 4.1.3.Reid Spencer2007-05-161-1/+1
| | | | llvm-svn: 37105
* Implement printing of instruction result values when debug info is turnedReid Spencer2007-05-161-0/+21
| | | | | | | on. This helps to speed up the debugging time by showing computational results as the program executes. llvm-svn: 37095
* Bitcast all the bits of a floating point value, not just one. The zeroReid Spencer2007-05-041-0/+2
| | | | | | | | extension is needed because the constructor for the Destination value causes the APInt to have a bit width of 1. Patch by Guoling Han. llvm-svn: 36733
* 1. Don't swap byte order in scanf. It isn't necessary and leads toReid Spencer2007-04-261-1/+1
| | | | | | | | incorrect results (canonicalization was dropped several commits ago). 2. Add support for fscanf. 3. Suppress a warning about cast to pointer from non-pointer-sized integer. llvm-svn: 36482
* We only need one putchar which gives it a shot at getting matched by itsReid Spencer2007-04-211-17/+4
| | | | | | users. llvm-svn: 36305
OpenPOWER on IntegriCloud