1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-25 14:02:52 +02:00
Commit Graph

940 Commits

Author SHA1 Message Date
Chris Lattner
409ef7935c Remove obsolete files
llvm-svn: 12633
2004-04-02 20:56:24 +00:00
Chris Lattner
0a34ab8221 Comment out debugging printouts
llvm-svn: 12623
2004-04-02 20:26:46 +00:00
Chris Lattner
74911ffd6b Add a new analysis
llvm-svn: 12619
2004-04-02 20:23:17 +00:00
Chris Lattner
ecb0efb6e5 Minor efficiency improvement, finegrainify namespacification
llvm-svn: 12517
2004-03-25 22:56:03 +00:00
Chris Lattner
c534fac018 Fix a HORRIBLY NASTY bug that caused siod to stop working last night.
llvm-svn: 12479
2004-03-17 23:22:04 +00:00
Chris Lattner
c2eb0678d8 Add some missing functions. Make sure to handle calls together in case the
client has another VN implementation that can VN calls.

llvm-svn: 12427
2004-03-16 03:41:35 +00:00
Chris Lattner
19ce9dbb05 Ok, the assertion was bogus. Calls that do not read/write memory should not
have an alias set, just like adds and subtracts don't.

llvm-svn: 12422
2004-03-15 06:28:07 +00:00
Chris Lattner
5654b5de80 This assertion is bogus now that calls do not necessarily read/write memory
llvm-svn: 12421
2004-03-15 06:24:15 +00:00
Chris Lattner
62771c4bef Implement CSE of call instructions in the most trivial case. This implements
GCSE/call_cse.ll

llvm-svn: 12419
2004-03-15 05:44:59 +00:00
Chris Lattner
cd227e5bdb Fix a minor bug, implementing GCSE/call_pure_function.ll
Also, add some stuff I missed before.

llvm-svn: 12417
2004-03-15 04:18:28 +00:00
Chris Lattner
b0cf0f89be Don't be COMPLETELY pessimistic in the face of function calls
llvm-svn: 12413
2004-03-15 04:08:36 +00:00
Chris Lattner
cb99b04ead Deinline some virtual methods, provide better mod/ref answers through the
use of the boolean queries

llvm-svn: 12410
2004-03-15 04:07:29 +00:00
Chris Lattner
60c61e337a Pass through the boolean queries
llvm-svn: 12409
2004-03-15 04:06:46 +00:00
Chris Lattner
0ea40c6fac Teach basicaa about some stdc functions.
llvm-svn: 12408
2004-03-15 03:36:49 +00:00
Chris Lattner
37b7966121 Fix a tiny bug that caused an incorrect assertion failure poolallocating
boxed-sim.

llvm-svn: 12358
2004-03-13 01:14:23 +00:00
Chris Lattner
f7bc6fd913 Rename the intrinsic enum values for llvm.va_* from Intrinsic::va_* to
Intrinsic::va*.  This avoid conflicting with macros in the stdlib.h file.

llvm-svn: 12356
2004-03-13 00:24:00 +00:00
Chris Lattner
bb08e801d4 Fix a couple of minor problems. Because PHI nodes can use themselves, this
could cause infinite loops.  Also, getUnderlyingObject can return null

llvm-svn: 12351
2004-03-12 23:12:55 +00:00
Chris Lattner
6bd3783ef8 Implement mod/ref analysis for a trivial case where locals don't escape.
This comes up when you have a local array on the stack and you never pass
the address of elements around.

llvm-svn: 12349
2004-03-12 22:39:00 +00:00
Misha Brukman
ffcf81a11b Simplify code to process CallSites (thanks to Chris).
llvm-svn: 12334
2004-03-12 16:20:49 +00:00
Misha Brukman
b5e89d17c2 Evaluate ModRef information in addition to regular ol' pointer analysis.
llvm-svn: 12331
2004-03-12 06:15:08 +00:00
Misha Brukman
ee27e80a0b Implement getModRefInfo() for DSA to calculate whether a function modifies or
references a pointer.

