Commit Graph

1690 Commits

Author SHA1 Message Date
Chris Lattner
10673b63b0 Fix a problem exposed by the et-forest work. Load-vn needs these passes live
whenever it is live, not just when load-vn is computed initially


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25146 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-08 09:10:04 +00:00
Chris Lattner
ccacd3ccc2 Initial implementation of the ET-Forest data structure for dominators and
post-dominators.  This code was written/adapted by Daniel Berlin!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25144 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-08 08:22:18 +00:00
Chris Lattner
4983cf7321 Make the -print-alias-sets pass work for printing out something other than
the default aa impl results.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25062 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-03 06:05:22 +00:00
Chris Lattner
03839956e2 Separate the call graph implementation from its interface. This implements
the rough idea sketched out in http://nondot.org/sabre/LLVMNotes/CallGraphClass.txt,
allowing new spiffy implementations of the callgraph interface to be built.

Many thanks to Saem Ghani for contributing this!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24944 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 06:07:52 +00:00
John Criswell
61af913224 Prefix DSA specific options with dsa.
Make the dsa-alloc-list and dsa-free-list options hidden.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24864 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-19 20:14:38 +00:00
John Criswell
3075160664 Added an option to specify the names of heap freeing functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24863 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-19 19:54:23 +00:00
John Criswell
fa70052063 Added a command line option that allows the user to specify a list of
functions that allocate memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24862 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-19 17:38:39 +00:00
Sumant Kowshik
8a3802d5b2 Collapsing node if variable length struct with final field of length zero
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24621 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-06 18:04:30 +00:00
Chris Lattner
4b5086cc71 post-dom-frontiers requires proper post-dominance
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24409 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-18 07:28:26 +00:00
Andrew Lenharth
f6947c1bb8 prevent cse of readcyclecounter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24303 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-11 19:02:54 +00:00
Andrew Lenharth
51b8d54922 continued readcyclecounter support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24300 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-11 16:47:30 +00:00
Chris Lattner
df14a04b5c Fix a problem that Nate noticed with LSR:
When inserting code for an addrec expression with a non-unit stride, be
more careful where we insert the multiply.  In particular, insert the multiply
in the outermost loop we can, instead of the requested insertion point.

This allows LSR to notice the mul in the right loop, reducing it when it gets
to it.  This allows it to reduce the multiply, where before it missed it.

This happens quite a bit in the test suite, for example, eliminating 2
multiplies in art, 3 in ammp, 4 in apsi, reducing from 1050 multiplies to
910 muls in galgel (!), from 877 to 859 in applu, and 36 to 30 in bzip2.

This speeds up galgel from 16.45s to 16.01s, applu from 14.21 to 13.94s and
fourinarow from 66.67s to 63.48s.

This implements Transforms/LoopStrengthReduce/nested-reduce.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24102 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-30 06:24:33 +00:00
Chris Lattner
eb99bd30e9 remove a dead file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24085 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-29 04:43:38 +00:00
John Criswell
bd9d37026a Move some constant folding functions into LLVMAnalysis since they are used
by Analysis and Transformation passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24038 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-27 16:00:10 +00:00
John Criswell
a115643357 Move some constant folding code shared by Analysis and Transform passes
into the LLVMAnalysis library.
This allows LLVMTranform and LLVMTransformUtils to be archives and linked
with LLVMAnalysis.a, which provides any missing definitions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24036 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-27 15:54:34 +00:00
Chris Lattner
f941a0fe6c Remove this pass, it is not useful
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23949 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-24 02:35:43 +00:00
Chris Lattner
f36aeedaa3 DONT_BUILD_RELINKED is gone and implied by BUILD_ARCHIVE now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23940 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-24 02:26:13 +00:00
Chris Lattner
ab0ed3592b Only build .a file versions of these libraries, instead of .a and .o versions.
This should speed up build times.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23933 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-24 01:59:48 +00:00
Chris Lattner
83753937a6 don't bother building the archive version of this library
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23927 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-24 01:08:20 +00:00
Chris Lattner
4fb1b21b31 expose a ctor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23924 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-24 01:00:45 +00:00
Chris Lattner
6d796238b2 implement some prototypes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23920 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-24 00:38:38 +00:00
Chris Lattner
25d196880b move this to the analyze tool
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23918 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-24 00:27:36 +00:00
Chris Lattner
bed21de39b wrap a long line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23507 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 22:30:58 +00:00
Chris Lattner
b6a69e70e0 Add a new getLoopLatch() method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23315 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-12 17:03:55 +00:00
Chris Lattner
ab466d769a floor/ceil don't read/write memory. This allows gcse to eliminate 6 calls
in mesa.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23015 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-24 16:58:56 +00:00
Chris Lattner
ff2006aa74 Fix Transforms/LoopStrengthReduce/2005-08-15-AddRecIV.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22797 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-16 00:37:01 +00:00
Chris Lattner
db25de496c Teach LLVM to know how many times a loop executes when constructed with
a < expression, e.g.: for (i = m; i < n; ++i)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22793 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-15 23:33:51 +00:00
Chris Lattner
05bd374b1f Fix an obvious oops
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22742 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-10 00:59:40 +00:00
Chris Lattner
a0740fbcc7 implement two helper methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22736 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-09 23:36:33 +00:00
Misha Brukman
e2d7fdf62c * Unbreak optimized build (noticed by Eric van Riet Paap)
* Comment #endif clauses for readability


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22646 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-04 14:16:48 +00:00
Chris Lattner
b06f677c53 add support for Graphviz when viewing CFGs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22620 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-03 17:55:05 +00:00
Nate Begeman
36f891bdf6 Break SCEVExpander out of IndVarSimplify into its own .h/.cpp file so that
other passes may use it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22557 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-30 00:12:19 +00:00
Jeff Cohen
00b16889ab Eliminate all remaining tabs and trailing spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22523 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-27 06:12:32 +00:00
Andrew Lenharth
d3513e026b Remove glibc specific functions, and mark a couple as C99
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22384 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-11 20:35:20 +00:00
Andrew Lenharth
d9793e6c0a because on alpha:
#   define errno (*__errno_location ())

*shakes head


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22383 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-11 17:41:12 +00:00
Andrew Lenharth
c826aea982 the correct fix was to fix AliasAnalysis.getModRefInfo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22268 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-20 15:25:22 +00:00
Andrew Lenharth
e3e1739b7d prevent GCSE from forwarding stores to loads around vaarg. This is uggly, and I am trying to fix the AliasInfo, as it should catch the problem instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22266 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-20 15:02:05 +00:00
Andrew Lenharth
558bc88a00 core changes for varargs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22254 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-18 18:34:52 +00:00
Chris Lattner
42e3c81c5f By definition, 'tail' calls cannot access the stack frame of their caller.
Expose this as a simple form of mod/ref information.  This implements
BasicAA/tailcall-modref.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21796 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-08 23:58:12 +00:00
Chris Lattner
998fffdda1 These intrinsics do not access memory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21718 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-06 05:21:04 +00:00
Misha Brukman
f4f85998bf Remove extra blank line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21706 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-05 23:43:47 +00:00
Chris Lattner
eed37bad01 Add llvm.sqrt intrinsic, patch contributed by Morten Ofstad
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21627 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-30 03:44:07 +00:00
Chris Lattner
5b103c20e3 These functions can set errno!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21609 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-28 21:52:31 +00:00
Chris Lattner
318c149823 Make interval partition print correctly, patch contributed by
Vladimir Prus!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21566 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-26 14:48:28 +00:00
Chris Lattner
a1198b5254 Correctly handle global-argument aliases induced in main
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21537 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-25 19:16:31 +00:00
Chris Lattner
63320cc841 Don't mess up SCC traversal when a node has null edges out of it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21536 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-25 19:16:17 +00:00
Chris Lattner
cc1f24585e Propagate eq sets through the bu graphs to the cbu and eq graphs, fixing
a crash of the sfv on 188.ammp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21478 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-23 21:11:05 +00:00
Chris Lattner
3fe4d3cb5b Malloc/Free have mod/ref effects. Do not allow CSE of function calls that
call malloc/free.  This fixes PR555.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21443 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-22 05:36:59 +00:00
Misha Brukman
dedf2bd5a3 Convert tabs to spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21439 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-22 04:01:18 +00:00
Misha Brukman
fd93908ae8 Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21427 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-21 23:48:37 +00:00
Misha Brukman
2b37d7cf28 Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21416 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-21 21:13:18 +00:00
Chris Lattner
a5ed1bd00b add support for taking and resolving the address of free.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21396 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-21 16:09:43 +00:00
Chris Lattner
af2e3e0859 Fix a crash analyzing MultiSource/Benchmarks/MallocBench/gs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21245 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-12 03:59:27 +00:00
Chris Lattner
6128690c62 Don't make this require loopsimplify. It works BETTER with loop simplify
but should not require it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21123 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-06 21:45:00 +00:00
Chris Lattner
bd135c7706 do not crash when using -debug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21092 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-05 01:12:03 +00:00
Chris Lattner
8a9763c3cd do not dereference an extra layer of pointers to determine if an external
call can modify a memory location.  This fixes
test/Regression/Analysis/Andersens/modreftest.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21088 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-04 22:23:21 +00:00
Chris Lattner
1231aa3fa6 fix some VC compilation problems, thanks to Jeff C for pointing this out!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21044 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 20:17:09 +00:00
Chris Lattner
0700123431 EquivClassGraphs is now in DataStructure.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21042 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 20:08:17 +00:00
Chris Lattner
2ccc5f1081 use a callee_iterator typedef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21038 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 20:02:41 +00:00
Chris Lattner
021decc82d Change the ActualCallees callgraph from hash_multimap<Instruction,Function>
to std::set<std::pair<Inst,Func>> to avoid duplicate entries.

