1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 05:23:45 +02:00
Commit Graph

4397 Commits

Author SHA1 Message Date
Chris Lattner
bd123c6e51 Add a sanity check for constant expression casts
llvm-svn: 8951
2003-10-07 22:19:19 +00:00
Chris Lattner
bbfaf77c5d Fix bugzilla bug #5
llvm-svn: 8930
2003-10-07 19:33:31 +00:00
Chris Lattner
a18861ff29 Bill contributed this major rewrite of the -lowerswitch pass to make it generate
logarithmic conditional branch sequences instead of linear sequences.  Thanks Bill!

llvm-svn: 8928
2003-10-07 18:46:23 +00:00
Chris Lattner
edb06ce061 Fix bug in previous checkin
llvm-svn: 8922
2003-10-07 15:17:02 +00:00
Chris Lattner
151444f98f Actually _PASS IN_ NO_RESERVE if we have it.
Thanks to Brian for fixing this obvious oops

llvm-svn: 8899
2003-10-06 19:07:41 +00:00
Misha Brukman
a1a55a6071 ToolRunner.h has been moved from include/Support to include/llvm/Support.
llvm-svn: 8898
2003-10-06 18:37:24 +00:00
Chris Lattner
6f939cc824 Users can never be null
llvm-svn: 8895
2003-10-06 17:33:39 +00:00
Chris Lattner
e6955c77e0 Minor speedups for the instcombine pass
llvm-svn: 8894
2003-10-06 17:11:01 +00:00
Chris Lattner
512ab7b5fd Speed up the predicate used to decide when to inline by caching the size
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.

llvm-svn: 8893
2003-10-06 15:52:43 +00:00
Brian Gaeke
f9a4341b54 Add # of printed instructions statistic to both the SPARC and X86 LLC backends.
llvm-svn: 8892
2003-10-06 15:41:21 +00:00
Chris Lattner
5b814e067a Avoid doing pointless work. Amazingly, this makes us go faster.
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.

llvm-svn: 8890
2003-10-06 15:23:43 +00:00
Chris Lattner
da4d014b4c Implement the NamedRegionTimer class
llvm-svn: 8889
2003-10-06 15:02:31 +00:00
Brian Gaeke
7bd96d6b90 All of our supported operating systems (so far) and FreeBSD technically
want you to include <sys/stat.h> for fstat(), struct stat, and friends.

llvm-svn: 8887
2003-10-06 03:30:28 +00:00
Chris Lattner
87f1ce9b96 This changes the PromoteMemToReg function to create "pruned" SSA form, not
"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.

llvm-svn: 8884
2003-10-05 22:19:20 +00:00
Chris Lattner
d1c3f771f8 Change the interface to PromoteMemToReg to also take a DominatorTree
llvm-svn: 8883
2003-10-05 21:20:13 +00:00
Chris Lattner
47c12a2771 Speed up the mem2reg transform for allocas which are only read/written in a 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.

llvm-svn: 8881
2003-10-05 20:54:03 +00:00
Chris Lattner
ef607b19d1 Move support/lib/Support back to lib/Support
llvm-svn: 8874
2003-10-05 19:24:38 +00:00
Chris Lattner
e0ae24753d Add support for the Invoke instruction by using the LowerInvoke pass
llvm-svn: 8872
2003-10-05 19:16:09 +00:00
Chris Lattner
fc3f9605a7 Instead of hacking in custom support for Invoke/Unwind, use the LowerInvoke pass
llvm-svn: 8871
2003-10-05 19:15:47 +00:00
Chris Lattner
40a236b9ea Initial checkin of the LLVM->LLVM transform to support code generators which
do not support stack unwinding yet

llvm-svn: 8869
2003-10-05 19:14:42 +00:00
Chris Lattner
5206a78804 simplify-cfg is really a function pass
llvm-svn: 8868
2003-10-05 19:14:16 +00:00
Chris Lattner
e2a7875d26 Be more careful handling PHI nodes, which might be of potentially high degree.
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