llvm-svn: 12330
2004-03-12 06:14:22 +00:00
Misha Brukman
da119ce857 Make code more readable.
llvm-svn: 12305
2004-03-12 00:58:41 +00:00
Chris Lattner
405790ecae Fix PR284: [indvars] Induction variable analysis violates LLVM invariants
llvm-svn: 12275
2004-03-10 21:42:19 +00:00
Chris Lattner
9ce3638433 implement new method
llvm-svn: 12264
2004-03-09 19:37:06 +00:00
Chris Lattner
9414c55663 Switch to using edge profiling information as the basic source of profile info
from using basic block counts.

llvm-svn: 12242
2004-03-08 22:04:08 +00:00
Chris Lattner
83c62c84d6 Refactor implementations
llvm-svn: 12240
2004-03-08 21:30:35 +00:00
Chris Lattner
91ea0d3176 Import the trace class from the reoptimizer
llvm-svn: 12236
2004-03-08 20:57:27 +00:00
Chris Lattner
de661f7219 If we have edge counts, we can produce block counts. I've verified that
using an edge profile to produce block counts gives the exact same numbers
as using a block count directly.

llvm-svn: 12232
2004-03-08 20:03:52 +00:00
Chris Lattner
f3a838662e Add initial support for reading edge counts. This will be improved to enable
translation of edge counts into block/function counts when possible.

llvm-svn: 12229
2004-03-08 18:20:18 +00:00
Chris Lattner
1ae4150e31 Fix a bug handling globals that are constants, but are still external
llvm-svn: 12208
2004-03-08 03:52:24 +00:00
Chris Lattner
5a9cae47a4 Fix a minor bug
llvm-svn: 12169
2004-03-05 22:04:07 +00:00
Misha Brukman
75729872be Unbreak the build on Sparc.
llvm-svn: 12161
2004-03-05 20:04:40 +00:00
Chris Lattner
f21e7a75d6 Fix a bug in a previous checkin that broke 175.vpr
llvm-svn: 12128
2004-03-04 21:36:57 +00:00
Chris Lattner
c885697daa Add support for strto* and v*printf
llvm-svn: 12127
2004-03-04 21:03:54 +00:00
Chris Lattner
48b0fd7101 Add non-crappy support for varargs
llvm-svn: 12126
2004-03-04 20:33:47 +00:00
Chris Lattner
ac1eaa43fa Implement a FIXME, improving the efficiency of DSA on povray.
This reduces CBU time from 145s -> 122s (debug build), reduces # allocated nodes
from 129420 to 116477.

llvm-svn: 12125
2004-03-04 19:47:04 +00:00
Chris Lattner
e3fc09a37e Speed up the cbu pass from taking somewhere near the age of the universe to about 90s on povray
llvm-svn: 12123
2004-03-04 19:16:35 +00:00
Chris Lattner
bc7fc82865 Fix BU datastructures with povray!
The problem was that we were merging a field of a node with a value that was
deleted.  Thanks to bugpoint for reducing povray to a nice small 3 function
example.  :)

llvm-svn: 12116
2004-03-04 17:06:53 +00:00
Chris Lattner
e0c90cf983 Minor changes, remove some debugging code that got checked in somehow.
Make sure to scope the NodeMap passed into cloneInto so that it doesn't point
to nodes that are deleted.  Add some FIXME's for future performance enhancements.

llvm-svn: 12115
2004-03-04 17:05:28 +00:00
Chris Lattner
790bd9d970 Only clone nodes that are needed in the caller, don't clone ALL aux calls. This improves
povray from having ~600K nodes and 300K call nodes to 65K nodes and 25K call nodes.

llvm-svn: 12109
2004-03-04 03:57:53 +00:00
Chris Lattner
a141de0f09 Fix a minor bug handling incomplete programs
llvm-svn: 12105
2004-03-03 23:00:19 +00:00
Chris Lattner
0e1cd00f2c Fix a DSA bug that caused DSA to generate incredibly huge graphs and take forever to
do it on povray.  The problem is that we were not copying globals from callees to
callers unless the existed in both graphs.  We should have copied them in the case
where the global pointed to a node that was copied as well.