This speeds up the CompleteBU pass from 1.99s to .15s on povray and the
eqgraph passes from 1.5s to .16s on the same.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21031 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 19:17:18 +00:00
Chris Lattner
175b9635cc import all of the rest of the stubs that dsa uses for direct comparison
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20932 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 20:36:05 +00:00
Chris Lattner
77b505670c learn about some more functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20929 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 20:04:24 +00:00
Chris Lattner
9342a939eb Fix a problem where we not marking incoming arguments to functions with
external linkage as incomplete.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20927 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 19:16:59 +00:00
Chris Lattner
cfba7981eb there is no point comparing against null pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20925 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 17:44:52 +00:00
Chris Lattner
76bc5ce5c4 Fix a major problem with global variable initializers. This could cause
us to have stuff pointing to the null pointer, which makes no sense
(the null ptr is an ssa value, not the null object)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20922 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 17:21:53 +00:00
Chris Lattner
4de57fd9e9 add some more functions, ignore setcc for constraints!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20917 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 06:52:20 +00:00
Chris Lattner
8a44643d61 Handle "known" external calls context sensitively, add support for realloc
and a couple of other functions that are important.

Handle aggregate undef values for gv initializers


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20914 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 06:09:07 +00:00
Chris Lattner
f392c64ec6 Teach andersens that non-escaping memory cannot be mod/ref'd by external fn calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20891 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-28 06:21:17 +00:00
Misha Brukman
be5e2f4f9b Fix grammar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20890 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-28 04:32:12 +00:00
Chris Lattner
c3c9fd0dd6 Make anders-aa much more precise by not being completely pessimistic about
external functions.  Teach it about a few important ones.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20889 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-28 04:03:52 +00:00
Chris Lattner
493f6366cb wrap some long lines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20884 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-27 22:03:46 +00:00
Chris Lattner
93ab219244 remove ...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20883 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-27 21:57:09 +00:00
Chris Lattner
40ee8ce28b speed up steens by using spliceFrom, improve its precision by realizing that
an incomplete node cannot alias a complete node.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20882 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-27 21:56:55 +00:00
Chris Lattner
267a1b02a2 teach andersens about undef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20881 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-27 18:58:23 +00:00
Chris Lattner
5f4c0a88ee Don't give up completely, maybe other AA can say something about this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20873 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-27 00:02:33 +00:00
Chris Lattner
e70492d0e2 Factor out percentage printing into its own function. Make two changes to
the function: print more precision XX.X% instead of XX%, and cast to ULL
before scaling by 100/1000 to avoid wrap around for large numbers of queries
(such as occur for 253.perlbmk and 176.gcc)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20872 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-26 23:56:33 +00:00
Chris Lattner
1b9a2aac98 Cache mapping information for a call site after computing it for a mod/ref
query.  If the next mod/ref query happens to be for the same call site
(which is extremely likely), use the cache instead of recomputing the
callee/caller mapping.  This makes -aa-eval ***MUCH*** faster with
ds-aa


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20871 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-26 23:29:03 +00:00
Chris Lattner
a7337dc2b9 Remove more long dead code: dsa doesn't provide must alias info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20870 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-26 22:54:46 +00:00
Chris Lattner
5a6a9d4f0c remove some unsafe code that has long been dead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20869 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-26 22:48:42 +00:00
Chris Lattner
bc499de74f slightly improve mod/ref for DSAA by checking the globals graph for fallback
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20868 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-26 22:47:03 +00:00
Chris Lattner
b7523418b0 Teach steens-aa two things about mod/ref information:
1. If memory never escapes the program, it cannot be mod/ref'd by external
     functions.
  2. If memory is global never mod/ref'd in the program, it cannot be mod/ref'd
     by any call.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20867 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-26 22:43:20 +00:00
Chris Lattner
0772e78789 Interchange this loop so that we test all pointers against one call site
before moving on to the next call site.  This will be a more efficient way
to compute the mod/ref set for AA implementations like DSA.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20866 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-26 22:16:44 +00:00
Chris Lattner
cf9082589c no really, don't double count these nodes either!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20837 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-25 20:54:45 +00:00
Chris Lattner
0423e031d6 Don't count all of the nodes in the SCC once for each function in the SCC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20836 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-25 20:37:32 +00:00
Chris Lattner
33b4276053 Grow the EQ classes for globals at the end of the BU pass. This shrinks
memory usage in the TD pass for 254.gap from 31.3MB to 3.9MB.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20834 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-25 16:45:43 +00:00
Chris Lattner
2958eeabcf Treat free operations as volatile, since they cannot be moved. This fixes
Transforms/LICM/2005-03-24-LICM-Aggregate-Crash.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20830 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-25 05:49:37 +00:00
Chris Lattner
20da24c4b9 remove a debugging timer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20827 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-25 00:06:09 +00:00
Chris Lattner
b2dbdc1301 Two changes here:
1. Instead of copying Local graphs to the BU graphs to start with, use
     spliceFrom to do the job (which is constant time in this case).  On
     176.gcc, this chops off .17s from the bu pass.
  2. When building SCC graphs, simplify the logic and use spliceFrom to
     do the heavy lifting, instead of cloneInto/delete.  This slices
     another .14s off 176.gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20826 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-25 00:05:04 +00:00
Chris Lattner
ce7068d378 Make the spliceFrom case where one graph is completely empty be constant time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20825 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-25 00:02:41 +00:00
Chris Lattner
5734e4331e add a new DSGraph::spliceFrom method, which violently takes the content of
one graph and plops it into another, without breaking a sweat.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20824 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-24 23:46:04 +00:00
Chris Lattner
4da120e5d6 This replaces the correct but slow code with a more aggressive scc-finder
based approach to find globals and call sites that need to be copied.  This
speeds up the BU pass on 176.gcc from 22s back up to 2.3s.  Not as good
as 1.5s, but at least it's correct :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20820 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-24 23:06:02 +00:00
Chris Lattner
09adbbc99e only look at successors of globals. This gets us down to "only" 22s in the
bu pass for 176.gcc


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20818 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-24 21:17:27 +00:00
Chris Lattner
d8642125e4 Unfortunately, a previous patch was not safe. Revert it, reimplement
something correct. Unfortunately this takes 176.gcc's BU phase back
up to 29s from 1.5.  This fixes DSGraph/2005-03-24-Global-Arg-Alias.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20817 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-24 21:07:47 +00:00
Chris Lattner
0d397bd437 don't bother |'ing in 0's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20815 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-24 18:42:51 +00:00
Chris Lattner
d94b4d5b9c be more aggressive about incompleteness marking
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20814 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-24 18:42:28 +00:00
Chris Lattner
c5132e65a6 Fix a crash while promoting a value out of a loop from a global variable
when using ds-aa


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20802 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-24 04:22:04 +00:00
Chris Lattner
7d671b88e8 teach ds-aa about mod/ref for external function calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20801 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-24 03:04:50 +00:00
Chris Lattner
62da315c85 Simplify dead code into a fixme :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20800 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-24 02:41:19 +00:00
Chris Lattner
c4417f98e5 fix a compiler crash in runtime/libprofile
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20799 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-24 01:22:52 +00:00
Chris Lattner
f5eaf3c62c wrap a long line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20797 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-23 23:51:12 +00:00
Chris Lattner
ec6518ddc2 If we are calling an external function, chain to another AA to potentially
decide, don't just immediately give up.

This implements GlobalsModRef/chaining-analysis.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20796 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-23 23:49:47 +00:00
Chris Lattner
8cfd24df54 Make this more efficient by only making one virtual method call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20793 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-23 23:26:58 +00:00
Chris Lattner
d433bde071 Make this a bit more aggressive
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20792 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-23 22:06:41 +00:00
Chris Lattner
65512d2525 a hack to allow count-aa to work with ds-aa :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20791 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-23 21:59:34 +00:00
Chris Lattner
cf9f20189f Add two options to allow -count-aa to print queries either (1) all queries,
or (2) only queries that are not successful (e.g. return may alias)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20790 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-23 21:59:07 +00:00
Chris Lattner
c14f59cb72 turn a dead conditional into an assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20787 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-23 20:12:08 +00:00
Chris Lattner
e3f1d8a525 Totally gut mergeInGraph. There is absolutely no reason to be merging
global roots in from callees to callers.  The BU graphs do not have accurate
globals information and all of the clients know it.  Instead, just make sure
the GG is up-to-date, and they will be perfectly satiated.

This speeds up the BU pass on 176.gcc from 5.5s to 1.5s, and Loc+BU+TD
from 7s to 2.7s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20786 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-23 20:08:59 +00:00
Chris Lattner
eb39492deb wrap a long line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20785 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-23 16:43:11 +00:00
Chris Lattner
943814bb01 Make -steens-aa more conservative (aka correct) by making sure to obey
incompleteness flags.

Make it more aggressive by taking field sensitive information into
account.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20781 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-23 01:48:09 +00:00
Chris Lattner
2f72f9462b implement Analysis/DSGraph/field-sensitive.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20779 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-23 01:47:19 +00:00
Chris Lattner
1e9d1475bc Several changes here:
1. Increase max node size from 64->256 to avoid collapsing an important
   structure in 181.mcf
2. If we have multiple calls to an indirect call node with an indirect
   callee, fold these call nodes together, to avoid DSA turning apoc into
   a flaming fireball of death when analyzing 176.gcc.
  With this change, 176.gcc now takes ~7s to analyze for loc+bu+td, with
  5.7s of that in the BU pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20775 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-22 23:54:52 +00:00
Chris Lattner
9547adef58 Mark external globals incomplete in the BU Globals graph, fixing
Analysis/DSGraph/2005-03-22-IncompleteGlobal.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20773 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-22 22:10:22 +00:00
Chris Lattner
6ae7e9837c Directly count the number of memory instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20766 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-22 03:55:10 +00:00
Chris Lattner
a513fb127f Remove an iteration pass over the entire scalarmap for each function created
by not allowing integer constants to get into the scalar map in the first
place.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20764 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-22 02:45:13 +00:00
Chris Lattner
9308a35532 When making a clone of a DSGraph from the BU pass, make sure to remember that
this clone is supposed to be used for *ALL* of the functions in the SCC.

