Commit Graph

793 Commits

Author SHA1 Message Date
Chris Lattner 40862c7578 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 e3f247bcac 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 d3e4d81ad7 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 90b9043ea5 finegrainify namespacification
llvm-svn: 11130
2004-02-05 05:51:40 +00:00
Tanya Lattner cb435541c4 Fixed Chris' typo.
llvm-svn: 11128
2004-02-05 04:45:21 +00:00
Chris Lattner 5bab6301ac Implement optimizations for handling large basic blocks.
llvm-svn: 11126
2004-02-05 00:36:43 +00:00
Chris Lattner 2f58ffc571 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 729ea9e1d9 Fix thinko
llvm-svn: 11027
2004-01-30 22:48:02 +00:00
Chris Lattner 4ab96324af Forward method request to chained aa implementation
llvm-svn: 11024
2004-01-30 22:20:55 +00:00
Chris Lattner f0eac5d0d3 Implement the pointsToConstantMemory() method.
llvm-svn: 11022
2004-01-30 22:17:24 +00:00
Chris Lattner 9605576a21 Improve mod/ref information based on the pointsToConstantMemory method.
llvm-svn: 11021
2004-01-30 22:16:42 +00:00
Misha Brukman 81804b4cb1 Order #includes alphabetically, per style guide.
llvm-svn: 11015
2004-01-30 17:26:24 +00:00
Chris Lattner 6c9861be68 Fix a bug aflicting 265.gap
llvm-svn: 11006
2004-01-29 08:36:22 +00:00
Chris Lattner c0f1e25c01 Minor bugfixes
llvm-svn: 11005
2004-01-29 03:32:15 +00:00
Chris Lattner 9412b70a4c Rename DSGraph::ScalarMapTy -> DSScalarMap
llvm-svn: 11001
2004-01-28 09:15:42 +00:00
Chris Lattner f30ae61683 Fix a bug
llvm-svn: 11000
2004-01-28 03:31:34 +00:00
Chris Lattner 68e4bb2b13 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 5e14d69d6b 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 461310139a 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 63c649a9fa 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 06a40fc140 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 9f0f7ca74e 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 6ee2b154d4 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 f6f97f9f90 Another bugfix, disable "spurious" output.
You gotta love spurious

llvm-svn: 10990
2004-01-28 01:19:52 +00:00
Chris Lattner 26acc890f9 fix bug in previous checkin
llvm-svn: 10989
2004-01-27 22:54:56 +00:00
Chris Lattner 54a52e53f0 * 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 070afeb77b 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 0e43b44c31 minor cleanups
llvm-svn: 10985
2004-01-27 21:51:19 +00:00
Chris Lattner b529730af0 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 78c36d2112 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 80f89ea522 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 5750d46ccd 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 2a0bc1224d 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 e75ae61b47 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 45fd9d59c0 Allow disabling of ALL printing overhead when performing timings
llvm-svn: 10948
2004-01-22 13:42:43 +00:00
Chris Lattner 85f325b544 Remove use of ConstantHandling itf
llvm-svn: 10781
2004-01-12 18:02:15 +00:00
Chris Lattner c99dd898af Eliminate use of ConstantHandling itf
llvm-svn: 10780
2004-01-12 17:57:32 +00:00
Chris Lattner 97390c21d3 Live var is now in lib/Target/Sparc
llvm-svn: 10735
2004-01-09 18:16:20 +00:00
Chris Lattner ae36879303 Move sparc-specific code into lib/Target/Sparc
llvm-svn: 10734
2004-01-09 18:15:56 +00:00
Chris Lattner 59d2d7fc33 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 5f4c6f55b6 Add a note
llvm-svn: 10617
2003-12-28 04:03:49 +00:00
Chris Lattner 30513e0a3a rename ClassifyExpression -> ClassifyExpr
llvm-svn: 10592
2003-12-23 08:04:08 +00:00
Chris Lattner 1e74843e7c Finegrainify namespacification
llvm-svn: 10588
2003-12-23 06:44:41 +00:00
Chris Lattner a86c4a3a01 finegrainify namespacification
Implement indvar analysis of getelementptr and sub expressions