llvm-svn: 12104
2004-03-03 22:01:09 +00:00
Chris Lattner
a6540122dc Deinline methods, add fast exit
llvm-svn: 12102
2004-03-03 20:55:27 +00:00
Chris Lattner
309a57f0c0 Fix a node mapping problem that was causing the pool allocator to locally allocate
nodes that were globally live, thus breaking programs.

llvm-svn: 12094
2004-03-03 05:34:31 +00:00
Chris Lattner
ea4242a575 FINALLY be able to get symbolic type names in the globals graph!
llvm-svn: 12082
2004-03-02 21:39:43 +00:00
Chris Lattner
833646d6b8 Really, only if reopen
llvm-svn: 12080
2004-03-02 20:46:18 +00:00
Chris Lattner
e7c638e989 Correctly add an array marker on a node when appropriate!
llvm-svn: 12055
2004-03-01 19:02:54 +00:00
Chris Lattner
9bf85f216b Expand on my note-to-self
llvm-svn: 12029
2004-03-01 02:44:44 +00:00
Chris Lattner
9e71c09ff5 Only clone global nodes between graphs if both graphs have the global.
llvm-svn: 11928
2004-02-27 20:05:15 +00:00
Chris Lattner
138a7dfb62 ADD MORE FUNCTIONS!
llvm-svn: 11927
2004-02-27 20:04:48 +00:00
Chris Lattner
d359fbf991 Be a good little compiler and handle direct calls efficiently, even if there
are beastly ConstantPointerRefs in the way...

llvm-svn: 11883
2004-02-26 22:07:22 +00:00
Chris Lattner
9e55e31b2d Fix typo
llvm-svn: 11864
2004-02-26 03:45:03 +00:00
Chris Lattner
7990e4dcd0 The node doesn't have to be _no_ node flags, it just has to be complete and
not have any globals.

llvm-svn: 11863
2004-02-26 03:43:43 +00:00
Chris Lattner
948fffa8a2 Add _more_ functions
llvm-svn: 11862
2004-02-26 03:43:08 +00:00
Chris Lattner
9fd0c48f80 Two changes:
1. Functions do not make things incomplete, only variables
 2. Constant global variables no longer need to be marked incomplete, because
    we are guaranteed that the initializer for the global will be in the
    graph we are hacking on now.  This makes resolution of indirect calls happen
    a lot more in the bu pass, supports things like vtables and the C counterparts
    (giant constant arrays of function pointers), etc...

Testcase here: test/Regression/Analysis/DSGraph/constant_globals.ll

llvm-svn: 11852
2004-02-25 23:36:08 +00:00
Chris Lattner
7d273bc532 When building local graphs, clone the initializer for constant globals into each
local graph that uses the global.

llvm-svn: 11850
2004-02-25 23:31:02 +00:00
Chris Lattner
9fe3bf296d Simplify the dead node elimination stuff
Make the incompleteness marker faster by looping directly over the globals
instead of over the scalars to find the globals

Fix a bug where we didn't mark a global incomplete if it didn't have any
outgoing edges.  This wouldn't break any current clients but is still wrong.

llvm-svn: 11848
2004-02-25 23:08:00 +00:00
Chris Lattner
a9f67b5ab8 Add a bunch more functions
llvm-svn: 11847
2004-02-25 23:06:40 +00:00
Chris Lattner
d99d965f8c Try harder to get symbol info
llvm-svn: 11846
2004-02-25 23:06:30 +00:00
Chris Lattner
4f09004dff Add a bunch more functions used by perlbmk
llvm-svn: 11824
2004-02-25 17:43:20 +00:00
Chris Lattner
9036c86b14 Add support for 'rename'
llvm-svn: 11813
2004-02-24 22:17:00 +00:00
Chris Lattner
d9652be664 Add support for remove, fwrite, and fread
Also fix problem where we didn't check to see if a node pointer was null.
Though fclose(null) doesn't make a lot of sense, 300.twolf does it.

