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

104 Commits

Author SHA1 Message Date
Chris Lattner
2d4d557c80 add a typedef, no other change.
llvm-svn: 40804
2007-08-04 01:19:38 +00:00
Chris Lattner
65181deba3 avoid an unneeded vector copy. This speeds up mem2reg on the testcase
in PR1432 by 6%

llvm-svn: 40803
2007-08-04 01:07:49 +00:00
Chris Lattner
34cf111957 make RenamePassWorkList a local var instead of an ivar.
llvm-svn: 40802
2007-08-04 01:04:40 +00:00
Devang Patel
a466c96f77 Use DominatorTree instead of ETForest.
This allows faster immediate domiantor walk.

llvm-svn: 37500
2007-06-07 21:57:03 +00:00
Devang Patel
e5765bd115 Mem2Reg does not need TargetData.
llvm-svn: 36444
2007-04-25 18:32:35 +00:00
Devang Patel
b6ef7bc5d9 Remove unused function argument.
llvm-svn: 36441
2007-04-25 17:15:20 +00:00
Owen Anderson
9813f7fa80 Fix a comment.
llvm-svn: 36299
2007-04-21 07:12:44 +00:00
Owen Anderson
41b527b75f Move more passes to using ETForest instead of DominatorTree.
llvm-svn: 36271
2007-04-20 06:27:13 +00:00
Devang Patel
c2708c8ccb Reduce malloc/free traffic.
llvm-svn: 35370
2007-03-26 23:19:29 +00:00
Devang Patel
20b8163ad3 Remove dead comments.
llvm-svn: 35053
2007-03-09 23:41:03 +00:00
Devang Patel
8a26f4caa0 Avoid recursion. Use iterative algorithm for RenamePass().
llvm-svn: 35052
2007-03-09 23:39:14 +00:00
Chris Lattner
474d7b219d redesign the primary datastructure used by mem2reg to eliminate an
std::map of std::vector's (ouch!).  This speeds up mem2reg by 10% on 176.gcc.

llvm-svn: 33974
2007-02-07 01:15:04 +00:00
Chris Lattner
5fee493a8c With the last change, we no longer need both directions of mapping from
BBNumbers.  Instead of using a bi-directional mapping, just use a single
densemap.  This speeds up mem2reg on 176.gcc by 8%, from  1.3489 to
1.2485s.

llvm-svn: 33940
2007-02-05 23:37:20 +00:00
Chris Lattner
7703e811eb Simplify use of DFBlocks, this makes no noticable performance difference,
but paves the way to eliminate BBNumbers.

llvm-svn: 33938
2007-02-05 23:31:26 +00:00
Chris Lattner
c7487c93da Switch InsertedPHINodes back to SmallPtrSet now that the SmallPtrSet::erase
bug is fixed.

llvm-svn: 33932
2007-02-05 23:11:37 +00:00
Chris Lattner
0ae77ee391 switch a SmallPtrSet back to an std::set for now, this caused problems.
llvm-svn: 33930
2007-02-05 22:28:52 +00:00
Chris Lattner
9a99e6ee24 switch an std::set over to a SmallPtrSet, speeding up mem2reg 6% on 176.gcc.
llvm-svn: 33929
2007-02-05 22:15:21 +00:00
Chris Lattner
19e7a5695d switch an std::set over to SmallPtrSet, speeding up mem2reg 3.4% on 176.gcc.
llvm-svn: 33928
2007-02-05 22:13:11 +00:00
Chris Lattner
5d5bf2ed87 eliminate some malloc traffic, this speeds up mem2reg by 3.4%.
llvm-svn: 33927
2007-02-05 21:58:48 +00:00
Chris Lattner
33bd5dcfb7 s|llvm/Support/Visibility.h|llvm/Support/Compiler.h|
llvm-svn: 29911
2006-08-27 12:54:02 +00:00
Chris Lattner
496bd3fbf6 Use hidden visibility to make symbols in an anonymous namespace get
dropped.  This shrinks libllvmgcc.dylib another 67K

llvm-svn: 28975
2006-06-28 23:17:24 +00:00
Chris Lattner
be67e21327 Fix some nondeterminstic behavior in the mem2reg pass that (in addition to
nondeterminism being bad) could cause some trivial missed optimizations (dead
phi nodes being left around for later passes to clean up).

With this, llvm-gcc4 now bootstraps and correctly compares.  I don't know
why I never tried to do it before... :)

llvm-svn: 27984
2006-04-27 01:14:43 +00:00
Chris Lattner
fc4928a31a Implement a refinement to the mem2reg algorithm for cases where an alloca
has a single def.  In this case, look for uses that are dominated by the def
and attempt to rewrite them to directly use the stored value.

This speeds up mem2reg on these values and reduces the number of phi nodes
inserted.  This should address PR665.

llvm-svn: 24411
2005-11-18 07:31:42 +00:00
Chris Lattner
86e6fa1ee7 This needs proper dominance
llvm-svn: 24410
2005-11-18 07:29:44 +00:00
Chris Lattner
915053ba79 This code can handle non-dominating instructions
llvm-svn: 22667
2005-08-05 00:57:45 +00:00
Nate Begeman
ef41400067 Fix a fixme in CondPropagate.cpp by moving a PhiNode optimization into
BasicBlock's removePredecessor routine.  This requires shuffling around
the definition and implementation of hasContantValue from Utils.h,cpp into
Instructions.h,cpp

