aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Bytecode/Reader/Reader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Ok, the "fix" for this is to do a real associative container. Symbol tablesChris Lattner2003-10-101-15/+11
| | | | | | | | are ordered by name, not by slot, so the previous solution wasn't any good. On a large testcase, this reduces time to parse from 2.17s to 1.58s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9002 91177308-0d34-0410-b5e6-96231b3b80d8
* Another 10% performance improvement by not using replaceAllUsesWithChris Lattner2003-10-091-13/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8994 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the version of getValue that takes the type plane instead of the typeChris Lattner2003-10-091-1/+2
| | | | | | | if possible. This provides a consistent 8.5% speedup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8991 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass a vector around to reduce dynamic allocationChris Lattner2003-10-091-1/+2
| | | | | | | Throw the RawInst class in an anon namespace git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8990 91177308-0d34-0410-b5e6-96231b3b80d8
* Change getConstantValue to throw an exception on error, not return nullChris Lattner2003-10-091-1/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8988 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove potentially N^2 algorithm from symbol table reader. No speedupChris Lattner2003-10-091-5/+13
| | | | | | | in practice though git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8985 91177308-0d34-0410-b5e6-96231b3b80d8
* Major refactoring of the bytecode reader. This includes the followingChris Lattner2003-10-091-31/+18
| | | | | | | | | | | | | | | | changes: * BytecodeReader::getType(...) used to return a null pointer on error. This was only checked about half the time. Now we convert it to throw an exception, and delete the half that checked for error. This was checked in before, but psmith crashed and lost the change :( * insertValue no longer returns -1 on error, so callers don't need to check for it. * Substantial rewrite of InstructionReader.cpp, to use more efficient, simpler, data structures. This provides another 5% speedup. This also makes the code much easier to read and understand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8984 91177308-0d34-0410-b5e6-96231b3b80d8
* Significantly clean up parsing of instructions. This exceptionizes andChris Lattner2003-10-091-4/+1
| | | | | | | | simplifies the control flow a bit. This provides a small (~3%) speedup, but it's primarily a cleanup exercise. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8983 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate the instruction placeholder. Simplify a bunch of code.Chris Lattner2003-10-091-1/+1
| | | | | | | This results in no significant speedup, but does provide simpler code git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8980 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate the old LateResolveValues data structure, replacing it with aChris Lattner2003-10-091-23/+25
| | | | | | | | | | | | | | new, simpler, ForwardReferences data structure. This is just the first simple replacement, subsequent changes will improve the code more. This simple change improves the performance of loading a file from HDF5 (contributed by Bill) from 2.36s to 1.93s, a 22% improvement. This presumably has to do with the fact that we only create ONE placeholder for a particular forward referenced values, and also may be because the data structure is much simpler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8979 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a dead methodChris Lattner2003-10-091-11/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8978 91177308-0d34-0410-b5e6-96231b3b80d8
* This patch substantially simplifies and cleans up handling of basic blocksChris Lattner2003-10-081-22/+57
| | | | | | | | | | | | | | in the bytecode parser. Before we tried to shoehorn basic blocks into the "getValue" code path with other types of values. For a variety of reasons this was a bad idea, so this patch separates it out into its own data structure. This simplifies the code, makes it fit in 80 columns, and is also much faster. In a testcase provided by Bill, which has lots of PHI nodes, this patch speeds up bytecode parsing from taking 6.9s to taking 2.32s. More speedups to follow later. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8977 91177308-0d34-0410-b5e6-96231b3b80d8
* Inline the postResolveValues method. It was poorly named anywayChris Lattner2003-10-081-29/+24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8976 91177308-0d34-0410-b5e6-96231b3b80d8
* Various cleanups and simplifications. This speeds up reading a bytecode fileChris Lattner2003-10-081-43/+38
| | | | | | | Bill gave me from 8.69s to 6.90s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8971 91177308-0d34-0410-b5e6-96231b3b80d8
* Transform two methods to return pointers directly instead of returning themChris Lattner2003-10-041-26/+18
| | | | | | | as 'by reference' arguments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8849 91177308-0d34-0410-b5e6-96231b3b80d8
* Use V for values, not D.Chris Lattner2003-10-041-16/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8848 91177308-0d34-0410-b5e6-96231b3b80d8
* Just rethrow previous exception instead of making a new oneChris Lattner2003-09-261-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8718 91177308-0d34-0410-b5e6-96231b3b80d8
* Suggestions made by Chris:Misha Brukman2003-09-231-10/+14
| | | | | | | | | | * Instead of a #define, use inline function * Fix the name on the #define, errr... now inline function to be more logical: it doesn't CHECK the alignment, it PERFORMS the alignment * To get string name of a Type*, use getDescription(), not getName() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8683 91177308-0d34-0410-b5e6-96231b3b80d8
* * Cleaned up code:Misha Brukman2003-09-221-262/+161
| | | | | | | | | | - no more passing around a string pointer to set errors - no more returning booleans and checking for errors, we use C++ exceptions * Broke functionality into 2 new classes, one reads from file, one from a stream * Implemented lazy function streaming - the parser can read in a function at-a-time git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8671 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed spelling and grammar.Misha Brukman2003-09-111-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8489 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a gross hack that was there to support bytecode files that are over a ↵Chris Lattner2003-09-081-1/+1
| | | | | | | | | year old. If you still have these suckers laying around, you have GOT to rebuild them. geeze. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8395 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow modules to have 'any' pointer size and endianness. Luckily, we hadChris Lattner2003-08-241-11/+20
| | | | | | | some space for extra flags, so we don't need to bump the revision number. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8118 91177308-0d34-0410-b5e6-96231b3b80d8
* Spell `necessary' correctly.Misha Brukman2003-08-181-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7944 91177308-0d34-0410-b5e6-96231b3b80d8
* Merged in autoconf branch. This provides configuration via the autoconfJohn Criswell2003-06-301-5/+5
| | | | | | | system. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7014 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not assert fail or crash when a bytecode parse fails!Chris Lattner2003-05-221-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6284 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate the uchar typedef, use unsigned char explicitlyChris Lattner2003-05-221-11/+19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6283 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for reading and writing pointersize/endianness to and from bytecodeChris Lattner2003-04-221-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5839 91177308-0d34-0410-b5e6-96231b3b80d8
* Preserve module source information in the ModuleIDChris Lattner2003-04-221-6/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5836 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for reading unaligned bytecode buffersChris Lattner2003-04-191-0/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5819 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a big bad bug I checked in yesterday :(Chris Lattner2003-04-181-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5807 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support to the bytecode reader/writer for the new linkage typesChris Lattner2003-04-161-14/+41
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5790 91177308-0d34-0410-b5e6-96231b3b80d8
* Add new linkage types to support a real frontendChris Lattner2003-04-161-3/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5786 91177308-0d34-0410-b5e6-96231b3b80d8
* * Bug fixes:Chris Lattner2003-03-191-139/+133
| | | | | | | | | | | | | | | | | | | | | | - Fix problems where the constant table would not get updated when resolving constants causes other constants to change. Changes to the V2 bytecode format - Null values are implicitly encoded instead of explicitly, this makes things more compact! - More compactly represent ConstantPointerRefs - Bytecode files are represented as: Header|GlobalTypes|GlobalVars/Function Protos|Constants|Functions|SymTab instead of Header|GlobalTypes|Constants|GlobalVars/Function Protos|Functions|SymTab which makes a lot of things simpler. Changes to the reader: - Function loading code is much simpler. We now no longer make function PlaceHolderHelper objects to be replaced with real functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5748 91177308-0d34-0410-b5e6-96231b3b80d8
* Infrastructure for more compact bytecode files and REAL support for versioningChris Lattner2003-03-061-6/+40
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5716 91177308-0d34-0410-b5e6-96231b3b80d8
* s/Method/Function in variable and method namesChris Lattner2003-03-061-11/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5715 91177308-0d34-0410-b5e6-96231b3b80d8
* Continue simplifying error handling, s/method/functionChris Lattner2003-03-061-57/+45
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5714 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup error handling constructsChris Lattner2003-03-061-37/+47
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5713 91177308-0d34-0410-b5e6-96231b3b80d8
* Pull common code outChris Lattner2003-03-061-16/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5712 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the std namespace explicitlyChris Lattner2003-03-061-12/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5708 91177308-0d34-0410-b5e6-96231b3b80d8
* - Eliminated the deferred symbol table stuff in Module & Function, it reallyChris Lattner2002-11-201-2/+2
| | | | | | | wasn't an optimization and it was causing lots of bugs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4779 91177308-0d34-0410-b5e6-96231b3b80d8
* - Fix a really nasty bug in the bytecode reader that caused it to failChris Lattner2002-10-231-10/+11
| | | | | | | | | reading bytecode files with > 255 types in them, but only when optimization is enabled. This was caused by GCC shrinking an enum to a single byte instead of a whole word. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4266 91177308-0d34-0410-b5e6-96231b3b80d8
* Wow, for some reason, when reading bytecode from stdin, we were only readingChris Lattner2002-10-221-1/+1
| | | | | | | 4 bytes at a time. Change this to read blocks of 4k git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4265 91177308-0d34-0410-b5e6-96231b3b80d8
* There is no way to guarantee that constants are not forward referenced.Chris Lattner2002-10-141-0/+28
| | | | | | | | | Handle forward referenced constants in a general way. This fixes bug: Assembler/2002-10-13-ConstantEncodingProblem.llx and allows the SPEC 197.parser benchmark to be built git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4161 91177308-0d34-0410-b5e6-96231b3b80d8
* - Change Function's so that their argument list is populated when they areChris Lattner2002-10-131-8/+3
| | | | | | | | constructed. Before, external functions would have an empty argument list, now a Function ALWAYS has a populated argument list. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4149 91177308-0d34-0410-b5e6-96231b3b80d8
* Changed uchar to unsigned char in function ParseBytecodeBuffer, because ↵Anand Shukla2002-09-201-1/+1
| | | | | | seemingly it affects opt in uncertain ways :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3866 91177308-0d34-0410-b5e6-96231b3b80d8
* Emit an obnoxious warning message for bytecode that includes load/storeChris Lattner2002-08-211-1/+2
| | | | | | | | instructions that use indexing. Convert them transparently into a pair of instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3431 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn off a debugging optimization that just slows bytecode reading downChris Lattner2002-08-181-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3377 91177308-0d34-0410-b5e6-96231b3b80d8
* - Finally nailed: test/Regression/Assembler/2002-08-16-ConstExprInlined.llxChris Lattner2002-08-171-194/+111
| | | | | | | | | | | | | | | - ParseConstantPool was resolving reference to value using the function slot # instead of the global slot #. - Bytecode reader changes: - Remove the failure<> template from Bytecode Reader - Remove extraneous #includes - s/method/function/ a bit - Eliminate the fwdRefs class that just added abstraction where it was not needed, making things more complex. - Use a vector instead of a list for function signatures. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3366 91177308-0d34-0410-b5e6-96231b3b80d8
* added std:: to pairAnand Shukla2002-07-161-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2917 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for reading ConstantExpr nodes.Vikram S. Adve2002-07-141-32/+111
| | | | | | | | Add class ConstantFwdRefs to resolve forward references to constants and to globals (unified old code for globals into this). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2895 91177308-0d34-0410-b5e6-96231b3b80d8