llvm-svn: 11810
2004-02-24 22:02:48 +00:00
Chris Lattner
63b79422f3 Fix a soon-to-be-missing #include
llvm-svn: 11707
2004-02-22 06:26:17 +00:00
Chris Lattner
573441bfbd Use isNull instead of getNode() to test for existence of a node, this is cheaper.
FIX MAJOR BUG, whereby we didn't merge null edges correctly. Correcting this
fixes poolallocation on 175.vpr, and possibly others.

llvm-svn: 11695
2004-02-22 00:53:54 +00:00
Chris Lattner
7bff00313e Fix an iterator invalidation problem which was causing some nodes to not be
correctly merged over!

llvm-svn: 11693
2004-02-21 22:28:26 +00:00
Chris Lattner
458704f675 Use handy method
llvm-svn: 11692
2004-02-21 22:27:31 +00:00
Chris Lattner
dacc6a7448 Instead of cloning the globals for main into the globals graph at the end of
BU propagation, clone the globals into the GG of EACH FUNCTION that finishes
processing!  The GlobalsGraph *must* include all globals and effects from
all functions in the program.  Fixing this makes pool allocation work better
on 175.vpr, but it still ultimately crashes.

llvm-svn: 11686
2004-02-21 00:30:28 +00:00
Chris Lattner
0f9200e5a5 There is no need to merge the globals graph into the function graphs at the
end of the BU and CBU passes.  The globals will be marked incomplete, so it
doesn't matter if they are missing some info, and merging isn't guaranteed
to bring everything in anyway!

llvm-svn: 11684
2004-02-20 23:52:15 +00:00
Chris Lattner
31f8fa66cb Add two missing returns, which caused us to be very pessimistic about the
printf and scanf families!

llvm-svn: 11683
2004-02-20 23:27:09 +00:00
Chris Lattner
4653c4cb50 Add support for some string functions, the scanf family, and sprintf
llvm-svn: 11673
2004-02-20 20:27:11 +00:00
Chris Lattner
d9e1a49650 When we complete the bottom-up pass, make sure to merge the globals in 'main' into
the globals graph.

llvm-svn: 11562
2004-02-17 19:06:47 +00:00
Chris Lattner
2c0736be99 Only spit out warning for functions that take pointers, not for sin and the like
Add more special case handling for stdio functions.  I feel dirty, how about you?

llvm-svn: 11506
2004-02-16 22:57:19 +00:00
Chris Lattner
513e4c7bd9 memset and bcopy and now unified by the llvm.memset intrinsic
llvm-svn: 11503
2004-02-16 18:37:40 +00:00
Chris Lattner
cd6a595db5 No need to scan zero initializers. This should make DSA a bit faster.
llvm-svn: 11471
2004-02-15 05:53:42 +00:00
Chris Lattner
33ed4f9de9 Add support for a bunch more functions
llvm-svn: 11395
2004-02-13 21:21:48 +00:00
Chris Lattner
fbacee0077 Add support for fopen/fclose. Specifically with fopen, we were marking all of the
operands as incomplete, though fopen is known to only read them.  This just adds
fclose for symmetry, though it doesn't gain anything.  This makes the dsgraphs for
181.mcf much more precise.

llvm-svn: 11390
2004-02-13 20:05:32 +00:00
Chris Lattner
dd8e3f4208 Restructure code to handle memcpy/memmove
llvm-svn: 11374
2004-02-13 16:09:54 +00:00
Chris Lattner
ffd9c8a00b Cosmetic improvements to this option.
llvm-svn: 11331
2004-02-11 19:14:04 +00:00
Chris Lattner
66e7209785 Actually load profiling information now! Block layout can use real, live,
actual profile info, and works!  :)

llvm-svn: 11324
2004-02-11 18:21:05 +00:00
Chris Lattner
16ad30203c Fix a typeo
llvm-svn: 11323
2004-02-11 18:20:41 +00:00
Chris Lattner
36f91c80f4 Fix copy-and-pastos
llvm-svn: 11319
2004-02-11 06:10:18 +00:00
Chris Lattner
c456d0cbc7 Add skeleton profileinfoloader pass. This will be enhanced to actually LOAD
a profile tommorow.  :)