This fixes the memory explosion problem the TD pass was having, reducing the
memory growth from 24MB -> 3.5MB on povray and 270MB ->8.3MB on perlbmk!
This obviously also speeds up the TD pass *a lot*.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20763 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-22 01:50:42 +00:00
Chris Lattner
3bc703ba22 Don't use operator[], use the new method instead, which is faster. This speeds
up the TD pass about 30% for povray and perlbmk.  It's still not clear why
copying a 5MB set of graphs turns into a 25MB set of graphs though :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20762 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-22 01:42:59 +00:00
Chris Lattner
a2197139b5 Now that the dead ctor is gone, nothing uses the old node mapping exported by
cloneInto: make it an internally used mapping.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20760 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-22 00:36:51 +00:00
Chris Lattner
5805c426dc remove a dead ctor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20759 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-22 00:33:35 +00:00
Chris Lattner
d65145bd3d now that the second argument is always this->ReturnNodes, don't bother passing it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20758 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-22 00:29:44 +00:00
Chris Lattner
560af8aa97 instead of using a local RetValMap, just use the graph we are cloning into
for the return node map.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20757 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-22 00:25:52 +00:00
Chris Lattner
271d6884e3 now that the valuemapping is always the local scalar map, we can eliminate
this identity merge.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20755 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-22 00:22:45 +00:00
Chris Lattner
3c920fa861 remove the second argument to cloneInto
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20754 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-22 00:21:05 +00:00
Chris Lattner
24c47c5c45 add some timers, don't clone aux nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20752 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-22 00:12:00 +00:00
Chris Lattner
612f0b74d4 move this out of line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20751 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-22 00:09:45 +00:00
Chris Lattner
7080c3e54e don't generate temporary scalarmaps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20749 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-22 00:04:21 +00:00
Chris Lattner
f09ecffa0d allow passing clone flags down to cloneInto
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20748 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-21 22:49:53 +00:00
Chris Lattner
275b301740 Enhance the TD pass to build composite graphs when we have indirect call
sites that target multiple callees.  If we have a function table, for
example, with N callees, and M callers call through it, we used to have
to perform O(M*N) graph inlinings.  Now we perform O(M+N) inlinings.

This speeds up the td pass on perlbmk from 36.26s to 25.75s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20743 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-21 20:31:29 +00:00
Chris Lattner
b3439374ac make this const correct
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20741 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-21 20:28:50 +00:00
Chris Lattner
eb144f5e73 Fix a major problem where we didn't add call graph edges for call sites with
more than 1 callee.  This fixes Analysis/DSGraph/FunctionPointerTable-const.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20740 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-21 20:20:49 +00:00
Chris Lattner
c26f6d3899 Ugh, for some reason, I can't call this unless the reference is const!?!?!?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20732 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-21 10:00:45 +00:00
Chris Lattner
3f90a94c5d The reachability cloner should add arguments to merged calls when the RHS of
the merge has more operands than the LHS.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20731 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-21 09:39:51 +00:00
Chris Lattner
c2b94805fb 'note to self'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20727 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-21 08:43:32 +00:00
Chris Lattner
d57e55ec0d Change the way that the TD pass inlines graphs. Instead of inlining each
graph into all of the functions it calls when we visit a graph, change it so
that the graph visitor inlines all of the callers of a graph into the current
graph when it visits it.

While we're at it, inline global information from the GG instead of from each
of the callers.  The GG contains a superset of the info that the callers do
anyway, and this way we only need to do it one time (not one for each caller).

This speeds up the TD pass substantially on several programs, and there is
still room for improvement.  For example, the TD pass used to take 147s
on perlbmk, it now takes 36s.  On povray, we went from about 5s to 1.97s.
134.perl is down from ~1s for Loc+BU+TD to .6s.

The TD pass needs a lot of improvement though, which will occur with later
patches.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20723 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-21 04:55:35 +00:00
Chris Lattner
53491b3db7 Don't strip modref bits when inlining down the call graph. This fixes
the DSGraph/2003-06-30-TopDownResolve.ll regression from last night.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20717 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-20 18:02:56 +00:00
Chris Lattner
cc9bda6a41 Remove the ability to keep track of inlined globals, which is always dead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20716 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-20 04:30:30 +00:00
Chris Lattner
36474c923f This call is always a noop, remove it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20714 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-20 04:29:54 +00:00
Chris Lattner
bc6f966a44 remove some pointless asserts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20713 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-20 04:29:39 +00:00
Chris Lattner
5f75ff65bc -steens doesn't use the inlined globals facility.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20712 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-20 04:23:57 +00:00
Chris Lattner
9b426bdd81 Build EC's for globals twice. The first is after constructing the initial
Globals Graph for the local pass, the second is after all of the locals
graphs have been constructed.  This allows for many additional global EC's
to be recognized that weren't before.  This speeds up analysis of programs
like 177.mesa, where it changes DSA from taking 0.712s to 0.4018s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20711 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-20 03:32:35 +00:00
Chris Lattner
7cdf321256 Add a new DSNode::removeGlobal method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20710 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-20 03:29:54 +00:00
Chris Lattner
6b9eb35442 Transform BU pass to not use the horrible DSCallSiteIterator class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20708 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-20 02:42:07 +00:00
Chris Lattner
82c6c72862 Implement new methods for dealing with DSNode global lists, rename uses of
old methods.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20707 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-20 02:41:38 +00:00
Chris Lattner
2496d696f0 use simpler methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20706 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-20 02:41:16 +00:00
Chris Lattner
977b705d74 method was renamed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20705 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-20 02:40:27 +00:00
Chris Lattner
f5c7ad8949 print out equiv class info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20704 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-20 02:40:11 +00:00
Chris Lattner
bf30e7268c some methods got renamed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20703 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-20 02:40:04 +00:00
Chris Lattner
9454dda28a Make use of simpler DSNode methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20702 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-20 02:39:49 +00:00
Chris Lattner
1cee779cec #ifdef out a function only used by #ifdef'd code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20700 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-20 02:14:15 +00:00
Chris Lattner
48427b539f comment cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20699 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-20 01:18:00 +00:00
Chris Lattner
f4f6227989 Create an equivalence class of global variables that DSA will never be able
to tell apart anyway, and only track the leader for of these equivalence
classes in our graphs.

This dramatically reduces the number of GlobalValue*'s that appear in scalar
maps, which A) reduces memory usage, by eliminating many many scalarmap entries
and B) reduces time for operations that need to execute an operation for each
global in the scalar map.

