Reid Spencer
cdc0b6d962
Standardize on 'class' instead of 'struct'. Gets rid of warnings in VC++
...
Patch contributed by Jeff Cohen.
llvm-svn: 17889
2004-11-16 06:58:55 +00:00
Chris Lattner
0efef015fa
Fix a bug that was preventing povray and namd from pool allocating correctly.
...
llvm-svn: 17632
2004-11-08 21:08:46 +00:00
Chris Lattner
dcee21898f
Handle assert_fail special
...
llvm-svn: 17631
2004-11-08 21:08:28 +00:00
Chris Lattner
9f23af6d68
Remove dead var
...
llvm-svn: 17485
2004-11-05 04:52:08 +00:00
Chris Lattner
3b6d1045d3
Don't call Constant::getNullValue when the argument could be VoidTy
...
llvm-svn: 17457
2004-11-03 18:51:26 +00:00
Chris Lattner
8572d582cf
Fix comment
...
llvm-svn: 17377
2004-10-31 21:54:51 +00:00
Chris Lattner
d72b6b1e77
Improve comment
...
llvm-svn: 17375
2004-10-31 19:57:43 +00:00
Chris Lattner
14d85c9b09
Add more paranoid assertions :)
...
llvm-svn: 17367
2004-10-31 17:45:40 +00:00
Chris Lattner
29b6259de3
Fix some more problems where we called getOffset before getNode()
...
llvm-svn: 17358
2004-10-30 07:21:19 +00:00
Chris Lattner
4b741eab69
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.
llvm-svn: 17357
2004-10-30 05:41:23 +00:00
Chris Lattner
14dfc01ad5
Fix more undefined behavior
...
llvm-svn: 17356
2004-10-30 04:22:45 +00:00
Chris Lattner
c17cd85776
* 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.
llvm-svn: 17354
2004-10-30 04:05:01 +00:00
Alkis Evlogimenos
1162280a0d
Fix library name.
...
llvm-svn: 17306
2004-10-28 05:36:48 +00:00
Reid Spencer
d3f7233495
Change Library Names Not To Conflict With Others When Installed
...
llvm-svn: 17286
2004-10-27 23:18:45 +00:00
Chris Lattner
dd0094e4ed
Convert 'struct' to 'class' in various places to adhere to the coding standards
...
and work better with VC++. Patch contributed by Morten Ofstad!
llvm-svn: 17281
2004-10-27 16:14:51 +00:00
Chris Lattner
3a79669263
add support for UndefValue
...
llvm-svn: 17260
2004-10-26 16:23:03 +00:00
Chris Lattner
1cef20bac1
Patch to support MSVC, contributed by Morten Ofstad
...
llvm-svn: 17214
2004-10-25 18:40:08 +00:00
Reid Spencer
e48ba34fd4
We won't use automake
...
llvm-svn: 17155
2004-10-22 03:35:04 +00:00
Reid Spencer
ce514b1c2c
Initial automake generated Makefile template
...
llvm-svn: 17136
2004-10-18 23:55:41 +00:00
Chris Lattner
2fae8a1ef9
Add support for unreachable
...
llvm-svn: 17056
2004-10-16 18:21:33 +00:00
Chris Lattner
8d479b62ad
Add support for undef
...
llvm-svn: 17055
2004-10-16 18:19:26 +00:00
Chris Lattner
cbdf19fed2
Add support
...
llvm-svn: 17052
2004-10-16 18:16:19 +00:00
Chris Lattner
b3a86dc93f
Be more careful about looking for constants when we really want constantint's.
...
llvm-svn: 17029
2004-10-16 16:07:10 +00:00
Chris Lattner
3fc5e3778f
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!
llvm-svn: 16985
2004-10-14 14:59:16 +00:00
Reid Spencer
e6418ec30f
Update to reflect changes in Makefile rules.
...
llvm-svn: 16950
2004-10-13 11:46:52 +00:00
Chris Lattner
6b6e5a5815
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 :)
llvm-svn: 16926
2004-10-12 01:49:27 +00:00
Chris Lattner
f8dab00902
Fix SingleSource/Benchmarks/McGill/chomp
...
llvm-svn: 16912
2004-10-11 04:07:27 +00:00
Reid Spencer
bc135b067a
Build both archive and relinked objects
...
llvm-svn: 16892
2004-10-10 22:17:39 +00:00
Reid Spencer
7d9cba7a0f
Initial version of automake Makefile.am file.
...
llvm-svn: 16885
2004-10-10 20:43:57 +00:00
Chris Lattner
d15e144241
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.
llvm-svn: 16813
2004-10-07 20:01:31 +00:00
Chris Lattner
e412d10cc0
Dont' let null nodes sneak past cast instructions
...
llvm-svn: 16779
2004-10-06 19:29:13 +00:00
Chris Lattner
43c0372c0b
'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.
llvm-svn: 16436
2004-09-20 04:48:05 +00:00
Chris Lattner
01bbefa96c
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.
llvm-svn: 16434
2004-09-20 04:44:31 +00:00
Chris Lattner
e6755fe307
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 :(
llvm-svn: 16407
2004-09-19 19:01:06 +00:00
Chris Lattner
110bbafcf7
Add CallGraphNode::removeAnyCallEdgeTo method
...
llvm-svn: 16398
2004-09-18 21:34:34 +00:00
Chris Lattner
53dea1ce37
When changing a function, make sure to update the CallGraphNode for the
...
function, not just the CallGraph.
llvm-svn: 16388
2004-09-18 00:27:20 +00:00
Chris Lattner
a9b80a3258
Implement new changeFunction method, nuke a never implemented one.
...
llvm-svn: 16386
2004-09-18 00:22:13 +00:00
Reid Spencer
c6a8d70cff
Convert code to compile with vc7.1.
...
Patch contributed by Paolo Invernizzi. Thanks Paolo!
llvm-svn: 16368
2004-09-15 17:06:42 +00:00
Chris Lattner
f1a0bf88c5
Add some assertions
...
llvm-svn: 16366
2004-09-15 16:59:47 +00:00
Chris Lattner
606caa617e
Implement an AliasSetTracker::copyValue method
...
llvm-svn: 16344
2004-09-14 19:15:32 +00:00
Alkis Evlogimenos
0c50e0f211
Fixes to make LLVM compile with vc7.1.
...
Patch contributed by Paolo Invernizzi!
llvm-svn: 16152
2004-09-03 18:19:51 +00:00
Reid Spencer
c4abcbefb1
Changes For Bug 352
...
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.
llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Chris Lattner
818ac2d5e2
Fix a bug that caused the pass to go into infinite loops on trivial testcases.
...
This is fallout of the Bug 122 changes.
llvm-svn: 15811
2004-08-16 05:38:02 +00:00
Chris Lattner
0b9b58e550
Add standard print/dump methods to CallGraph classes.
...
llvm-svn: 15569
2004-08-08 03:27:49 +00:00
Chris Lattner
13e1bc338d
Hide this option
...
llvm-svn: 15415
2004-08-02 20:16:21 +00:00
Misha Brukman
58104df77b
Fix #includes of i*.h => Instructions.h as per PR403.
...
llvm-svn: 15334
2004-07-29 17:30:56 +00:00
Misha Brukman
2a80e53645
Fix #includes of i*.h => Instructions.h as per PR403.
...
llvm-svn: 15328
2004-07-29 17:05:13 +00:00
Alkis Evlogimenos
fb27f702ca
Merge i*.h headers into Instructions.h as part of bug403.
...
llvm-svn: 15325
2004-07-29 12:17:34 +00:00
Chris Lattner
b2cf39d1a4
Fix test/Regression/Analysis/BasicAA/2004-07-28-MustAliasbug.llx
...
This also fixes the miscompilation of MallocBench/gs with dead store
elimination enabled.
llvm-svn: 15324
2004-07-29 07:56:39 +00:00
Brian Gaeke
45adb41f46
Make the create...() functions for some of these passes return a FunctionPass *.
...
llvm-svn: 15276
2004-07-27 17:43:21 +00:00
Chris Lattner
81f96c5a79
nuke pointless -debug output
...
llvm-svn: 15267
2004-07-27 08:03:18 +00:00
Chris Lattner
6a1dd59421
Fix conservative assumption, which was quite broken. Also, notice that
...
functions known to not access memory (like sin/cos) don't access memory! :)
llvm-svn: 15264
2004-07-27 07:46:26 +00:00
Chris Lattner
e921652646
Remove a bogus assertion
...
llvm-svn: 15261
2004-07-27 07:22:21 +00:00
Chris Lattner
c76d21f55d
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.
llvm-svn: 15260
2004-07-27 06:40:37 +00:00
Chris Lattner
550242f7ec
Use context-sensitive alias analysis to avoid pessimization in clients of
...
AliasSetTracker (dse and licm). This implements
DeadStoreElimination/context-sensitive.llx
llvm-svn: 15254
2004-07-27 02:20:26 +00:00
Chris Lattner
40bd881142
Make basicaa a bit more aggressive
...
llvm-svn: 15252
2004-07-27 02:18:52 +00:00
Chris Lattner
fe3fff9354
basic-aa can actually provide simple mod/ref info
...
llvm-svn: 15251
2004-07-27 02:13:55 +00:00
Chris Lattner
9cfa22fb48
This was implemented back in march
...
llvm-svn: 15250
2004-07-27 01:59:42 +00:00
Chris Lattner
8b2590f09f
Add some new methods
...
llvm-svn: 15230
2004-07-26 05:50:23 +00:00
Chris Lattner
447e112745
Fix a latent bug in the AliasSetTracker that was exposed by the FreeInst additions and broke a bunch of programs last night.
...
llvm-svn: 15214
2004-07-25 18:32:01 +00:00
Chris Lattner
31d9cbf7bb
Add support for free instructions
...
llvm-svn: 15197
2004-07-25 07:57:37 +00:00
Chris Lattner
e3adc34ea7
Clean up reference counting to stop "leaking" alias sets
...
llvm-svn: 15099
2004-07-22 07:58:18 +00:00
Brian Gaeke
f18cdca667
These files don't need to include <iostream> since they include "Support/Debug.h".
...
llvm-svn: 15089
2004-07-21 20:50:33 +00:00
Chris Lattner
195950df76
Add capability to remove aliasing aliassets from an AST
...
llvm-svn: 15066
2004-07-21 07:04:26 +00:00
Chris Lattner
f9976c5dbf
Make the AST interface a bit richer by returning whether an insertion caused
...
an insertion or not (because the pointer set already existed).
llvm-svn: 15064
2004-07-21 05:18:04 +00:00
Chris Lattner
36940c22f7
Do not ignore casts unless they are pointer-pointer casts. This caused us
...
to miscompile the SingleSource/Regression/C++/pointer_member.cpp program.
llvm-svn: 15062
2004-07-21 03:56:54 +00:00
Reid Spencer
b339652b44
bug 122:
...
- Replace ConstantPointerRef usage with GlobalValue usage
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass
llvm-svn: 14942
2004-07-18 00:18:30 +00:00
Chris Lattner
74807fe1a3
Fix incorrect computation of mod/ref sets. Do not ask for mod/ref information
...
for objects of size 0.
llvm-svn: 14908
2004-07-17 07:40:34 +00:00
Chris Lattner
2b68acbfe0
Print modref information in a useful way.
...
llvm-svn: 14907
2004-07-17 06:43:20 +00:00
Chris Lattner
49fd294675
Cleanups: fold two loops into one
...
New features: -print-all-alias-modref-info option, print more info
llvm-svn: 14906
2004-07-17 06:28:49 +00:00
Chris Lattner
763d51409f
Be compatible with IA64
...
llvm-svn: 14864
2004-07-16 00:04:13 +00:00
Chris Lattner
bb7fe18493
Fixes for PR341
...
llvm-svn: 14843
2004-07-15 02:31:46 +00:00
Chris Lattner
d7d7bc70fd
Fix for PR341
...
llvm-svn: 14842
2004-07-15 02:26:49 +00:00
Chris Lattner
fb6e1c2007
Simplify logic.
...
llvm-svn: 14825
2004-07-14 20:27:12 +00:00
Chris Lattner
203cdb2e64
Disable some code that isn't helping matters
...
llvm-svn: 14682
2004-07-08 07:25:51 +00:00
Chris Lattner
dce7977318
Headers moved
...
llvm-svn: 14665
2004-07-07 06:35:22 +00:00
Chris Lattner
7e0d8f8084
Move all of the DSA headers into the Analysis/DataStructure subdir.
...
llvm-svn: 14663
2004-07-07 06:32:21 +00:00
Chris Lattner
fb2f56c7c8
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.
llvm-svn: 14660
2004-07-07 06:12:52 +00:00
Reid Spencer
50ec3f9325
Add #include <iostream> since Value.h does not #include it any more.
...
llvm-svn: 14622
2004-07-04 12:19:56 +00:00
Chris Lattner
7d6a9bf05c
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.
llvm-svn: 14462
2004-06-28 06:33:13 +00:00
Chris Lattner
548171248d
Moved IPModRef out of the public include dir
...
llvm-svn: 14455
2004-06-28 00:41:23 +00:00
Chris Lattner
6eb1e76227
Move DependenceGraph.* to lib/Analysis/DataStructure
...
llvm-svn: 14452
2004-06-28 00:32:33 +00:00
Chris Lattner
a77dd6edec
Moving to lib/Analysis/DataStructure
...
llvm-svn: 14450
2004-06-28 00:29:42 +00:00
Chris Lattner
f914ccfa2a
Move MemoryDepAnalysis.h into lib/Analysis/DataStructure
...
llvm-svn: 14448
2004-06-28 00:27:16 +00:00
Chris Lattner
244d5fba00
Move PgmDependenceGraph.h out of the public include hierarchy
...
llvm-svn: 14446
2004-06-28 00:20:04 +00:00
Chris Lattner
850f1967b6
Simplify code
...
llvm-svn: 14424
2004-06-26 19:31:26 +00:00
Chris Lattner
d6e23a5104
Fix header
...
llvm-svn: 14394
2004-06-25 04:24:22 +00:00
Chris Lattner
228e6d64d0
Remove distasteful method which is really part of the indvars pass
...
llvm-svn: 14359
2004-06-24 06:52:20 +00:00
Chris Lattner
4e431080a9
Fix merging of nodes whose incoming offset is not zero. This unbreaks DSA on
...
several mallocbench programs, including perl.
llvm-svn: 14342
2004-06-23 06:29:59 +00:00
Misha Brukman
699226cbe4
File requires IPA, moved to lib/Analysis/IPA
...
llvm-svn: 14330
2004-06-22 19:04:53 +00:00
Misha Brukman
f940c277df
File depends on MemoryDepAnalysis (DSA); moved to lib/Analysis/DataStructure
...
llvm-svn: 14327
2004-06-22 18:28:37 +00:00
Misha Brukman
170b8a80de
Files depend on DSA, moved to lib/Analysis/DataStructure
...
llvm-svn: 14326
2004-06-22 18:13:24 +00:00
Misha Brukman
43f0a951fe
File depends on DSA, moved to lib/Analysis/DataStructure
...
llvm-svn: 14325
2004-06-22 18:11:38 +00:00
Chris Lattner
26e594052e
If an edge points to a field of another memory object, actually reflect this
...
in the DOT visualization of the DSGraphs.
llvm-svn: 14316
2004-06-22 07:13:10 +00:00
Chris Lattner
fea46da8de
REALLY fix PR378: crash in scalar evolution analysis
...
llvm-svn: 14275
2004-06-20 20:32:16 +00:00
Chris Lattner
59d13ac701
Fix a bug in my change last night that caused a few test failures.
...
llvm-svn: 14270
2004-06-20 17:01:44 +00:00
Chris Lattner
8c90177e5f
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.
llvm-svn: 14263
2004-06-20 06:23:15 +00:00
Chris Lattner
9b19f34fe2
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
llvm-svn: 14245
2004-06-19 08:05:58 +00:00
Chris Lattner
0cd29ae2cd
Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
...
llvm-svn: 14201
2004-06-17 18:19:28 +00:00
Chris Lattner
7c3600a50e
isnan is dead
...
llvm-svn: 14191
2004-06-15 21:52:58 +00:00