llvm-svn: 11318
2004-02-11 06:10:05 +00:00
Chris Lattner
427c8ee657 Factor this code out of llvm-prof
llvm-svn: 11314
2004-02-11 05:54:25 +00:00
Chris Lattner
c9900e2eb3 Make sure to register the 'no profile' implementation as the default for ProfileInfo
llvm-svn: 11309
2004-02-11 04:47:54 +00:00
Chris Lattner
f8077b7801 Simplify implementation, and probably speed things up too.
llvm-svn: 11308
2004-02-11 03:57:16 +00:00
Chris Lattner
a81258a786 An initial implementation of an LLVM ProfileInfo class which is designed to
eventually allow Passes to use profiling information to direct them.

llvm-svn: 11294
2004-02-10 22:11:42 +00:00
Chris Lattner
16690fad3d Adjust to the changed StructType interface. In particular, getElementTypes() is gone.
llvm-svn: 11228
2004-02-09 04:37:31 +00:00
Chris Lattner
838c2dd5af Add one that I missed
llvm-svn: 11179
2004-02-08 01:53:10 +00:00
Chris Lattner
cc1376078c Instead of callign removeTriviallyDeadNodes on the global graph every time
removeDeadNodes is called, only call it at the end of the pass being run.
This saves 1.3 seconds running DSA on 177.mesa (5.3->4.0s), which is
pretty big.  This is only possible because of the automatic garbage
collection done on forwarding nodes.

llvm-svn: 11178
2004-02-08 01:51:48 +00:00
Chris Lattner
e2ee216e1f Remove another unneeded call.
llvm-svn: 11177
2004-02-08 01:40:40 +00:00
Chris Lattner
85ba7bbf78 This call is no longer needed now that merging does not produce garbage
llvm-svn: 11176
2004-02-08 01:38:34 +00:00
Chris Lattner
32a3eb0b88 Substantially improve the DSA code by removing 'forwarding' nodes from
DSGraphs while they are forwarding.  When the last reference to the forwarding
node is dropped, the forwarding node is autodeleted.  This should simplify
removeTriviallyDead nodes, and is only (efficiently) possible because we are
using an ilist of dsnodes now.

llvm-svn: 11175
2004-02-08 01:27:18 +00:00
Chris Lattner
84ff796305 Bugfix for ilist conversion. The ilist wants to make an 'end' node which has
G == 0

llvm-svn: 11174
2004-02-08 01:05:37 +00:00
Chris Lattner
29067016a4 Switch the Nodes list from being an std::vector<DSNode*> to an ilist<DSNode>
llvm-svn: 11173
2004-02-08 00:53:26 +00:00
Chris Lattner
2c836fc933 Change to use node_iterators instead of direct access to Nodes
llvm-svn: 11171
2004-02-08 00:23:16 +00:00
Chris Lattner
6af67c7eb4 getNodes() is gone, use node_begin/end instead
Rename stats from dsnode -> dsa
Add a new stat

llvm-svn: 11167
2004-02-07 23:58:05 +00:00
Chris Lattner
ed36ca5f13 getNodes() is gone
llvm-svn: 11166
2004-02-07 23:57:26 +00:00
Chris Lattner
ce838bfae6 There is no need to clone over nodes that are going to be dead anyway
llvm-svn: 11157
2004-02-07 22:00:03 +00:00
Chris Lattner
ffc5eee17a In a "seeing the forest through the trees" kinda situation, I realized that a
complete rewrite of load-vn will make it a bit faster.  This changes speeds up
the gcse pass (which uses load-vn) from 25.45s to 0.42s on the testcase in
PR209.

I've also verified that this gives the exact same results as the old one.

llvm-svn: 11132
2004-02-05 17:20:00 +00:00
Chris Lattner
1a04f2a635 This is a big diff with no functionality change. We just reorder some code,
which causes big reindentation.  While I'm at it, I fix the fixme by removing
some dead code.

