aboutsummaryrefslogtreecommitdiffstats
path: root/lib
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
* Accept 'weak' as a linkage type. For now, just turn it into linkonce linkageChris Lattner2003-10-102-1/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8998 91177308-0d34-0410-b5e6-96231b3b80d8
* Add better checkingChris Lattner2003-10-101-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8996 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
* Reserve space for PHI nodes when we read them in. This provides a VERYChris Lattner2003-10-091-0/+1
| | | | | | | tasty 15% speedup on the testcase from Bill. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8993 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the version of getValue that takes the type plane instead of the typeChris Lattner2003-10-092-17/+18
| | | | | | | 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-093-13/+17
| | | | | | | 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-092-10/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8988 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not read past the end of the contained type listChris Lattner2003-10-091-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8986 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-094-315/+171
| | | | | | | | | | | | | | | | 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-093-144/+106
| | | | | | | | 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-092-15/+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-092-25/+27
| | | | | | | | | | | | | | 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-092-12/+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-083-60/+84
| | | | | | | | | | | | | | 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-082-34/+26
| | | | 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-083-61/+57
| | | | | | | 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
* Destroy allocated resources on exception.Misha Brukman2003-10-081-3/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8969 91177308-0d34-0410-b5e6-96231b3b80d8
* Make more error messages have gccld's name in them.Brian Gaeke2003-10-081-4/+6
| | | | | | | Add a newline after "Cannot find <library>". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8968 91177308-0d34-0410-b5e6-96231b3b80d8
* Update commentChris Lattner2003-10-081-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8965 91177308-0d34-0410-b5e6-96231b3b80d8
* Use a set to keep track of which edges have been noticed as executable alreadyChris Lattner2003-10-081-15/+27
| | | | | | | | to avoid reprocessing PHI nodes needlessly. This speeds up the big bad PHI testcase 43%: from 104.9826 to 73.5157s git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8964 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor fixes here and thereChris Lattner2003-10-081-22/+21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8963 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid building data structures we don't really need. This improves the runtimeChris Lattner2003-10-081-10/+39
| | | | | | | | | of a test that Bill Wendling sent me from 228.5s to 105s. Obviously there is more improvement to be had, but this is a nice speedup which should be "felt" by many programs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8962 91177308-0d34-0410-b5e6-96231b3b80d8
* Change MRegisterDesc::AliasSet, TargetInstrDescriptor::ImplicitDefsAlkis Evlogimenos2003-10-084-44/+54
| | | | | | | | | | | | | | | | | | | | | | and TargetInstrDescriptor::ImplicitUses to always point to a null terminated array and never be null. So there is no need to check for pointer validity when iterating over those sets. Code that looked like: if (const unsigned* AS = TID.ImplicitDefs) { for (int i = 0; AS[i]; ++i) { // use AS[i] } } was changed to: for (const unsigned* AS = TID.ImplicitDefs; *AS; ++AS) { // use *AS } git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8960 91177308-0d34-0410-b5e6-96231b3b80d8
* whoops, don't accidentally lose variable namesChris Lattner2003-10-071-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8955 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug: InstCombine/cast.ll:test11 / PR#7Chris Lattner2003-10-071-1/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8954 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor code a bitChris Lattner2003-10-071-4/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8952 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a sanity check for constant expression castsChris Lattner2003-10-071-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8951 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bugzilla bug #5Chris Lattner2003-10-071-1/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8930 91177308-0d34-0410-b5e6-96231b3b80d8
* Bill contributed this major rewrite of the -lowerswitch pass to make it generateChris Lattner2003-10-071-44/+144
| | | | | | | logarithmic conditional branch sequences instead of linear sequences. Thanks Bill! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8928 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug in previous checkinChris Lattner2003-10-071-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8922 91177308-0d34-0410-b5e6-96231b3b80d8
* Actually _PASS IN_ NO_RESERVE if we have it.Chris Lattner2003-10-061-1/+1
| | | | | | | Thanks to Brian for fixing this obvious oops git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8899 91177308-0d34-0410-b5e6-96231b3b80d8
* ToolRunner.h has been moved from include/Support to include/llvm/Support.Misha Brukman2003-10-061-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8898 91177308-0d34-0410-b5e6-96231b3b80d8
* Users can never be nullChris Lattner2003-10-061-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8895 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor speedups for the instcombine passChris Lattner2003-10-061-17/+26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8894 91177308-0d34-0410-b5e6-96231b3b80d8
* Speed up the predicate used to decide when to inline by caching the sizeChris Lattner2003-10-061-13/+28
| | | | | | | | | | | | | | | | | of callees between executions. On eon, in release mode, this changes the inliner from taking 11.5712s to taking 2.2066s. In debug mode, it went from taking 14.4148s to taking 7.0745s. In release mode, this is a 24.7% speedup of gccas, in debug mode, it's a total speedup of 11.7%. This also makes it slightly more aggressive. This could be because we are not judging the size of the functions quite as accurately as before. When we start looking at the performance of the generated code, this can be investigated further. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8893 91177308-0d34-0410-b5e6-96231b3b80d8
* Add # of printed instructions statistic to both the SPARC and X86 LLC backends.Brian Gaeke2003-10-063-1/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8892 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid doing pointless work. Amazingly, this makes us go faster.Chris Lattner2003-10-062-8/+5
| | | | | | | | | | | Running the inliner on 252.eon used to take 48.4763s, now it takes 14.4148s. In release mode, it went from taking 25.8741s to taking 11.5712s. This also fixes a FIXME. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8890 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement the NamedRegionTimer classChris Lattner2003-10-061-0/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8889 91177308-0d34-0410-b5e6-96231b3b80d8
* All of our supported operating systems (so far) and FreeBSD technicallyBrian Gaeke2003-10-061-0/+1
| | | | | | | want you to include <sys/stat.h> for fstat(), struct stat, and friends. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8887 91177308-0d34-0410-b5e6-96231b3b80d8
* This changes the PromoteMemToReg function to create "pruned" SSA form, notChris Lattner2003-10-051-24/+109
| | | | | | | | | | | | | | | | | | | | | "minimal" SSA form (in other words, it doesn't insert dead PHIs). This speeds up the mem2reg pass very significantly because it doesn't have to do a lot of frivolous work in many common cases. In the 252.eon function I have been playing with, this doesn't even insert the 120 PHI nodes that it used to which were trivially dead (in the process of promoting 356 alloca instructions overall). This speeds up the mem2reg pass from 1.2459s to 0.1284s. More significantly, the DCE pass used to take 2.4138s to remove the 120 dead PHI nodes that mem2reg constructed, now it takes 0.0134s (which is the time to scan the function and decide that there is nothing dead). So overall, on this one function, we speed things up a total of 3.5179s, which is a 24.8x speedup! :) This change is tested by the Mem2Reg/2003-10-05-DeadPHIInsertion.ll test, which now passes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8884 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the interface to PromoteMemToReg to also take a DominatorTreeChris Lattner2003-10-054-5/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8883 91177308-0d34-0410-b5e6-96231b3b80d8
* Speed up the mem2reg transform for allocas which are only read/written in a ↵Chris Lattner2003-10-051-5/+84
| | | | | | | | | | | | | | | | | | | | | | | | single basic block. This is amazingly common in code generated by the C/C++ front-ends. This change makes it not have to insert ANY phi nodes, whereas before it would insert a ton of dead ones which DCE would have to clean up. Thus, this fix improves compile-time performance of these trivial allocas in two ways: 1. It doesn't have to do the walking and book-keeping for renaming 2. It does not insert dead phi nodes for them which would have to subsequently be cleaned up. On my favorite testcase from 252.eon, this special case handles 305 out of 356 promoted allocas in the function. It speeds up the mem2reg pass from 7.5256s to 1.2505s. It inserts 677 fewer dead PHI nodes, which speeds up a subsequent -dce pass from 18.7524s to 2.4806s. There are still 120 trivially dead PHI nodes being inserted for variables used in multiple basic blocks, but they are not handled by this patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8881 91177308-0d34-0410-b5e6-96231b3b80d8
* Move support/lib/Support back to lib/SupportChris Lattner2003-10-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8874 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for the Invoke instruction by using the LowerInvoke passChris Lattner2003-10-051-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8872 91177308-0d34-0410-b5e6-96231b3b80d8
* Instead of hacking in custom support for Invoke/Unwind, use the LowerInvoke passChris Lattner2003-10-053-62/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8871 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial checkin of the LLVM->LLVM transform to support code generators whichChris Lattner2003-10-051-0/+74
| | | | | | | do not support stack unwinding yet git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8869 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify-cfg is really a function passChris Lattner2003-10-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8868 91177308-0d34-0410-b5e6-96231b3b80d8
* Be more careful handling PHI nodes, which might be of potentially high degree.Chris Lattner2003-10-051-93/+80
| | | | | | | | This reduces the time to verify a function from eon with a large number of large PHI nodes from 22996s (6.38 hours) to 10.5499s git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8866 91177308-0d34-0410-b5e6-96231b3b80d8