llvm-svn: 8866
2003-10-05 17:44:18 +00:00
Chris Lattner
ada012bfcd The first PHI node may be null, scan for the first non-null one
llvm-svn: 8865
2003-10-05 05:34:39 +00:00
Chris Lattner
a5fd39ee21 The VersionNumbers vector is only used during PHI placement. Turn it into an argument, allowing us to get rid of the vector.
llvm-svn: 8864
2003-10-05 04:33:22 +00:00
Chris Lattner
4877c37b80 * Update file header comment
*** Revamp the code which handled unreachable code in the function.  Now the
    code is much more efficient for high-degree basic blocks, such as those
    that occur in the 252.eon SPEC benchmark.

For the interested, the time to promote a SINGLE alloca in _ZN7mrScene4ReadERSi
function used to be > 3.5s.  Now it is < .075s.  The function has a LOT of
allocas in it, so it appeared to be infinite looping, this should make it much
nicer.  :)

llvm-svn: 8863
2003-10-05 04:26:39 +00:00
Chris Lattner
baba417853 Simplify the loop a bit
llvm-svn: 8862
2003-10-05 03:45:44 +00:00
Chris Lattner
59281d3581 There is no need for separate WriteSets and PhiNodeBlocks lists. It is just a
work-list of value definitions.  This allows elimination of the explicit
'iterative' step of the algorithm, and also reuses temporary memory better.

llvm-svn: 8861
2003-10-05 03:39:10 +00:00
Chris Lattner
5958d93c95 The PhiNodes 2D vector is only used during PHI node placement. It doesn't
need to be an instance variable!

llvm-svn: 8860
2003-10-05 03:26:25 +00:00
Chris Lattner
91d69f2693 * Document instance vars better
* Fuse two parallel loops
* Use a more specific type for AllocaLookup

llvm-svn: 8859
2003-10-05 03:16:07 +00:00
Chris Lattner
773a1c4474 Two small cleanups/speedups:
* Do not insert a new entry into NewPhiNodes during the rename pass if there are no PHIs in a block.
 * Do not compute WriteSets in parallel

llvm-svn: 8858
2003-10-05 02:37:36 +00:00
Chris Lattner
9f0a542057 * Minor cleanups
* Eliminate the KillList instance variable, instead, just delete loads and
  stores as they are "renamed", and delete allocas when they are done
* Make the 'visited' set an instance variable to avoid passing it on the stack.

llvm-svn: 8857
2003-10-05 01:52:53 +00:00
Chris Lattner
dcefc3244a A couple of minor code cleanups.
Print literal doubles using ftostr instead of <<, because it yields higher precision numbers.

llvm-svn: 8855
2003-10-05 00:40:51 +00:00
Chris Lattner
b5f0d32b91 Type tables are now AbstractTypeUsers. This allows them to merge together
constants as necessary due to type resolution.  With this change, the
following spec benchmarks now link: 176.gcc, 177.mesa, 252.eon,
253.perlbmk, & 300.twolf.  IOW, all SPEC INT and FP benchmarks now link.

llvm-svn: 8853
2003-10-05 00:17:43 +00:00
Chris Lattner
def80d731a Rename AbstractModuleProvider -> ModuleProvider, to match the header file name,
and because, while the class used by the interface is abstract, the actual
concept is not.

llvm-svn: 8850
2003-10-04 20:14:59 +00:00
Chris Lattner
7a9db7a722 Transform two methods to return pointers directly instead of returning them
as 'by reference' arguments.

llvm-svn: 8849
2003-10-04 20:00:03 +00:00
Chris Lattner
0e866f36a0 Use V for values, not D.
llvm-svn: 8848
2003-10-04 19:29:21 +00:00
Chris Lattner
2b8c4bf029 Do not leak the ModuleProvider if releaseModule() throws.
llvm-svn: 8847
2003-10-04 19:19:37 +00:00
Chris Lattner
06dbcc0540 Minor random speedup: make Constant::getNullValue only call ConstantFOO::get
once!