llvm-svn: 11131
2004-02-05 05:56:23 +00:00
Chris Lattner
7d5e3febb7 finegrainify namespacification
llvm-svn: 11130
2004-02-05 05:51:40 +00:00
Tanya Lattner
d7b137d9fb Fixed Chris' typo.
llvm-svn: 11128
2004-02-05 04:45:21 +00:00
Chris Lattner
b721589bc0 Implement optimizations for handling large basic blocks.
llvm-svn: 11126
2004-02-05 00:36:43 +00:00
Chris Lattner
89f03df701 Avoid referencing deleted DSgraphs when merging an SCC into a larger SCC. This
fixes the crash in 176.gcc.

llvm-svn: 11033
2004-01-31 21:02:18 +00:00
Chris Lattner
a497e3d6e1 Fix thinko
llvm-svn: 11027
2004-01-30 22:48:02 +00:00
Chris Lattner
0127841d4e Forward method request to chained aa implementation
llvm-svn: 11024
2004-01-30 22:20:55 +00:00
Chris Lattner
8bcdaf9b5d Implement the pointsToConstantMemory() method.
llvm-svn: 11022
2004-01-30 22:17:24 +00:00
Chris Lattner
71d05cef5e Improve mod/ref information based on the pointsToConstantMemory method.
llvm-svn: 11021
2004-01-30 22:16:42 +00:00
Misha Brukman
440d62207c Order #includes alphabetically, per style guide.
llvm-svn: 11015
2004-01-30 17:26:24 +00:00
Chris Lattner
dfa4f14e34 Fix a bug aflicting 265.gap
llvm-svn: 11006
2004-01-29 08:36:22 +00:00
Chris Lattner
caecd769c4 Minor bugfixes
llvm-svn: 11005
2004-01-29 03:32:15 +00:00
Chris Lattner
7ab2349541 Rename DSGraph::ScalarMapTy -> DSScalarMap
llvm-svn: 11001
2004-01-28 09:15:42 +00:00
Chris Lattner
9a79b1690c Fix a bug
llvm-svn: 11000
2004-01-28 03:31:34 +00:00
Chris Lattner
8324e48b84 Eliminate the call to removeTriviallyDeadNodes from updateFromGlobals graph,
moving it to the start of removeDeadNodes.  This speeds up DSA by 2s on perlbmk
from 41s

llvm-svn: 10999
2004-01-28 03:24:41 +00:00
Chris Lattner
92eb91ed70 In the TD pass, iterate over globals directly instead of through the whole scalar
map.  This saves 5s in the TD pass, from 22->17s on perlbmk

llvm-svn: 10998
2004-01-28 03:12:48 +00:00
Chris Lattner
c25a7dad97 In the TD pass, don't iterate over the scalar map to find the globals, iterate over
the globals directly.  This doesn't save any substantial time, however, because the
globals graph only contains globals!

llvm-svn: 10997
2004-01-28 03:07:30 +00:00
Chris Lattner
394c9343b4 In updateFromGlobalsGraph, instead of iterating over all of the scalars in the
function to find the globals, iterate over all of the globals directly.  This
speeds the function up from 14s to 6.3s on perlbmk, reducing DSA time from
53->46s.

llvm-svn: 10996
2004-01-28 03:03:06 +00:00
Chris Lattner
528f5842dd Minor tweaks, eliminate useless integer pruning optimziation, turn on
timers by default

llvm-svn: 10993
2004-01-28 02:41:32 +00:00
Chris Lattner
18e0615a69 Further reduce the number of nodes cloned with getClonedNH, using merge instead.
This reduces the number of nodes allocated, then immediately merged and DNE'd
from 2193852 to 1298049.  unfortunately this only speeds DSA up by ~1.5s (of
53s), because it's spending most of its time waddling through the scalar map :(

llvm-svn: 10992
2004-01-28 02:11:49 +00:00
Chris Lattner
6d38674f7b Add a timer, fix a minor bug.
Also, use RC::merge when possible, reducing the number of nodes allocated, then immediately merged away from 2985444 to 2193852 on perlbmk.

llvm-svn: 10991
2004-01-28 02:05:05 +00:00
Chris Lattner
10881df6e2 Another bugfix, disable "spurious" output.
You gotta love spurious