llvm-svn: 22664
2005-08-04 23:24:19 +00:00
Jeff Cohen
bd51ec7461 Eliminate all remaining tabs and trailing spaces.
llvm-svn: 22523
2005-07-27 06:12:32 +00:00
Chris Lattner
02fe175f3d Fix PR590 and Transforms/Mem2Reg/2005-06-30-ReadBeforeWrite.ll.
The optimization for locally used allocas was not safe for allocas that
were read before they were written.  This change disables that optimization
in that case.

llvm-svn: 22318
2005-06-30 07:29:44 +00:00
Misha Brukman
53e199440e Remove trailing whitespace
llvm-svn: 21427
2005-04-21 23:48:37 +00:00
Chris Lattner
537e5a6b50 Fix test/Regression/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.llx
This only fails on darwin or on X86 under valgrind.

llvm-svn: 18377
2004-11-30 07:01:15 +00:00
Reid Spencer
2b5cfe8be8 Correction to allow compilation with Visual C++.
Patch contributed by Morten Ofstad. Thanks Morten!

llvm-svn: 17123
2004-10-18 14:38:48 +00:00
Chris Lattner
f7bf129037 Fix a bug that occurs when the constant value is the result of an invoke. In
particular, invoke ret values are only live in the normal dest of the invoke
not in the unwind dest.

llvm-svn: 17108
2004-10-18 01:21:17 +00:00
Chris Lattner
ac92e5fcd0 When inserting PHI nodes, don't insert any phi nodes that are obviously
unneccesary.  This allows us to delete several hundred phi nodes of the
form PHI(x,x,x,undef) from 253.perlbmk and probably other programs as well.

This implements Mem2Reg/UndefValuesMerge.ll

llvm-svn: 17098
2004-10-17 21:25:56 +00:00
Chris Lattner
ca01f160ee When promoting mem2reg, make uninitialized values become undef isntead of 0.
llvm-svn: 17045
2004-10-16 18:10:06 +00:00
Chris Lattner
98d434988e Remove a whole bunch of horrible hacky code that was used to promote allocas
whose addresses where used by trivial phi nodes and select instructions.  This
is now performed by the instcombine pass, which is more powerful, is much
simpler, and is faster.  This allows the deletion of a bunch of code, two
FIXME's and two gotos.

llvm-svn: 16406
2004-09-19 18:51:51 +00:00
Chris Lattner
f31ae4da07 Make sure to remove the Select instruction as well
llvm-svn: 16389
2004-09-18 00:32:40 +00:00
Chris Lattner
1d9b957384 If given an AliasSetTracker object to update, update it.
llvm-svn: 16347
2004-09-15 01:02:54 +00:00
Alkis Evlogimenos
0c50e0f211 Fixes to make LLVM compile with vc7.1.
Patch contributed by Paolo Invernizzi!

llvm-svn: 16152
2004-09-03 18:19:51 +00:00
Reid Spencer
c4abcbefb1 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Misha Brukman
58104df77b Fix #includes of i*.h => Instructions.h as per PR403.
llvm-svn: 15334
2004-07-29 17:30:56 +00:00
Chris Lattner
d2720878ec Change to use the StableBasicBlockNumbering class
llvm-svn: 14247
2004-06-19 08:42:40 +00:00
Chris Lattner
3aed3a8bf2 Do not let the numbering of PHI nodes placed in the function depend on
non-deterministic things like the ordering of blocks in the dominance
frontier of a BB.  Unfortunately, I don't know of a better way to solve
this problem than to explicitly sort the BB's in function-order before
processing them.  This is guaranteed to slow the pass down a bit, but
is absolutely necessary to get usable diffs between two different tools
executing the mem2reg or scalarrepl pass.

Before this, bazillions of spurious diff failures occurred all over the
place due to the different order of processing PHIs:

-       %tmp.111 = getelementptr %struct.Connector_struct* %upcon.0.0, uint 0, uint 0
+       %tmp.111 = getelementptr %struct.Connector_struct* %upcon.0.1, uint 0, uint 0

Now, the diffs match.

llvm-svn: 14244
2004-06-19 07:40:14 +00:00
Chris Lattner
d8efae05fe Implement ScalarRepl/select_promote.ll
llvm-svn: 12779
2004-04-08 19:59:34 +00:00
Chris Lattner
2998d508b0 Bunch up all locally used allocas by the block they are allocated in, and
process them all as a group.  This speeds up SRoA/mem2reg from 28.46s to
0.62s on the testcase from PR209.

llvm-svn: 11100
2004-02-03 22:34:12 +00:00
Chris Lattner
eee884cc98 Handle extremely trivial cases extremely efficiently. This speeds up
SRoA/mem2reg from 41.2s to 27.5s on the testcase in PR209.

llvm-svn: 11099
2004-02-03 22:00:33 +00:00
Chris Lattner
40c667e0bc Implement Transforms/ScalarRepl/phinodepromote.ll, which is an important
case that the C/C++ front-end generates.

llvm-svn: 10761
2004-01-12 01:18:32 +00:00
Chris Lattner
031bd7e9f3 Finegrainify namespacification
llvm-svn: 10727
2004-01-09 06:12:26 +00:00
Brian Gaeke
d25f86d683 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
John Criswell
b402729b30 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.

llvm-svn: 9298
2003-10-20 19:43:21 +00:00
Chris Lattner
e4a69325ff Fix PR#50
llvm-svn: 9227
2003-10-18 06:14:59 +00:00