llvm-svn: 10582
2003-12-22 05:26:29 +00:00
Chris Lattner 44fea5416d 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 aaba4639f8 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 0a14060ce2 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 1eed55d6b9 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 6ea17f77f8 Fix PR86. This makes basicaa _SIGNIFICANLY_ more aggressive with getelementptr's
llvm-svn: 10410
2003-12-11 22:44:13 +00:00
Chris Lattner 62aff8412a Finegrainify namespacification
Add new -print-cfg-only pass

llvm-svn: 10407
2003-12-11 21:48:18 +00:00
Chris Lattner 17790fbb5b Fix a glaring bug
llvm-svn: 10400
2003-12-11 06:06:28 +00:00
Chris Lattner bc1197f292 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 abb3bea6ce 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
Brian Gaeke b453bc5957 IncludeFile hack to pull in BasicValueNumbering whenever ValueNumbering.h
is included.

llvm-svn: 10397
2003-12-11 05:05:56 +00:00
Chris Lattner bff5116da6 Finegrainify namespacification
llvm-svn: 10367
2003-12-10 15:34:03 +00:00
Chris Lattner 8dee84159f Finegrainify namespacification
Provide a context module to WriteAsOperand

llvm-svn: 10366
2003-12-10 15:33:59 +00:00
Chris Lattner f9f7c2d302 Finegrainify namespacification
Move method out of generic dominators construction code

llvm-svn: 10299
2003-12-07 00:35:42 +00:00
Chris Lattner 567444309a Do not depend on index type to determine whether it is a structure or sequential index
llvm-svn: 10221
2003-11-25 20:19:55 +00:00
Chris Lattner a346e64218 Fix file header
llvm-svn: 10219
2003-11-25 20:11:47 +00:00
Chris Lattner c3de7c4ec2 Remove dead variable
llvm-svn: 10218
2003-11-25 20:11:00 +00:00
Chris Lattner 388bc98954 Use gep_type_begin/end instead of looking for ubytes
llvm-svn: 10217
2003-11-25 20:10:07 +00:00
Chris Lattner 359974801e Finegrainify namespacification
llvm-svn: 10210
2003-11-25 18:33:40 +00:00
Chris Lattner ab6895ea76 Implement a small optimization to handling of GEP's that are equivalent to casts.
This results in substantially reduced collapsing for some testcases

llvm-svn: 10002
2003-11-14 17:09:46 +00:00
Chris Lattner a8150c3f8d Trying to get the dsgraph for an external function is bad for DSA's health
llvm-svn: 9979
2003-11-13 18:48:11 +00:00
Chris Lattner baef234ce3 Implement the CompleteBU pass
llvm-svn: 9964
2003-11-13 05:05:41 +00:00
Chris Lattner 71d3377010 Minor code cleanup
llvm-svn: 9962
2003-11-13 05:04:19 +00:00
Chris Lattner fb4c057c4c Disable integer tracking by default
llvm-svn: 9960
2003-11-13 03:10:49 +00:00
Chris Lattner 04946381b9 Add an initial version of the CompleteBUDataStructures class, which is currently
identical to the BU pass, but has an accurate call graph

llvm-svn: 9956
2003-11-13 01:43:00 +00:00
Chris Lattner 9e876556fd Fine-grainify namespaces for this library
llvm-svn: 9948
2003-11-12 23:11:14 +00:00
Chris Lattner da03a8a792 Add new argument to disable checking
llvm-svn: 9922
2003-11-12 17:58:22 +00:00
Chris Lattner b740afb2b0 Print return nodes for graphs with multiple functions in them correctly
llvm-svn: 9914
2003-11-12 04:58:19 +00:00
Chris Lattner 12c71c00ef Don't crash if no gg
llvm-svn: 9913
2003-11-12 04:57:58 +00:00
Chris Lattner a9450bd4ac Cleanups
llvm-svn: 9907
2003-11-12 00:40:34 +00:00
Brian Gaeke 960707c335 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
Chris Lattner da05b05197 Compute node offsets correctly
llvm-svn: 9895
2003-11-11 20:12:32 +00:00
Chris Lattner fdc8d6547b Add new method for computing node mappings. This is used by the pool allocator
llvm-svn: 9880
2003-11-11 05:08:59 +00:00
Chris Lattner 9a010038f1 More additions
llvm-svn: 9834
2003-11-09 19:54:30 +00:00
Chris Lattner 950c75f135 Add more functions
llvm-svn: 9826
2003-11-09 04:10:41 +00:00
Chris Lattner 5011b956a9 None of the __llvm_* functions call into the program. This makes the
callgraph MUCH simpler for eh using program.