llvm-svn: 10990
2004-01-28 01:19:52 +00:00
Chris Lattner
b0d7b564dd fix bug in previous checkin
llvm-svn: 10989
2004-01-27 22:54:56 +00:00
Chris Lattner
3bd20c5114 * Add a new commandline argument to control the "global roots hack". Default
it to be off.  If it looks like it's completely unnecessary after testing, I
  will remove it completely (which is the hope).
* Callers of the DSNode "copy ctor" can not choose to not copy links.
* Make node collapsing not create a garbage node in some cases, avoiding a
  memory allocation, and a subsequent DNE.
* When merging types, allow two functions of different types to be merged
  without collapsing.
* Use DSNodeHandle::isNull more often instead of DSNodeHandle::getNode() == 0,
  as it is much more efficient.
*** Implement the new, more efficient reachability cloner class
    In addition to only cloning nodes that are reachable from interesting
    roots, this also fixes the huge inefficiency we had where we cloned lots
    of nodes, only to merge them away immediately after they were cloned.
    Now we only actually allocate a node if there isn't one to merge it into.
* Eliminate the now-obsolete cloneReachable* and clonePartiallyInto methods
* Rewrite updateFromGlobalsGraph to use the reachability cloner
* Rewrite mergeInGraph to use the reachability cloner
* Disable the scalar map scanning code in removeTriviallyDeadNodes.  In large
  SCC's, this is extremely expensive.  We need a better data structure for the
  scalar map, because we really want to scan the unique node handles, not ALL
  of the scalars.
* Remove the incorrect SANER_CODE_FOR_CHECKING_IF_ALL_REFERRERS_ARE_FROM_SCALARMAP code.
* Move the code for eliminating integer nodes from the trivially dead
  eliminator to the dead node eliminator.
* removeDeadNodes no longer uses removeTriviallyDeadNodes, as it contains a
  superset of the node removal power.
* Only futz around with the globals graph in removeDeadNodes if it is modified

llvm-svn: 10987
2004-01-27 22:03:40 +00:00
Chris Lattner
727e11ac33 Rewrite to use the reachability cloner interface. Also, make this much more
efficient in the case where a function calls into the same graph multiple times
(ie, it either contains multiple calls to the same function, or multiple calls
to functions in the same SCC graph)

llvm-svn: 10986
2004-01-27 21:53:14 +00:00
Chris Lattner
25f95d2b7c minor cleanups
llvm-svn: 10985
2004-01-27 21:51:19 +00:00
Chris Lattner
9117f221b1 Get clone flags right, so we don't build InlinedGlobals only to clear them
llvm-svn: 10984
2004-01-27 21:50:41 +00:00
Chris Lattner
6d2f67adb3 Initial support for implementing clonePartiallyInto in terms of cloneReachableSubgraph, though this support is currently disabled.
llvm-svn: 10970
2004-01-23 01:44:53 +00:00
Chris Lattner
a72f3a387a Eliminated the CompletedNodes argument to the cloneReachable* methods. This
map was only used to implement a marginal GlobalsGraph optimization, and it
actually slows the analysis down (due to the overhead of keeping it), so just
eliminate it entirely.

llvm-svn: 10955
2004-01-22 16:56:13 +00:00
Chris Lattner
50e765d1a2 Ok, I'm tired of pulling out all my timers to check stuff in, just do it.
llvm-svn: 10954
2004-01-22 16:36:28 +00:00
Chris Lattner
da04e4d383 Bug fix: X.mergeWith(Y) was not updating Y if Y was a null node handle!
llvm-svn: 10953
2004-01-22 16:31:08 +00:00
Chris Lattner
07d45564d0 Start implementing DSGraph::clonePartiallyInto and implement mergeInGraph
in terms of it.

Though clonePartiallyInto is not cloning partial graphs yet, this change
dramatically speeds up inlining of graphs with many scalars.  For example,
this change speeds up the BU pass on 253.perlbmk from 69s to 36s, because
it avoids iteration over the scalar map, which can get pretty large.