llvm-svn: 8845
2003-10-03 19:34:51 +00:00
Chris Lattner
f66ac75a94 Explicit copy ctors are no longer needed
llvm-svn: 8844
2003-10-03 19:02:41 +00:00
Chris Lattner
a2c1509b21 Minor cleanups
llvm-svn: 8843
2003-10-03 18:57:54 +00:00
Chris Lattner
18c3f42894 This checkin basically amounts to a complete rewrite of the type-resolution
machinery.  This dramatically simplifies how things works, removes irritating
little corner cases, and overall improves speed and reliability.

Highlights of this change are:

1. The exponential algorithm built into the code is now gone.  For example
   the time to disassemble one bytecode file from the mesa benchmark went
   from taking 12.5s to taking 0.16s.
2. The linker bugs should be dramatically reduced.  The one remaining bug
   has to do with constant handling, which I actually introduced in
   "union-find" checkins.
3. The code is much easier to follow, as a result of fewer special cases.
   It's probably also smaller.  yaay.

llvm-svn: 8842
2003-10-03 18:46:24 +00:00
Chris Lattner
101d5058cb These methods are dead, remove them. Because the bodies will soon be
ressurected, just ifdef them out for now.

llvm-svn: 8840
2003-10-03 18:39:57 +00:00
Chris Lattner
85444d1dbd Dramatically simplify DerivedType::refineAbstractTypeToInternal
This makes use of the new PATypeHolder's to keep types from being deleted
prematurely, instead of the wierd "self reference" garbage.  This is easier
to understand and more efficient as well.

llvm-svn: 8834
2003-10-03 04:48:21 +00:00
Chris Lattner
b217f24289 Make the PATypeHolder use a simple union-find implementation to handle
merging of types.  This makes it MUCH more efficient than before, also
making things simpler.

llvm-svn: 8833
2003-10-02 23:35:57 +00:00
Chris Lattner
62331c44ab There is no need for BytecodeParser to be an AbstractTypeUser. Instead, it
can just use PATypeHolders

llvm-svn: 8832
2003-10-02 20:26:18 +00:00
Chris Lattner
83856d0df1 There is no reason for Value to be an AbstractTypeUser. This just makes things
significantly more complete.  Instead, just make DerivedType's AbstractTypeUser's,
and make Value contain a PATypeHolder.

llvm-svn: 8828
2003-10-02 19:44:40 +00:00
Chris Lattner
9f5802fac5 The objects mapped are really PATypeHolders, not PATypeHandles
llvm-svn: 8822
2003-10-02 19:00:34 +00:00
Alkis Evlogimenos
a37b58ce09 Moved enum and command-line option in separate file. Also added function that returns the user selected register allocator to the caller.
llvm-svn: 8819
2003-10-02 16:57:49 +00:00
Chris Lattner
059033218b Implement InstCombine/add.ll:test17 & 18
llvm-svn: 8817
2003-10-02 15:11:26 +00:00
Alkis Evlogimenos
42a09316bb Change llc command line for register allocators
llvm-svn: 8815
2003-10-02 06:13:19 +00:00
Alkis Evlogimenos
e6fdc87045 Use std::string::size_type for for ColonPos to stop gcc from giving a warning
llvm-svn: 8811
2003-10-01 22:49:22 +00:00
Alkis Evlogimenos
a50598c684 Revert previous change. For some reason this went into the main branch
llvm-svn: 8805
2003-10-01 19:40:13 +00:00
Alkis Evlogimenos
e3af981096 Added command line option for linear scan allocator
llvm-svn: 8804
2003-10-01 19:38:10 +00:00
Misha Brukman
15fd4fd90c The comment seems irrelevant as the pass has become a BasicBlock pass.
llvm-svn: 8803
2003-10-01 05:24:50 +00:00
Chris Lattner
bdca1b438d Make sure to get the definition of getRegisterAllocator
llvm-svn: 8801
2003-09-30 22:24:00 +00:00
Chris Lattner
5509b86d74 RegisterAllocation.h is going away
llvm-svn: 8795
2003-09-30 20:15:04 +00:00
Chris Lattner
b0860d88c2 include passes.h which defines the interface this file exposes
llvm-svn: 8793
2003-09-30 20:13:59 +00:00
Brian Gaeke
ed1c780821 Add statistic for # of emitWord() calls.
llvm-svn: 8772
2003-09-30 17:49:41 +00:00
Misha Brukman
e156f46fa8 Fixed space issues, code alignment, tabs -> spaces.
llvm-svn: 8755
2003-09-29 22:40:07 +00:00
Misha Brukman
4d40649e9a Implementation of the abstraction of running our tools + gcc, taken out of
bugpoint for general usage and enjoyment.