llvm-svn: 9825
2003-11-09 04:00:59 +00:00
Chris Lattner cff83a2f24 Add support for memmove
llvm-svn: 9824
2003-11-09 03:32:52 +00:00
Chris Lattner 12dd38aa99 Handle bzero and memset in the local analysis, because we were missing the fact
that memset returns its argument!!

llvm-svn: 9811
2003-11-08 21:55:50 +00:00
Chris Lattner 2cb1db763e This doesn't use DSCallSiteIterator
llvm-svn: 9809
2003-11-08 21:17:37 +00:00
Chris Lattner 5f6463c041 Fix name collision
llvm-svn: 9722
2003-11-05 05:55:45 +00:00
Chris Lattner 2b9926fc8e All DSGraphs keep a reference to the targetdata they are created with. This is
used to eliminate the hard coded, hacked in, sparc specific, global TargetData.
Changing the TargetData used to actually match the code fixes problems, and
eliminates a crash.

llvm-svn: 9659
2003-11-02 22:27:28 +00:00
Chris Lattner 53e8fab411 Fix bug: test/Regression/Analysis/DSGraph/2003-11-02-NodeCollapsing.ll
llvm-svn: 9658
2003-11-02 21:02:20 +00:00
Chris Lattner 7949bf0d54 Including the symbol table in the FindUsedTypes analysis was the WRONG way
to fix test/Regression/CBackend/2003-10-23-UnusedType.ll.  This completely
neutered the deadtypeelim pass.

llvm-svn: 9646
2003-11-02 01:28:41 +00:00
Chris Lattner 9c4a58b780 Make the call graph more precise despite the hated constantpointerrefs.
Do you detect the animosity I feel towards CPRs yet?

llvm-svn: 9640
2003-10-31 21:05:12 +00:00
Chris Lattner dd63f9e22b When someone includes CallGraph.h, make sure that they link in CallGraph.cpp
llvm-svn: 9611
2003-10-30 05:17:30 +00:00
Chris Lattner 54ac910a5c Fix PR62, and llvm/test/Regression/CBackend/2003-10-28-CastToPtrToStruct.ll
ConstantExpr's can use unrelated types, make sure to scan them.

llvm-svn: 9569
2003-10-28 23:09:45 +00:00
Chris Lattner fb8e19b7ca Fix bug: CBackend/2003-10-23-UnusedType.ll and hopefully 252.eon
llvm-svn: 9441
2003-10-23 19:30:30 +00:00
Chris Lattner 5987ab8677 This is a disgusting hack that improves code substantially, by making
callgraphSCC passes more effective.

llvm-svn: 9384
2003-10-22 18:53:31 +00:00
Chris Lattner ac4238f7bc Do not add unreachable code to a natural loop!
llvm-svn: 9377
2003-10-22 16:41:21 +00:00
Chris Lattner aa81dce20c Make sure to print labels on nodes without names
llvm-svn: 9376
2003-10-22 16:30:58 +00:00
Chris Lattner 9d63afdea5 If the basic block has no name, make sure to print the % number of it
llvm-svn: 9375
2003-10-22 16:22:42 +00:00
Chris Lattner a93d11bc1d Implement the Function::viewCFG* methods, for use in a debugger. Also, the
-print-cfg pass now lives here.

llvm-svn: 9374
2003-10-22 16:03:49 +00:00
John Criswell 29265fe981 Added LLVM copyright header.
llvm-svn: 9321
2003-10-21 15:17:13 +00:00
John Criswell 4436c49787 Added LLVM copyright notice to Makefiles.
llvm-svn: 9312
2003-10-20 22:26:57 +00:00
Chris Lattner dcd1466a80 Convert this code from using annotations to using a local map
llvm-svn: 9310
2003-10-20 20:52:23 +00:00
Chris Lattner 93fa46476b Remove using declaration
llvm-svn: 9307
2003-10-20 20:38:17 +00:00
John Criswell 482202a601 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