As an example, this reduces the memory used to analyze 176.gcc from 1GB to
511MB, which (while it's still way too much) is better because it doesn't hit
swap anymore.  On eon, this shrinks the local graphs from 14MB to 6.8MB,
shrinks the bu+td graphs of povray from 50M to 40M, shrinks the TD graphs of
130.li from 8.8M to 3.6M, etc.

This change also speeds up DSA on large programs where this makes a big
difference.  For example, 130.li goes from 1.17s -> 0.56s, 134.perl goes
from 2.14 -> 0.93s, povray goes from 15.63s->7.99s (!!!).

This also apparently either fixes the problem that caused DSA to crash on
perlbmk and gcc, or it hides it, because DSA now works on these.  These
both take entirely too much time in the TD pass (147s for perl, 538s for
gcc, vs 7.67/5.9s in the bu pass for either one), but this is a known
problem that I'll deal with later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20696 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-19 22:23:45 +00:00
Chris Lattner
605a87cc19 Switch to use the new interface for the EquivalenceClasses class, and fix
a bug involving SCC's who have multiple members that are part of an EC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20678 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-19 05:15:27 +00:00
Chris Lattner
5021b8c2d6 do not bother inlining nullary functions without return values. The only
effect these calls can have is due to global variables, and these passes
all use the globals graph to capture their effect anyway.  This speeds up
the BU pass very slightly on perlbmk, reducing the number of dsnodes
allocated from 98913 to 96423.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20676 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-18 23:19:47 +00:00
Chris Lattner
db7436aae8 fix a bogus assertion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20675 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-18 23:18:30 +00:00
Chris Lattner
0c9707a190 another fastpath
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20674 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-18 23:18:20 +00:00
Chris Lattner
41b162faba expose this pass to both opt and analyze
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20672 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-18 05:27:57 +00:00
Chris Lattner
4707b895b6 remove a bogus optimization. This only works if there are no globals in the
graph, and the combination of a function that does not reference globals, takes
not arguments and returns no value is pretty rare.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20670 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-18 00:23:59 +00:00
Chris Lattner
511f60c707 Rewrite DSAA::getModRefInfo to compute the mapping between caller and callee
to determine mod/ref behavior, instead of creating a *copy* of the caller
graph and inlining the callee graph into the copy.

This speeds up aa-eval on Ptrdist/yacr2 from 109.13s to 3.98s, and gives
identical results.  The speedup is similar on other programs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20669 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-18 00:21:03 +00:00
Chris Lattner
4ffe5d8038 implement a new method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20668 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-17 23:45:54 +00:00
Chris Lattner
1c8327bd50 add some possibly bogus assertions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20665 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-17 20:33:27 +00:00
Chris Lattner
ddc77c458a Do not include the Function* for direct call/invoke instructions in the
alias evaluation.  Clients really don't care.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20664 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-17 20:25:04 +00:00
Chris Lattner
50cb9b40c2 simplify this function a bit, allow DS-AA to build on/improve the mod/ref
results returned by AA, not just use one or the other.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20662 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-17 20:16:58 +00:00
Chris Lattner
94f8470fe3 Clean up some code, handle null pointer specially to avoid an assertion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20660 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-17 19:56:56 +00:00
Chris Lattner
2e2cce69bc Two changes:
1. Chain to the parent implementation of M/R analysis if we can't find
     any information.  It has some heuristics that often do well.
  2. Do not clear all flags, this can make invalid nodes by turning nodes
     that used to be collapsed into non-collapsed nodes (fixing crashes)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20659 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-17 19:56:18 +00:00
Chris Lattner
5b3a4553c1 Fix the missing symbols problem Bill was hitting. Patch contributed by
Bill Wendling!!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20649 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-17 15:38:16 +00:00
Chris Lattner
ec3f5c4fd7 Do not create ridiculously huge DSNodes, as described in the comments.
This speeds up the BU pass on 172.mgrid from 62.3 -> 0.1242s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20648 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-17 05:25:34 +00:00
Chris Lattner
84b80a214a remove use of compat_iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20643 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-16 22:42:19 +00:00
Chris Lattner
38065a7e01 make sure to mark nodes in the globals graph incomplete after computing it
so that external globals (and whatever they point to) are marked incomplete.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20628 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 22:47:18 +00:00
Chris Lattner
49e88e80c7 fix crashes when we only have a prototype for main.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20627 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 22:10:04 +00:00
Chris Lattner
4d5af8e894 Fix a crash that happens when mapping something like this:
{ short, short }

to
  short

where the second short maps onto the second field of the first struct.  In
this case, the struct index is not aligned, so we should avoid calling
getLink(2), which asserts out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20626 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 21:36:50 +00:00
Chris Lattner
36a13cdeea Make computeGGToGMapping compute an invnodemap
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20622 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 17:52:18 +00:00
Chris Lattner
2af8c5185a Finally fix (the right way) the problem where functions like this:
void foo() {
  G = 1;
}

would have an empty DSGraph even though G (a global) is directly used
in the function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20619 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 17:14:09 +00:00
Chris Lattner
a5f47ea23d Start using retnodes_* for iteration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20618 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 16:55:04 +00:00
Chris Lattner
5d85f8f66e avoid varialbe name collisions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20606 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 06:29:12 +00:00
Chris Lattner
e4d5c441e0 This mega patch converts us from using Function::a{iterator|begin|end} to
using Function::arg_{iterator|begin|end}.  Likewise Module::g* -> Module::global_*.

This patch is contributed by Gabor Greif, thanks!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20597 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 04:54:21 +00:00
Chris Lattner
841957ebaf Don't crash if computing a mapping to a node with zero size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20595 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 04:40:24 +00:00
Chris Lattner
b0f92e3ed3 rename method, add counterpart
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20593 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 00:58:16 +00:00
Chris Lattner
b2b17bb65b add a method to compute a commonly used mapping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20588 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-14 19:22:47 +00:00
Chris Lattner
e2bc7b2517 regardless of whether or not the client things we should mark globals incomplete,
ALWAYS mark them incomplete if they are external!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20586 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-13 20:36:01 +00:00
Chris Lattner
270cf5025e Make sure to remove incomplete markers before we add to them! :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20585 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-13 20:32:26 +00:00
Chris Lattner
b5ecd2e378 The incoming arguments to main (the argv list) are not complete!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20584 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-13 20:22:10 +00:00
Chris Lattner
a66e353cf9 After finishing BU analysis, move all global variables from the globals
graph into main and mark them complete.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20583 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-13 20:15:06 +00:00
Chris Lattner
adfd5f14b4 ADd support for printing eqgraphs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20582 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-13 19:51:24 +00:00
Chris Lattner
2787e03d0e Replace linear search with logrithmic one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20580 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-13 19:05:05 +00:00
Chris Lattner
a4319e5826 make sure to mark nodes returned from functions as incomplete
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20576 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-12 14:58:28 +00:00
Chris Lattner
b25959a632 remove this from the PA namespace, leaving it in the llvm ns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20574 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-12 12:08:52 +00:00
Chris Lattner
7aed7179bd Move this from the pool allocator project to here, where it logically belongs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20570 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-12 11:51:30 +00:00
Chris Lattner
50bc9ef507 Fix Regression/Analysis/BasicAA/2005-03-09-BrokenBasicAA.ll, a miscompilation
that Alkis found with Java, thanks Alkis!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20531 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-09 16:29:52 +00:00
Chris Lattner
bac5b46396 Export two methods for getting -X and A-B.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20527 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-09 05:34:41 +00:00
Chris Lattner
3267265d78 Make sure the two arguments of a setcc instruction point to the same node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20462 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-05 19:04:31 +00:00
Chris Lattner
f57cc3b7e2 Trivial cleanup patch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20436 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-04 20:27:46 +00:00
Chris Lattner
f8db8a0432 Fix spelling, patch contributed by Gabor Greif
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20342 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-27 06:15:51 +00:00
Chris Lattner
7192e501eb DCE a dead function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20339 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-26 23:36:45 +00:00
Chris Lattner
7ffc07dcf7 1 + 100 + 51 == 152, not 52.
If we fold three constants together (c1+c2+c3), make sure to keep
LHSC updated, instead of reusing (in this case), the 1 instead of the
partial sum.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20337 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-26 18:50:19 +00:00
Chris Lattner
6e84bd7d59 Handle null a bit more carefully.
Actually teach dsa about select instructions.  This doesn't affect the
graph in any way other than not setting a spurious U marker on pointer
nodes that are selected.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20324 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-25 01:27:48 +00:00
Chris Lattner
753b113cdf This instruction:
X = gep null, ...

Used to not create a scalar map entry for X, which caused clients to barf.
This is bad.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20316 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-24 19:55:31 +00:00
Chris Lattner
d7642c4f2d Fix a bug introduced by revision 1.187 of this file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20308 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-24 18:48:07 +00:00
Chris Lattner
13d0108666 Remove use of bind_obj, deleter, and finegrainify namespacification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20277 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-22 23:27:21 +00:00
Chris Lattner
2352fec205 Scary typo that fixes Regression/Transforms/IndVarsSimplify/2005-02-17-TruncateExprCrash.ll
and PR515.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20224 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-17 16:54:16 +00:00
Chris Lattner
7a0c775044 Add a sanity check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20195 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-15 18:48:48 +00:00
Chris Lattner
d672ab936f Add a new method to make it easy to update graphs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20194 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-15 18:40:55 +00:00
Chris Lattner
4dc534c7fe Correct the recursive PHI node handling routines in a way that CANNOT induce
infinite loops (using the new replaceSymbolicValuesWithConcrete method).

This patch reverts this patch:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050131/023830.html

... which was an attempted fix for this problem.  Unfortunately, that patch
caused test/Regression/Transforms/IndVarsSimplify/exit_value_tests.llx to fail
and slightly castrated the entire analysis.  This patch fixes it right.

This patch is dedicated to jeffc, for making me deal with this.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20146 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-13 04:37:18 +00:00
Chris Lattner
6be079491f Use new edge iterators to simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20086 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-09 03:20:43 +00:00
Chris Lattner
bcc70bcb25 IndCallGraphMap is now a pointer to a new'd map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20065 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-07 16:09:15 +00:00
Chris Lattner
86db364f02 If we have an indirect call site that calls N functions, inline the N functions
into a temporary graph, remember it for later, then inline the tmp graph into
the call site.

In the case where there are other call sites to the same set of functions, this
permits us to just inline the temporary graph instead of all of the callees.

This turns N*M inlining situations into an N+M inlining situation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20036 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-04 19:59:49 +00:00
Chris Lattner
e859444a91 Split mergeInGraph into two methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20035 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-04 19:58:28 +00:00
Chris Lattner
d7be188323 Fix the Regression/Transforms/DSAnalysis/recursion.ll regression.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20031 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-04 18:58:04 +00:00
Chris Lattner
bb753c4f80 Refactor getFunctionArgumentsForCall out of mergeInGraph.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20018 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-03 18:40:25 +00:00
Chris Lattner
269dbf5f5e Eliminate some duplicated debug code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19980 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 21:55:40 +00:00
Chris Lattner
20cd136c5d Eliminate self-recursion as a special case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19979 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 21:49:43 +00:00
Chris Lattner
af8650e9c7 Eliminate use of DSCallSiteIterator in key loop. This is a half step to
a tasty speedup.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19978 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 21:37:27 +00:00
Chris Lattner
1e759999ca Signficantly speed up printing by not emitting the same file twice with
different names.  Large SCC's tend to be big, so this saves a lot of time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19970 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 19:10:48 +00:00
Chris Lattner
f189bcec00 Do not revisit nodes in the SCC traversal. This speeds up the BU pass a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19968 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 17:35:52 +00:00
Chris Lattner
caa7c19fb4 Fix a problem where we could infinitely recurse on phi nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19955 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 00:18:30 +00:00
Chris Lattner
f9aace20fb Rename variables to work with VC++'s hokey scoping rules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19942 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-31 00:10:58 +00:00
Chris Lattner
cff8ac20ca Fix some scary bugs that VC++ detected.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19941 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-31 00:10:45 +00:00
Chris Lattner
6538f42208 Make things more const-correct, adjust to changes in DSA interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19940 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-30 23:51:25 +00:00
Chris Lattner
a9548d9fd9 * Make some methods more const correct.
* Change the FunctionCalls and AuxFunctionCalls vectors into std::lists.
  This makes many operations on these lists much more natural, and avoids
  *exteremely* expensive copying of DSCallSites (e.g. moving nodes around
  between lists, erasing a node from not the end of the vector, etc).

With a profile build of analyze, this speeds up BU DS from 25.14s to
12.59s on 176.gcc.  I expect that it would help TD even more, but I don't
have data for it.

This effectively eliminates removeIdenticalCalls and children from the
profile, going from 6.53 to 0.27s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19939 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-30 23:51:02 +00:00
Chris Lattner
3725c12b26 Due to previous simplifications, we can simplify the data structures being
used here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19913 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 07:04:10 +00:00
Chris Lattner
ee379a16ee Properly handle volatile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19912 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 06:42:34 +00:00
Chris Lattner
4f16bd7a74 Remove some useless map operations. Loads/stores that are in the same
BB as the load are not included in the Cand* sets at all.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19911 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 06:39:25 +00:00
Chris Lattner
15774df4d3 Before doing expensive global analysis, check to make sure the pointer is
not invalidated on entry and on exit of the block.  This fixes some N^2
behavior in common cases, and speeds up gcc another 5% to 22.35s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19910 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 06:31:53 +00:00
Chris Lattner
e212d62a34 Minor simplification/speedup. Replaces a set lookup with a pointer comparison.
This speeds up 176.gcc from 25.73s to 23.48s, which is 9.5%


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19907 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 06:20:55 +00:00
Chris Lattner
e233b8c64b Eliminate generality that is not buying us anything. In particular, this
will cause us to miss cases where the input pointer to a load could be value
numbered to another load.  Something like this:


  %X = load int* %P1
  %Y = load int* %P2

Those are obviously the same if P1/P2 are the same.  The code this patch
removes attempts to handle that.  However, since GCSE iterates, this doesn't
actually buy us anything: GCSE will first replace P1 or P2 with the other
one, then the load can be value numbered as equal.

Removing this code speeds up gcse a lot.  On 176.gcc in debug mode, this
speeds up gcse from 29.08s -> 25.73s, a 13% savings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19906 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 06:11:16 +00:00
Chris Lattner
2652da6af9 If we see:
%A = alloca int
  %V = load int* %A

value number %V to undef, not 0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19905 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 05:57:01 +00:00
Chris Lattner
9cb992ab72 Remove this code as it is currently completely broken and unmaintained.
If needed, this can be resurrected from CVS.

Note that several of the interfaces (e.g. the IPModRef ones) are supersumed
by generic AliasAnalysis interfaces that have been written since this code
was developed (and they are not DSA specific).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19864 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-28 06:12:46 +00:00
Chris Lattner
851b534b89 Make -ds-aa more useful, allowing it to be updated as xforms hack on the program.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19818 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-24 20:00:14 +00:00
Chris Lattner
507bdf9488 Silence VC++ warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19506 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-12 04:51:37 +00:00
Jeff Cohen
6e400f76e6 Apply feed back from Chris:
1. Rename createLoaderPass to CreateProfileLoaderPass
  2. Opt shouldn't use the pass registered in CodeGen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19431 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-10 03:56:27 +00:00
Jeff Cohen
1d7b5de7ee Add last four createXxxPass functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19424 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-09 20:42:52 +00:00
Jeff Cohen
2611dd4448 Get lib/Analysis/DataStructure to compile with VC++
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19412 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-09 04:18:28 +00:00
Jeff Cohen
534927d82d Add even more missing createXxxPass functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19402 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-08 22:01:16 +00:00
Misha Brukman
4d099f7d6c Wrap at 80 cols
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19121 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-23 21:17:41 +00:00
Reid Spencer
1e296bf046 Try to speed up gccld hot spot in BasicVN::getEqualNumberNodes by making
a function call at the core of the loop inline and removing unused
stack variables from an often called function. This doesn't improve things
much, the real saving will be by reducing the number of calls to this
function (100K+ when linking kimwitu++).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19119 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-23 21:13:26 +00:00
Chris Lattner
41925f87d3 Actually overload the virtual method. This fixes
Regression/Analysis/GlobalsModRef/purecse.ll.  Isn't this what the
-Woverload-whatever flag would warn about :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19018 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-17 17:12:24 +00:00
Chris Lattner
fd4b3c4774 Eliminate a virtual method call
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18964 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-15 18:14:04 +00:00
Chris Lattner
5226f6a901 Fix a bug in -no-aa that caused two DSGraph tests to XPASS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18962 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-15 17:13:24 +00:00
Chris Lattner
0af024c5d0 Adjust to new alias analysis interfaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18957 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-15 07:22:13 +00:00
Alkis Evlogimenos
c49741d047 Add testcase and fix for yet another case where we query the size an
abstract type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18678 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-08 23:56:15 +00:00
Alkis Evlogimenos
a95cf3024b Add testcase and fix for another case where we query the size an
abstract type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18676 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-08 23:42:11 +00:00
Chris Lattner
b29dd0ff2b Move method out of line for better ICC support
Add some ifdefs for some stuff I like to be able to toggle easily


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18665 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-08 21:03:56 +00:00
Chris Lattner
2c20ef506f Properly extern this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18664 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-08 21:00:59 +00:00
Chris Lattner
fe781654a3 Work correctly with ICC, Patch contributed by Bjørn Wennberg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18630 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-08 16:22:26 +00:00
Reid Spencer
4a7ebfa411 For PR387:\
Add getModRefInfo method to avoid overloaded virtuals


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18601 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-07 08:11:24 +00:00
Reid Spencer
ce9653ce44 For PR387:\
Make only one print method to avoid overloaded virtual warnings when \
compiled with -Woverloaded-virtual


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18589 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-07 04:03:45 +00:00
Chris Lattner
6a1a78a478 This patch prevents an infinite recursion while compiling 103.su2cor.
All SPEC CFP 95 programs now work, though the JIT isn't loading -lf2c right
so they aren't testing correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18499 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-04 20:54:32 +00:00
Chris Lattner
eaf8f9c667 Fix DeadStoreElimination/2004-11-28-LiveStoreDeleted.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18308 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-28 20:30:15 +00:00
Chris Lattner
cc8d524a24 When merging to alias sets, if they are both must alias, the result is not
a must alias set unless all of the pointers in the resultant set are must
aliased together.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18275 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-27 18:37:42 +00:00
Chris Lattner
07bfa52405 Add a new interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18266 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-26 21:36:25 +00:00
Chris Lattner
1ed80b66b1 When evaluating an AA, pass in size info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18264 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-26 21:05:39 +00:00
Chris Lattner
4e61676b56 The trick with globals actually works with allocas and malloc too
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18262 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-26 20:01:48 +00:00
Chris Lattner
0a1ac907c3 A store or load cannot alias a global if the accessed amount is larger then
the global.

This implements Regression/Analysis/BasicAA/global-size.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18261 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-26 19:20:01 +00:00
Chris Lattner
3fb2045c7c Mission accomplished!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17990 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-19 16:22:24 +00:00
Chris Lattner
bc2a99b480 Simplify conditional and fix LICM/2004-11-17-UndefIndexCrash.ll
by saying what we mean


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17913 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-17 17:39:39 +00:00
Reid Spencer
e26057a376 Standardize on 'class' instead of 'struct'. Gets rid of warnings in VC++
Patch contributed by Jeff Cohen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17889 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 06:58:55 +00:00
Chris Lattner
04252fed78 Make this build in release mode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17684 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-11 22:11:17 +00:00
Chris Lattner
ac6d4854e1 Fix a bug that was preventing povray and namd from pool allocating correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17632 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-08 21:08:46 +00:00
Chris Lattner
beacefae61 Handle assert_fail special
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17631 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-08 21:08:28 +00:00
Chris Lattner
53fe2beb01 Remove dead var
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17485 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-05 04:52:08 +00:00
Chris Lattner
82962de3b9 Don't call Constant::getNullValue when the argument could be VoidTy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17457 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-03 18:51:26 +00:00
Chris Lattner
f1de30acce Graphs that are part of equivalence sets can be multi-function SCC's
themselves.  Make sure to update DSInfo correctly.  This fixes a testcase
reduced from Prolangs-C++/objects


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17439 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-02 20:31:06 +00:00
Chris Lattner
caa35bc0b6 Correctly handle new SCC's found as a result of merging EQ graphs do to
function pointer equivalences.  This fixes many problems, including a testcase
reduced Prolangs-C++/objects.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17437 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-02 19:29:59 +00:00
Chris Lattner
033a7d5389 Substantially cleanup/speedup the eq graphs pass by walking the callgraph
a DSGraph at a time instead of a function at a time.  This is also more
correct, though it doesn't seem to fix any programs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17435 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-02 17:51:11 +00:00
Chris Lattner
983baf472f Minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17428 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-02 06:38:58 +00:00
Chris Lattner
4457f7ea46 Remove more dead methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17413 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-01 21:07:05 +00:00
Chris Lattner
fcb7d950bc Rename FoldedGraph -> DSInfo to be consistent with other passes
delete some dead methods


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17410 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-01 21:02:23 +00:00
Chris Lattner
77408b8987 Get rid of the EquivClassGraphArgsInfo class, and the map that held it.
We only need one instance of the vector that it contains at a time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17407 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-01 20:37:00 +00:00
Chris Lattner
68f9658fcb Eliminate the cloneGraph method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17405 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-01 19:54:06 +00:00
Chris Lattner
31d3f671be * Do not refer to ActualCallees in CBU, when we can do it locally.
* *DO NOT* print CBU graphs when asked to print our own.  This is just
  FREAKING confusing and misleading: it's better to not print anything.
* Simplify and clean up some code
* Add some more paranoia assertion checking code that I found to track
  down this bug:
* Fix a nasty bug that was causing us to crash on Prolangs-C++/objects,
  where we were missing processing some graphs.  This hunk is the bugfix:

-    if (!I->isExternal() && !FoldedGraphsMap.count(I))
+    if (!I->isExternal() && !ValMap.count(I))

  urg!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17386 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-31 23:41:26 +00:00
Chris Lattner
4bbf3dfbe6 Simplify graph traversal, improve grammar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17383 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-31 23:01:34 +00:00
Chris Lattner
ab8544aa75 Do not do horrible things to the CBU graphs. In particular, we do NOT own
the CBU graphs, copy them instead of hacking on the CBU graphs.

Also, instead of forwarding request from ECGraphs clients to the CBU graphs
clients, service them ourselves.

Finally, remove a broken "optimization"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17378 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-31 21:56:11 +00:00
Chris Lattner
3b7b81b814 Fix comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17377 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-31 21:54:51 +00:00
Chris Lattner
e84c23e0c1 Improve comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17375 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-31 19:57:43 +00:00
Chris Lattner
f498568240 Fix another bug in Prolangs-C++/objects
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17372 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-31 18:13:19 +00:00
Chris Lattner
113cde8685 Only call getNodeForValue on pointer arguments! this fixes a problem running
on Prolangs-C++/objects


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17368 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-31 17:47:48 +00:00
Chris Lattner
7d8d4711d9 Add more paranoid assertions :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17367 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-31 17:45:40 +00:00
Chris Lattner
f1bd4b4215 Fix some more problems where we called getOffset before getNode()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17358 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-30 07:21:19 +00:00
Chris Lattner
857eb0697f Fix three bugs:
1. Calls to external global VARIABLES should not be treated as a call to an
    external function
 2. Efficiently deleting an element from a vector by using std::swap with
    the back, then pop_back is NOT a good way to keep the vector sorted.
 3. Our hope of having stuff get deleted by making them redundant just won't
    work.  In particular, if we have three calls in sequence that should be
    merged: A, B, C   first we unify B into A.  To be sure that they appeared
    identical (so B would be erased) we set B = A.  On the next step, we
    unified C into A and set C = A.  Unfortunately, this is no guarantee that
    C = B, so we would fail to delete the dead call.  Switch to a more
    explicit scheme.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17357 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-30 05:41:23 +00:00
Chris Lattner
62c3a95051 Fix more undefined behavior
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17356 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-30 04:22:45 +00:00
Chris Lattner
6f96774fc4 * Add a method
* change some uses of NH.getNode() in a bool context to use !NH.isNull()
* Fix a bunch of places where we depended on the (undefined) order of
  evaluation of arguments to function calls to ensure that getNode() was
  called before getOffset().  In practice, this was NOT happening.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17354 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-30 04:05:01 +00:00
Alkis Evlogimenos
002242149f Fix library name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17306 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-28 05:36:48 +00:00
Reid Spencer
6cb21d443e Change Library Names Not To Conflict With Others When Installed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17286 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-27 23:18:45 +00:00
Chris Lattner
1fca5ff62b Convert 'struct' to 'class' in various places to adhere to the coding standards
and work better with VC++.  Patch contributed by Morten Ofstad!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17281 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-27 16:14:51 +00:00
Chris Lattner
48b2f6ba2e add support for UndefValue
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17260 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-26 16:23:03 +00:00
Chris Lattner
219c141815 Patch to support MSVC, contributed by Morten Ofstad
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17214 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-25 18:40:08 +00:00
Reid Spencer
cac731ecbe We won't use automake
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17155 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-22 03:35:04 +00:00
Reid Spencer
86d341b204 Initial automake generated Makefile template
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17136 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-18 23:55:41 +00:00
Chris Lattner
ec7c1ab1da Add support for unreachable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17056 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-16 18:21:33 +00:00
Chris Lattner
bd1d382cc4 Add support for undef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17055 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-16 18:19:26 +00:00
Chris Lattner
c17edbdeeb Add support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17052 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-16 18:16:19 +00:00
Chris Lattner
a35339dfb6 Be more careful about looking for constants when we really want constantint's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17029 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-16 16:07:10 +00:00
Chris Lattner
979c38ba20 Do not use the same variable name for two different variables in the
same scope.  This confused VC++ (and probably people too!).  Patch by
Morten Ofstad!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16985 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-14 14:59:16 +00:00
Reid Spencer
d96cb6eaa0 Update to reflect changes in Makefile rules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16950 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-13 11:46:52 +00:00
Chris Lattner
15d879e139 Minor cleanups:
* fit in 80 lines
 * Eliminate extra namespaces
 * Drop llvm::


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16935 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-12 16:52:09 +00:00
Chris Lattner
673e02b0c3 This nutty patch has been in my tree since before 1.3 went out, and it needs
to go in.  This patch allows us to compute the trip count of loops controlled
by values loaded from constant arrays.  The cannonnical example of this is
strlen when passed a constant argument:

for (int i = 0; "constantstring"[i]; ++i) ;
return i;

In this case, it will compute that the loop executes 14 times, which means
that the exit value of i is 14.  Because of this, the loop gets DCE'd and
we are happy.  This also applies to anything that does similar things, e.g.
loops like this:

  const float Array[] = { 0.1, 2.1, 3.2, 23.21 };
  for (int i = 0; Array[i] < 20; ++i)

and is actually fairly general.

The problem with this is that it almost never triggers.  The reason is that
we run indvars and the loop optimizer only at compile time, which is before
things like strlen and strcpy have been inlined into the program from libc.
Because of this, it almost never is used (it triggers twice in specint2k).

I'm committing it because it DOES work, may be useful in the future, and
doesn't slow us down at all.  If/when we start running the loop optimizer
at link-time (-O4?) this will be very nice indeed :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16926 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-12 01:49:27 +00:00
Chris Lattner
c9b938065a Make this build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16919 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-11 20:53:28 +00:00
Chris Lattner
4a2b23e189 Fix SingleSource/Benchmarks/McGill/chomp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16912 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-11 04:07:27 +00:00
Reid Spencer
ddef0b3a6c Build both archive and relinked objects
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16892 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-10 22:17:39 +00:00
Reid Spencer
9f41a5fe85 Initial version of automake Makefile.am file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16885 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-10 20:43:57 +00:00
Chris Lattner
a1c972df7d Fix a nasty dangling pointer problem, due to a free'd pointer being left in
a map.  This caused problems if a later object happened to be allocated at
the free'd object's address.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16813 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-07 20:01:31 +00:00
Chris Lattner
157b2525f9 Dont' let null nodes sneak past cast instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16779 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-06 19:29:13 +00:00
Chris Lattner
b12914bfc0 'Pass' should now not be derived from by clients. Instead, they should derive
from ModulePass.  Instead of implementing Pass::run, then should implement
ModulePass::runOnModule.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16436 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-20 04:48:05 +00:00
Chris Lattner
68d033cc94 Finegrainify namespacification
'Pass' should now not be derived from by clients.  Instead, they should derive
from ModulePass.  Instead of implementing Pass::run, then should implement
ModulePass::runOnModule.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16434 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-20 04:44:31 +00:00
Chris Lattner
fff03c9074 Fix a nasty iterator invalidation problem I introduced yesterday. This
unfortunately is the cause of a bunch of failures from tonight, and the
reason the tester is running so slow :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16407 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-19 19:01:06 +00:00
Chris Lattner
cd382a3725 Add CallGraphNode::removeAnyCallEdgeTo method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16398 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-18 21:34:34 +00:00
Chris Lattner
3795bc9785 When changing a function, make sure to update the CallGraphNode for the
function, not just the CallGraph.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16388 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-18 00:27:20 +00:00
Chris Lattner
6f7e5ebb42 Implement new changeFunction method, nuke a never implemented one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16386 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-18 00:22:13 +00:00
Reid Spencer
2da5c3dda6 Convert code to compile with vc7.1.
Patch contributed by Paolo Invernizzi. Thanks Paolo!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16368 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-15 17:06:42 +00:00
Chris Lattner
3080b605d7 Add some assertions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16366 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-15 16:59:47 +00:00
Chris Lattner
b66e648e95 Implement an AliasSetTracker::copyValue method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16344 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-14 19:15:32 +00:00
Alkis Evlogimenos
20aa474f8f Fixes to make LLVM compile with vc7.1.
Patch contributed by Paolo Invernizzi!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16152 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-03 18:19:51 +00:00
Reid Spencer
551ccae044 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/.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16137 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-01 22:55:40 +00:00
Chris Lattner
df9b7bc090 Fix a bug that caused the pass to go into infinite loops on trivial testcases.
This is fallout of the Bug 122 changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15811 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-16 05:38:02 +00:00
Chris Lattner
af8a42445c Add standard print/dump methods to CallGraph classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15569 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-08 03:27:49 +00:00
Chris Lattner
f0431b0d42 Hide this option
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15415 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-02 20:16:21 +00:00
Misha Brukman
47b14a4a6a Fix #includes of i*.h => Instructions.h as per PR403.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15334 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-29 17:30:56 +00:00
Misha Brukman
d8e1eea678 Fix #includes of i*.h => Instructions.h as per PR403.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15328 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-29 17:05:13 +00:00
Alkis Evlogimenos
eb62bc77b6 Merge i*.h headers into Instructions.h as part of bug403.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15325 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-29 12:17:34 +00:00
Chris Lattner
730b1ad2c4 Fix test/Regression/Analysis/BasicAA/2004-07-28-MustAliasbug.llx
This also fixes the miscompilation of MallocBench/gs with dead store
elimination enabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15324 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-29 07:56:39 +00:00
Brian Gaeke
96d4bf7aee Make the create...() functions for some of these passes return a FunctionPass *.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15276 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 17:43:21 +00:00
Chris Lattner
b0015c510f nuke pointless -debug output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15267 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 08:03:18 +00:00
Chris Lattner
105d26acb4 Fix conservative assumption, which was quite broken. Also, notice that
functions known to not access memory (like sin/cos) don't access memory! :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15264 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 07:46:26 +00:00
Chris Lattner
63e9930498 Remove a bogus assertion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15261 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 07:22:21 +00:00
Chris Lattner
fe98f27e80 Complete rewrite of this pass to be faster, use less memory, be easier to
understand, and more accurate to boot!  This implements
GlobalModRef/purecse.ll over the previous impl.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15260 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 06:40:37 +00:00
Chris Lattner
efe30ef790 Use context-sensitive alias analysis to avoid pessimization in clients of
AliasSetTracker (dse and licm).  This implements
DeadStoreElimination/context-sensitive.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15254 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 02:20:26 +00:00
Chris Lattner
db5b80a7f2 Make basicaa a bit more aggressive
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15252 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 02:18:52 +00:00
Chris Lattner
e181b94309 basic-aa can actually provide simple mod/ref info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15251 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 02:13:55 +00:00
Chris Lattner
05e47987ee This was implemented back in march
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15250 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 01:59:42 +00:00
Chris Lattner
61d462760b Add some new methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15230 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 05:50:23 +00:00
Chris Lattner
34a1005737 Fix a latent bug in the AliasSetTracker that was exposed by the FreeInst additions and broke a bunch of programs last night.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15214 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 18:32:01 +00:00
Chris Lattner
5c88260f70 Add support for free instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15197 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 07:57:37 +00:00
Chris Lattner
b8a31ace2c Clean up reference counting to stop "leaking" alias sets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15099 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-22 07:58:18 +00:00
Brian Gaeke
7848e68c16 These files don't need to include <iostream> since they include "Support/Debug.h".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15089 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 20:50:33 +00:00
Chris Lattner
6d4b0d723d Add capability to remove aliasing aliassets from an AST
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15066 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 07:04:26 +00:00
Chris Lattner
12c1155403 Make the AST interface a bit richer by returning whether an insertion caused
an insertion or not (because the pointer set already existed).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15064 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 05:18:04 +00:00
Chris Lattner
bb8f43c8fc Do not ignore casts unless they are pointer-pointer casts. This caused us
to miscompile the SingleSource/Regression/C++/pointer_member.cpp program.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15062 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 03:56:54 +00:00
Reid Spencer
e840434755 bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14942 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:18:30 +00:00
Chris Lattner
cb19d67907 Fix incorrect computation of mod/ref sets. Do not ask for mod/ref information
for objects of size 0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14908 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-17 07:40:34 +00:00
Chris Lattner
ad48cc71dc Print modref information in a useful way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14907 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-17 06:43:20 +00:00
Chris Lattner
0e872cb470 Cleanups: fold two loops into one
New features: -print-all-alias-modref-info option, print more info


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14906 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-17 06:28:49 +00:00
Chris Lattner
f99947c35f Be compatible with IA64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14864 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 00:04:13 +00:00
Chris Lattner
1ff1ff70e3 Fixes for PR341
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14843 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 02:31:46 +00:00
Chris Lattner
f92791ace5 Fix for PR341
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14842 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 02:26:49 +00:00
Chris Lattner
ce36d55cf8 Bug fixes for PR341
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14838 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 01:29:12 +00:00
Chris Lattner
f70770abd5 Simplify logic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14825 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-14 20:27:12 +00:00
Chris Lattner
5ace1e4f6f Disable some code that isn't helping matters
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14682 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 07:25:51 +00:00
Chris Lattner
8adbec89ce Headers moved
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14665 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-07 06:35:22 +00:00
Chris Lattner
4dabb2c6f3 Move all of the DSA headers into the Analysis/DataStructure subdir.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14663 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-07 06:32:21 +00:00
Chris Lattner
eaef5685b8 Moving headers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14661 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-07 06:22:54 +00:00
Chris Lattner
efffdc9408 As much as I hate to say it, the whole setNode interface for DSNodeHandles
is HOPELESSLY broken.  The problem is that the embedded getNode call can
change the offset of the node handle in unpredictable ways.

As it turns out, all of the clients of this method really want to set
both the node and the offset, thus it is more efficient (and less buggy)
to just do both of them in one method call.  This fixes some obscure bugs
handling non-forwarded node handles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14660 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-07 06:12:52 +00:00
Reid Spencer
954da37bb4 Add #include <iostream> since Value.h does not #include it any more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14622 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 12:19:56 +00:00
Chris Lattner
3b04a8ac45 Initial checkin of a simple mod/ref analysis for global variables. This is
still overly conservative and uses very simple data structures, but it is a
start, and allows elimination of a lot of loads.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14462 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-28 06:33:13 +00:00
Chris Lattner
e6afb74188 Moved IPModRef out of the public include dir
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14455 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-28 00:41:23 +00:00
Chris Lattner
b88fb055c4 Move DependenceGraph.* to lib/Analysis/DataStructure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14452 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-28 00:32:33 +00:00
Chris Lattner
2de1d32ce1 Moving to lib/Analysis/DataStructure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14450 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-28 00:29:42 +00:00
Chris Lattner
0ecdcbe63a Move MemoryDepAnalysis.h into lib/Analysis/DataStructure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14448 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-28 00:27:16 +00:00
Chris Lattner
71ef8f7adc Move PgmDependenceGraph.h out of the public include hierarchy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14446 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-28 00:20:04 +00:00
Chris Lattner
af754dbf65 Simplify code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14424 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-26 19:31:26 +00:00
Chris Lattner
d28b0d73da Fix header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14394 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-25 04:24:22 +00:00
Chris Lattner
5aa20212cc Remove distasteful method which is really part of the indvars pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14359 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 06:52:20 +00:00
Chris Lattner
37ec591c74 Fix merging of nodes whose incoming offset is not zero. This unbreaks DSA on
several mallocbench programs, including perl.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14342 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-23 06:29:59 +00:00
Misha Brukman
f05ff33d21 File requires IPA, moved to lib/Analysis/IPA
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14330 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-22 19:04:53 +00:00
Misha Brukman
952e38cf24 File depends on MemoryDepAnalysis (DSA); moved to lib/Analysis/DataStructure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14327 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-22 18:28:37 +00:00
Misha Brukman
bab75268f0 Files depend on DSA, moved to lib/Analysis/DataStructure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14326 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-22 18:13:24 +00:00
Chris Lattner
8e667cdc94 If an edge points to a field of another memory object, actually reflect this
in the DOT visualization of the DSGraphs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14316 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-22 07:13:10 +00:00
Chris Lattner
541ad5e19e REALLY fix PR378: crash in scalar evolution analysis
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14275 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-20 20:32:16 +00:00
Chris Lattner
2d58452f39 Fix a bug in my change last night that caused a few test failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14270 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-20 17:01:44 +00:00
Chris Lattner
8d741b8bef Do not sort SCEV objects by address: instead sort by complexity and group
by address.  This prevents the resultant SCEV objects from depending on
where in memory other scev objects happen to live.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14263 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-20 06:23:15 +00:00
Chris Lattner
689835a2d9 Fix a tiny bug in the -no-aa pass, in which it did not ever get a target data.
This is a regression from 1.2, though noone uses -no-aa anyway


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14245 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-19 08:05:58 +00:00
Chris Lattner
f70c22b019 Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14201 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-17 18:19:28 +00:00
Chris Lattner
4ee623de0b isnan is dead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14191 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-15 21:52:58 +00:00
Chris Lattner
9f35196fc2 llvm.isnan doesn't access memory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14151 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-11 06:17:13 +00:00
Chris Lattner
47c31a8248 Don't grab the condition of unconditional branches!
This fixes PR363


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14076 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-08 21:50:30 +00:00
Chris Lattner
c7ca32b203 Add some notes so I can throw away one of my many todo lists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14046 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-05 20:12:36 +00:00
Chris Lattner
24527fd2ae Don't send random junk to CachedWriter's. Also remove a cast that could be
problematic when Type does not derive from Value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14022 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-04 20:25:55 +00:00
Chris Lattner
a5dcc4f7b2 Minor efficiency gain: do 1 nlogn lookup instead of two
Code cleanup


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13875 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-28 05:36:49 +00:00
Chris Lattner
1fc3739560 Fix warnings about reaching end of non-void function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13852 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-27 20:57:01 +00:00
Vikram S. Adve
e4e97ef64d Recognize memalign and friends, and handle them specially.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13741 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-25 08:14:52 +00:00
Chris Lattner
5a24d70d99 Changes to work with the changes to the AliasAnalysis interface. The -no-aa
class is now in the BasicAliasAnalysis.cpp file


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13684 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-23 21:15:48 +00:00
Chris Lattner
b52f440860 Move the -no-aa AA implementation into this file since both of these
alias analysis implementations are special: they do not autoforward to a
chained implementation of alias analysis


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13683 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-23 21:15:12 +00:00
Chris Lattner
484e3027b2 Updates to work with the new auto-forwarding AA interface changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13682 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-23 21:14:27 +00:00
Chris Lattner
2412a05b80 Fix a really nasty bug with the -disable-ds-field-sensitivity option
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13681 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-23 21:14:09 +00:00
Chris Lattner
1bf3408f96 Update to match the autochaining interface that the AA interface uses
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13680 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-23 21:13:51 +00:00
Chris Lattner
0f312d6998 Implement the interfaces to update value numbering information. Add an
assert.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13679 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-23 21:13:24 +00:00
Chris Lattner
c43e0ae350 Rename a method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13676 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-23 21:10:58 +00:00
Chris Lattner
e995a2abb3 Add a simple implementation of Andersen's interprocedural pointer analysis
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13666 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-23 21:00:47 +00:00
Vikram S. Adve
052682f1c3 Inline both direct and indirect callees in the CBU phase because
a direct callee may have indirect callees and so may have changed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13649 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-23 08:00:34 +00:00
Vikram S. Adve
c5204fb6f8 Complete rewrite of the code that merges DS graphs for equivalence classes
of functions called at a common call site.  The rewrite inlines the
resulting graphs bottom-up on the SCCs of the CBU call graph.  It also
simplifies the merging of equivalence classes by exploiting the fact that
functions in non-trivial SCCs are already merged.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13645 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-23 07:54:02 +00:00
Chris Lattner
0555ed8bff Fine grainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13436 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-09 06:22:29 +00:00
Brian Gaeke
6178085cfd Move the stuff that fixes the size, orientation & fonts of graphs to
the debugging functions that call "dot". These fixed settings have
various problems: for example, the fixed size that is set in the graph
traits classes is not appropriate for turning the dot file into a PNG,
and if TrueType font rendering is being used, the 'Courier' TrueType font
may not be installed. It seems easy enough to specify these things on the
command line, anyhow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13366 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-05 06:10:06 +00:00
Brian Gaeke
b171d7949d Add stub support for reading BBTraces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13352 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-04 17:11:14 +00:00
Brian Gaeke
660ef70b62 Share ProfilingType enum with the C profiling runtime libraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13346 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-04 16:53:07 +00:00
Chris Lattner
7b11e339d2 Fix a problem with double freeing memory. For some reason, CallGraph is not
acting like a normal pass.  :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13318 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-02 16:06:18 +00:00
Chris Lattner
224f7e65e0 Plug a minor memory leak
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13317 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-02 07:31:34 +00:00
Misha Brukman
96a8bd7f54 Wrapped code and comments at 80 cols; doxygenified some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13264 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-29 04:05:30 +00:00
Misha Brukman
bf94a1e22a Reorder #includes as per style guide.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13263 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-29 04:04:47 +00:00
Misha Brukman
8618e52be5 Send text and numbers directly to CachedWriter's contained ostream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13243 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-28 18:52:43 +00:00
Chris Lattner
6ffe551f65 Changes to fix up the inst_iterator to pass to boost iterator checks. This
patch was graciously contributed by Vladimir Prus.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13185 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-27 15:13:33 +00:00
Brian Gaeke
c6e2d8a2ff Add functions that return instances of these printer passes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13175 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-26 16:27:08 +00:00
Chris Lattner
bac7da8461 If an object is not in the scalar map then it must be a global from another
graph.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13173 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-26 14:44:08 +00:00
Chris Lattner
b06432c276 Eliminate all of the SCEV Expansion code which is really part of the
IndVars pass, not part of SCEV *analysis*.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13134 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-23 21:29:03 +00:00
Chris Lattner
72035995d5 Pass the callgraph not the module
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13087 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-20 21:52:26 +00:00
Chris Lattner
a10df50282 Add the ability for SCC passes to initialize and finalize themselves
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13084 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-20 21:30:06 +00:00
Chris Lattner
45a1cf87d4 It's not just a printer, it's actually an analysis too
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13064 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-19 03:42:32 +00:00
Chris Lattner
446b86d381 Remove code to update loop depths
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13058 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-19 03:02:09 +00:00
Chris Lattner
85661d0978 Add new method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13050 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-18 22:45:27 +00:00
Chris Lattner
343c0cfa19 Fix computation of exit blocks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13047 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-18 22:21:41 +00:00
Chris Lattner
f1ab4b4eac Change the ExitBlocks list from being explicitly contained in the Loop
structure to being dynamically computed on demand.  This makes updating
loop information MUCH easier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13045 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-18 22:14:10 +00:00
Chris Lattner
3048bd1d3e Implement method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13036 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-18 06:54:48 +00:00
Chris Lattner
24199db80e Add a new method, add a check missing that caused a segfault if a loop didn't
have a canonical indvar


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13032 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-18 05:38:05 +00:00
Chris Lattner
3221ad0db7 Add the ability to compute exit values for complex loop using unanalyzable
operations.  This allows us to compile this testcase:

int main() {
        int h = 1;
         do h = 3 * h + 1; while (h <= 256);
        printf("%d\n", h);
        return 0;
}

into this:

int %main() {
entry:
        call void %__main( )
        %tmp.6 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([4 x sbyte]*  %.str_1, long 0, long 0), int 364 )        ; <int> [#uses=0]
        ret int 0
}

This testcase was taken directly from 256.bzip2, believe it or not.

This code is not as general as I would like.  Next up is to refactor it
a bit to handle more cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13019 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-17 22:58:41 +00:00
Chris Lattner
7980fb9007 Add the ability to compute trip counts that are only controlled by constants
even if the loop is using expressions that we can't compute as a closed-form.
This allows us to calculate that this function always returns 55:

int test() {
  double X;
  int Count = 0;
  for (X = 100; X > 1; X = sqrt(X), ++Count)
    /*empty*/;
  return Count;
}

And allows us to compute trip counts for loops like:

        int h = 1;
         do h = 3 * h + 1; while (h <= 256);

(which occurs in bzip2), and for this function, which occurs after inlining
and other optimizations:

int popcount()
{
   int x = 666;
  int result = 0;
  while (x != 0) {
    result = result + (x & 0x1);
    x = x >> 1;
  }
  return result;
}

We still cannot compute the exit values of result or h in the two loops above,
which means we cannot delete the loop, but we are getting closer.  Being able to
compute a constant trip count for these two loops will allow us to unroll them
completely though.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13017 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-17 18:36:24 +00:00
Brian Gaeke
c598517c24 Include <cmath> for compatibility with gcc 3.0.x (the system compiler on
Debian.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12986 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-16 15:57:32 +00:00
Chris Lattner
92020faa2c add some helpful methods. Rearrange #includes to proper order
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12960 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-15 15:16:02 +00:00
Chris Lattner
0a7f98c80d Factor a bunch of classes out into a public header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12958 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-15 15:07:24 +00:00
Chris Lattner
0aa84fdd04 Unbreak the build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12956 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-15 14:17:43 +00:00
Chris Lattner
e9fc96e7cc Implement a FIXME: if we're going to insert a cast, we might as well only
insert it once!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12955 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-14 22:01:22 +00:00
Chris Lattner
16011e6201 This is a trivial tweak to the addrec insertion code: insert the increment
at the bottom of the loop instead of the top.  This reduces the number of
overlapping live ranges a lot, for example, eliminating a spill in an important
loop in 183.equake with linear scan.

I still need to make the exit comparison of the loop use the post-incremented
version of this variable, but this is an easy first step.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12952 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-14 21:11:25 +00:00
Chris Lattner
46758a894f Add some methods that are useful for updating loop information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12871 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-12 20:26:17 +00:00
Chris Lattner
b81c021f14 Change the call graph class to have TWO external nodes, making call graph
SCC passes much more useful.  In particular, this should fix the incredibly
stupid missed inlining opportunities that the inliner suffered from.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12860 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-12 05:36:32 +00:00
Chris Lattner
7512c08bfd Hrm, operator new and new[] do not belong here. We should not CSE them! :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12859 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-12 05:16:42 +00:00
Chris Lattner
bec63d606f operator new & operator new[] do not kill any legal memory locations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12833 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-11 18:16:34 +00:00
Chris Lattner
65585aa3fc Allow clients to be more efficient.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12831 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-11 16:43:07 +00:00
Chris Lattner
b903fc5c1b Add a couple of more functions that cannot access memory (the intrinsics) and
don't write to memory


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12808 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-10 06:55:27 +00:00
Chris Lattner
627018b4b3 Fix a bug Brian found.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12754 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-07 16:16:11 +00:00
Chris Lattner
ea9e005ce6 Sparc don't got not "sqrtl", bum bum bum
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12670 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 19:05:15 +00:00
Misha Brukman
bb2aff1e18 Kill warnings during an optimized compile where assert() disappears.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12669 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 19:00:46 +00:00
Chris Lattner
ddd947f21a Fix PR312 and IndVarsSimplify/2004-04-05-InvokeCastCrash.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12668 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 18:46:55 +00:00
Chris Lattner
28977af72a Support getelementptr instructions which use uint's to index into structure
types and can have arbitrary 32- and 64-bit integer types indexing into
sequential types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12653 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 01:30:19 +00:00
Chris Lattner
5da80974c0 Implement test/Regression/Transforms/GCSE/undefined_load.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12641 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-03 00:45:16 +00:00
Chris Lattner
e34c0b48a0 Add a break in the default case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12639 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-03 00:43:03 +00:00
Chris Lattner
9687845800 Remove obsolete files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12633 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 20:56:24 +00:00
Chris Lattner
d18d9dcd28 Comment out debugging printouts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12623 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 20:26:46 +00:00
Chris Lattner
53e677abad Add a new analysis
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12619 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 20:23:17 +00:00
Chris Lattner
fc33d30446 Add some new methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12539 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-30 00:20:08 +00:00
Chris Lattner
db81395452 Adjust to new itf
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12534 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-29 20:42:49 +00:00
Chris Lattner
698c4a4bbb Minor efficiency improvement, finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12517 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-25 22:56:03 +00:00
Chris Lattner
4781bc7142 Fix a HORRIBLY NASTY bug that caused siod to stop working last night.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12479 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-17 23:22:04 +00:00
Chris Lattner
002be76733 Add some missing functions. Make sure to handle calls together in case the
client has another VN implementation that can VN calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12427 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-16 03:41:35 +00:00
Chris Lattner
fcead4f426 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12422 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 06:28:07 +00:00
Chris Lattner
df209fcc7e This assertion is bogus now that calls do not necessarily read/write memory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12421 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 06:24:15 +00:00
Chris Lattner
5a6e947f1d Implement CSE of call instructions in the most trivial case. This implements
GCSE/call_cse.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12419 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 05:44:59 +00:00
Chris Lattner
bbcc147220 Fix a minor bug, implementing GCSE/call_pure_function.ll
Also, add some stuff I missed before.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12417 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 04:18:28 +00:00
Chris Lattner
5b5f7c11d0 Don't be COMPLETELY pessimistic in the face of function calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12413 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 04:08:36 +00:00
Chris Lattner
992860c44e Deinline some virtual methods, provide better mod/ref answers through the
use of the boolean queries


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12410 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 04:07:29 +00:00
Chris Lattner
b79d79297d Pass through the boolean queries
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12409 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 04:06:46 +00:00
Chris Lattner
4244bb5bbd Teach basicaa about some stdc functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12408 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 03:36:49 +00:00
Chris Lattner
a2dc727ac4 DemoteRegToStack got moved from DemoteRegToStack.h to Local.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12368 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-14 02:13:38 +00:00
Chris Lattner
cc7c4acffa Fix a tiny bug that caused an incorrect assertion failure poolallocating
boxed-sim.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12358 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-13 01:14:23 +00:00
Chris Lattner
317201d773 Rename the intrinsic enum values for llvm.va_* from Intrinsic::va_* to
Intrinsic::va*.  This avoid conflicting with macros in the stdlib.h file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12356 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-13 00:24:00 +00:00
Chris Lattner
7a82ba0510 Fix a couple of minor problems. Because PHI nodes can use themselves, this
could cause infinite loops.  Also, getUnderlyingObject can return null


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12351 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-12 23:12:55 +00:00