llvm-svn: 8754
2003-09-29 22:39:25 +00:00
John Criswell
48274726cd Removed Support directory. It now lives in llvm/support/lib.
llvm-svn: 8739
2003-09-29 16:10:43 +00:00
John Criswell
22cf58bc33 Moved code from llvm/lib/Support to llvm/support/lib/Support.
llvm-svn: 8735
2003-09-29 15:02:30 +00:00
Chris Lattner
ae8b7c1a56 Just rethrow previous exception instead of making a new one
llvm-svn: 8718
2003-09-26 14:44:52 +00:00
Chris Lattner
222df3cfc5 Define the instance variable Buffer, not the automatic variable Buffer.
This was causing us to munmap random stuff, which is obviously bad.

llvm-svn: 8709
2003-09-25 04:13:53 +00:00
Chris Lattner
471405e2ba DOn't crash if program calls the null pointer
llvm-svn: 8708
2003-09-24 23:42:58 +00:00
Chris Lattner
6d9f1022d5 Fix alignment problem
llvm-svn: 8707
2003-09-24 22:34:17 +00:00
Chris Lattner
36559daef0 Remove explicit use of BasicBlock::succ_iterator
llvm-svn: 8706
2003-09-24 22:18:35 +00:00
Misha Brukman
08e8d47b1e Actually assign the string correctly through the std::string pointer.
llvm-svn: 8704
2003-09-24 22:10:47 +00:00
Chris Lattner
a72fa3ea50 Use global *_iterator
llvm-svn: 8703
2003-09-24 22:07:33 +00:00
Chris Lattner
feb17a5fbf Do not use BasicBlock::*_iterator, just use *_iterator itself.
Isn't updating copy and pasted code a joy

llvm-svn: 8702
2003-09-24 22:06:25 +00:00
Misha Brukman
c16b33f803 * Eliminate BytecodeBufferReader::Length member variable
* Kill unused ALIN_PTRS #define
* Set the error string if user passed it in to be compatible with former API

llvm-svn: 8701
2003-09-24 22:04:02 +00:00
Chris Lattner
d950f19834 Do not use BasicBlock::succ_iterator
llvm-svn: 8700
2003-09-24 22:03:22 +00:00
Brian Gaeke
8b15e271a5 Update head-of-file comment.
llvm-svn: 8699
2003-09-24 18:16:23 +00:00
Brian Gaeke
1c9978c999 Untabify tabs in stuff I've recently added.
Check in my register allocator state-saving code.

llvm-svn: 8698
2003-09-24 18:08:54 +00:00
Brian Gaeke
dee6b30348 Use getRegClassID() instead of getRegClass()->getID(), since it's there.
Shorten the markSuggestedColorUsable method.
Add a switch for saving reg. alloc. state (coming soon).

llvm-svn: 8697
2003-09-24 17:50:28 +00:00
Brian Gaeke
9ef4c789e3 Remove some unused methods of class IGNode.
llvm-svn: 8696
2003-09-24 04:29:52 +00:00
John Criswell
92b65ebb52 Added code that ensures that we pass the beginning of the data buffer to
the parsing routines regardless of whether the buffer is re-aligned or not.

