1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

1002 Commits

Author SHA1 Message Date
Chris Lattner
1c989f6d65 Regularize header file comment, eliminate using's
llvm-svn: 9069
2003-10-13 03:30:47 +00:00
Chris Lattner
c8586d8d06 Minor cleanups
llvm-svn: 9067
2003-10-13 01:02:33 +00:00
Chris Lattner
af8f585013 Checkin an improvement contributed by Bill:
Only transform call sites in a setjmp'ing function which are reachable from
the setjmp.  If the call dominates the setjmp (for example), the called
function cannot longjmp to the setjmp.

This dramatically reduces the number of invoke instructions created in some
large testcases.

llvm-svn: 9066
2003-10-13 00:57:16 +00:00
Chris Lattner
7519b1216b Add support to the loop canonicalization pass to make it transform loops to
have a SINGLE backedge.  This is useful to, for example, the -indvars pass.

This implements testcase LoopSimplify/single-backedge.ll and closes PR#34

llvm-svn: 9065
2003-10-13 00:37:13 +00:00
Chris Lattner
f4ca01758d Rename loop preheaders pass to loop simplify
llvm-svn: 9061
2003-10-12 21:52:28 +00:00
Chris Lattner
1c8a980870 File is renamed to LoopSimplify.cpp
llvm-svn: 9059
2003-10-12 21:44:18 +00:00
Chris Lattner
7fe9661cae First step in renaming the preheaders pass to loopsimplify
llvm-svn: 9058
2003-10-12 21:43:28 +00:00
Chris Lattner
510dfc942a The preheader insertion pass only depends on the CFG. Mark it as such, which
allows GCCAS to only run it once.

llvm-svn: 9056
2003-10-12 19:33:10 +00:00
Brian Gaeke
e5249bf429 Include <cstdio> instead of <stdio.h>.
llvm-svn: 9032
2003-10-10 18:46:52 +00:00
Brian Gaeke
a3f850a182 Don't include Config/stdio.h or <stdio.h>.
llvm-svn: 9031
2003-10-10 18:46:29 +00:00
Misha Brukman
868eac95dd Fix spelling.
llvm-svn: 9027
2003-10-10 17:57:28 +00:00
Misha Brukman
339d9fb58d Fixing the spelling of this filename.
llvm-svn: 9009
2003-10-10 16:57:31 +00:00
Chris Lattner
bf95cc12a3 Update comment
llvm-svn: 8965
2003-10-08 16:56:11 +00:00
Chris Lattner
9cece85acb Use a set to keep track of which edges have been noticed as executable already
to avoid reprocessing PHI nodes needlessly.  This speeds up the big bad PHI
testcase 43%: from 104.9826 to 73.5157s

llvm-svn: 8964
2003-10-08 16:55:34 +00:00
Chris Lattner
251ff679ce Minor fixes here and there
llvm-svn: 8963
2003-10-08 16:21:03 +00:00
Chris Lattner
36960b263b Avoid building data structures we don't really need. This improves the runtime
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.

llvm-svn: 8962
2003-10-08 15:47:41 +00:00
Chris Lattner
16b7ed1eaa whoops, don't accidentally lose variable names
llvm-svn: 8955
2003-10-07 22:58:41 +00:00
Chris Lattner
f507e6e58e Fix bug: InstCombine/cast.ll:test11 / PR#7
llvm-svn: 8954
2003-10-07 22:54:13 +00:00
Chris Lattner
e8b656a62f Refactor code a bit
llvm-svn: 8952
2003-10-07 22:32:43 +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
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
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
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
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
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
059033218b Implement InstCombine/add.ll:test17 & 18
llvm-svn: 8817
2003-10-02 15:11:26 +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
Chris Lattner
cdf12dfd03 Fix bug: IndVarsSimplify/2003-09-23-NotAtTop.ll
llvm-svn: 8689
2003-09-23 20:26:48 +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
Chris Lattner
b6aad9cad0 Global variables with APPENDING linkage are very important to keep around!
llvm-svn: 8632
2003-09-20 19:00:50 +00:00