llvm-svn: 10951
2004-01-22 15:30:58 +00:00
Chris Lattner
961cc51cf1 Allow disabling of ALL printing overhead when performing timings
llvm-svn: 10948
2004-01-22 13:42:43 +00:00
Chris Lattner
c290310e9f Remove use of ConstantHandling itf
llvm-svn: 10781
2004-01-12 18:02:15 +00:00
Chris Lattner
a2612e417c Eliminate use of ConstantHandling itf
llvm-svn: 10780
2004-01-12 17:57:32 +00:00
Chris Lattner
d2ef2c91e8 Live var is now in lib/Target/Sparc
llvm-svn: 10735
2004-01-09 18:16:20 +00:00
Chris Lattner
103dabde37 Move sparc-specific code into lib/Target/Sparc
llvm-svn: 10734
2004-01-09 18:15:56 +00:00
Chris Lattner
1736f44b1d Improve encapsulation in the Loop and LoopInfo classes by eliminating the
getSubLoops/getTopLevelLoops methods, replacing them with iterator-based
accessors.

llvm-svn: 10714
2004-01-08 00:09:44 +00:00
Chris Lattner
8caf13292a Add a note
llvm-svn: 10617
2003-12-28 04:03:49 +00:00
Chris Lattner
099e1f16b8 rename ClassifyExpression -> ClassifyExpr
llvm-svn: 10592
2003-12-23 08:04:08 +00:00
Chris Lattner
5780f54596 Finegrainify namespacification
llvm-svn: 10588
2003-12-23 06:44:41 +00:00
Chris Lattner
b0c30fd90f finegrainify namespacification
Implement indvar analysis of getelementptr and sub expressions

llvm-svn: 10582
2003-12-22 05:26:29 +00:00
Chris Lattner
457dd0b6c7 Add a new AliassetTracker::remove method. Because we need to be able to remove
a pointer from an AliasSet, maintain the pointer values on a doubly linked
list instead of a singly linked list, to permit efficient removal from the
middle of the list.

llvm-svn: 10506
2003-12-18 08:11:56 +00:00
Alkis Evlogimenos
29127b8825 Change interface of MachineOperand as follows:
a) remove opIsUse(), opIsDefOnly(), opIsDefAndUse()
    b) add isUse(), isDef()
    c) rename opHiBits32() to isHiBits32(),
              opLoBits32() to isLoBits32(),
              opHiBits64() to isHiBits64(),
              opLoBits64() to isLoBits64().

This results to much more readable code, for example compare
"op.opIsDef() || op.opIsDefAndUse()" to "op.isDef()" a pattern used
very often in the code.

llvm-svn: 10461
2003-12-14 13:24:17 +00:00
Chris Lattner
a9d238d598 Finegrainify namespacification
Add capability to represent volatile AliasSet's
Propagate this information from loads&stores into the aliassets

llvm-svn: 10457
2003-12-14 04:52:11 +00:00
Chris Lattner
f9c24d19cf Factor out some duplicated code, implement the rest of the cases in
BasicAA/2003-12-11-ConstExprGEP.ll

llvm-svn: 10412
2003-12-11 23:20:16 +00:00
Chris Lattner
2185bd56cc Fix PR86. This makes basicaa _SIGNIFICANLY_ more aggressive with getelementptr's
llvm-svn: 10410
2003-12-11 22:44:13 +00:00
Chris Lattner
89c05af2e2 Finegrainify namespacification
Add new -print-cfg-only pass

llvm-svn: 10407
2003-12-11 21:48:18 +00:00
Chris Lattner
a1ddf56288 Fix a glaring bug
llvm-svn: 10400
2003-12-11 06:06:28 +00:00
Chris Lattner
3245f523d9 Realize the gep P, <zeros> must aliases P.
This is a partial fix for PR 86

llvm-svn: 10399
2003-12-11 06:02:00 +00:00
Chris Lattner
99253d6580 With Brian's change to AA.h we can now clean out this uglyness
llvm-svn: 10398
2003-12-11 05:44:59 +00:00