llvm-svn: 8693
2003-09-23 21:19:11 +00:00
Chris Lattner
cdf12dfd03 Fix bug: IndVarsSimplify/2003-09-23-NotAtTop.ll
llvm-svn: 8689
2003-09-23 20:26:48 +00:00
Misha Brukman
6d1b1553c1 Fixed spelling.
llvm-svn: 8687
2003-09-23 17:28:11 +00:00
Misha Brukman
c52311be4f Fix spelling.
llvm-svn: 8686
2003-09-23 17:27:28 +00:00
Misha Brukman
12fd3ebd72 Stop returning bool and pass Instruction by reference;
return std::auto_ptr and use exceptions

llvm-svn: 8684
2003-09-23 16:17:50 +00:00
Misha Brukman
055804accd Suggestions made by Chris:
* 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()

llvm-svn: 8683
2003-09-23 16:15:29 +00:00
Misha Brukman
fbb96c627b * Group class definitions & implementations together
* Make sure we align the buffer we're given
* Do not let exceptions propagate when the caller asks for a Module*
* Add doxygenified comments to wrapper functions

llvm-svn: 8682
2003-09-23 16:13:28 +00:00
Chris Lattner
afea820122 Move getAnalysisUsage method from header to .cpp file. Add a normal file
header comment

llvm-svn: 8679
2003-09-23 15:13:04 +00:00
Misha Brukman
63749f4126 * Constantify arguments to copy function
* Stop using a #define, make it an inline if statement

llvm-svn: 8678
2003-09-23 15:09:26 +00:00
Misha Brukman
e05ffcca52 Removed no longer used member variable.
llvm-svn: 8677
2003-09-22 23:58:08 +00:00
Misha Brukman
643183413a Uppercase the acronym ASCII.
llvm-svn: 8676
2003-09-22 23:50:25 +00:00
Misha Brukman
c68b0950aa Added file header comment.
llvm-svn: 8675
2003-09-22 23:44:46 +00:00
Misha Brukman
78cf1f07b6 * No longer initialize the module, a subclass is more suitable to do this
because it can add a module ID which we do not have at this time.
* Check to see if the module has been initialized when materializing it.

llvm-svn: 8674
2003-09-22 23:44:13 +00:00
Chris Lattner
b98aa0e0fb Update file header for renamed file
llvm-svn: 8673
2003-09-22 23:42:00 +00:00
Misha Brukman
41f2a38c92 * Cleaned up code:
- 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

llvm-svn: 8671
2003-09-22 23:38:23 +00:00
Chris Lattner
253c5f582e Fix bugs in the last change
llvm-svn: 8667
2003-09-22 23:30:59 +00:00
Chris Lattner
7ff5b8a024 Fix bug: Inline/2003-09-22-PHINodesInNormalInvokeDest.ll
llvm-svn: 8666
2003-09-22 22:35:39 +00:00
Chris Lattner
2cb1e9f0a6 Fix bug: Inline/2003-09-22-PHINodesInExceptionDest.ll
... by making sure to update PHI nodes to take into consideration the
extra edges we get if we inline a call instruction through an invoke.

llvm-svn: 8664
2003-09-22 21:59:27 +00:00
Misha Brukman
db8303670b Credits now go into the top-level CREDITS.TXT
llvm-svn: 8662
2003-09-22 21:57:56 +00:00
Misha Brukman
94a0f2edf0 Credits are now in top-level CREDITS.TXT
llvm-svn: 8661
2003-09-22 21:57:15 +00:00
Chris Lattner
68f6d33416 Squelch warning
llvm-svn: 8659
2003-09-22 20:33:34 +00:00
Vikram S. Adve
be3b73177f Fix assertion so it doesn't not trip incorrectly.
llvm-svn: 8650
2003-09-21 07:55:27 +00:00
Brian Gaeke
1fdcd32b79 Use C++ math header instead of C version.
llvm-svn: 8648
2003-09-21 03:57:37 +00:00
Brian Gaeke
4013dbc6b0 Erase now-unused prototypes.
llvm-svn: 8647
2003-09-21 02:51:00 +00:00