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

1497 Commits

Author SHA1 Message Date
Chris Lattner
44b3550217 add a method
llvm-svn: 31249
2006-10-28 01:24:05 +00:00
Reid Spencer
6833ffe8b8 For PR950:
Make necessary changes to support DIV -> [SUF]Div. This changes llvm to
have three division instructions: signed, unsigned, floating point. The
bytecode and assembler are bacwards compatible, however.

llvm-svn: 31195
2006-10-26 06:15:43 +00:00
Andrew Lenharth
67fc2c366f Make these hack flags hidden, like other dsa hack flags
llvm-svn: 31136
2006-10-23 19:55:24 +00:00
Andrew Lenharth
20f5c4f47d Revert the aggressive inlining for now, it doesn't handle external correctly
llvm-svn: 31135
2006-10-23 19:53:37 +00:00
Jim Laskey
0eeabf8ff5 [SU]int update - inactive code may get activated someday
llvm-svn: 31128
2006-10-23 14:39:22 +00:00
Reid Spencer
d414793dbc For PR950:
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.

llvm-svn: 31063
2006-10-20 07:07:24 +00:00
Andrew Lenharth
254a2fbcd0 Move some warnings to debug mode.
llvm-svn: 30933
2006-10-13 17:38:22 +00:00
Chris Lattner
0c057ef048 Fix a bug pointed out by Zhongxing Xu
llvm-svn: 30831
2006-10-09 17:28:13 +00:00
Chris Lattner
d55928d5f6 Fix more static dtor issues
llvm-svn: 30725
2006-10-04 21:52:35 +00:00
Chris Lattner
de1ba6dc70 Fix some more static dtor issues.
llvm-svn: 30724
2006-10-04 21:49:37 +00:00
Jim Laskey
3d44b337d9 Add ability to annotate (color) nodes in a viewGraph.
llvm-svn: 30686
2006-10-02 12:26:53 +00:00
Chris Lattner
06ed0910e5 Fixme is already done
llvm-svn: 30685
2006-10-01 22:46:33 +00:00
Chris Lattner
f0c3081939 Teach globalsmodref-aa to track scalar pointer global variables which point
to unaliased allocations.  Use this information to disambiguate pointers loaded
from them.  This is a very common case, so it's worthwhile to handle efficiently.

This implements Analysis/GlobalsModRef/indirect-global.ll

llvm-svn: 30684
2006-10-01 22:36:45 +00:00
Chris Lattner
155e6b8403 Eliminate ConstantBool::True and ConstantBool::False. Instead, provide
ConstantBool::getTrue() and ConstantBool::getFalse().

llvm-svn: 30666
2006-09-28 23:36:21 +00:00
Chris Lattner
7851529456 Simplify some code
llvm-svn: 30658
2006-09-28 23:14:29 +00:00
Devang Patel
7604cbd117 Fix DFS walk.
Fix http://llvm.org/bugs/show_bug.cgi?id=923

llvm-svn: 30630
2006-09-27 17:18:05 +00:00
Nick Lewycky
8fbfe60cee Explain change with a comment.
llvm-svn: 30443
2006-09-17 17:51:00 +00:00
Nick Lewycky
22b1a725ae Fix PR912. The input to erase() must not be a reference to the data
being erased.

llvm-svn: 30442
2006-09-17 16:23:36 +00:00
Devang Patel
2e8547542f Untabify.
llvm-svn: 30168
2006-09-07 23:29:19 +00:00
Devang Patel
6971b40067 Use iterative do-while loop instead of recursive DFSPass calls to
reduce amount of stack space used at runtime.

llvm-svn: 30167
2006-09-07 23:22:37 +00:00
Devang Patel
a5bb9b49d3 Do not rely on std::sort and std::erase to get list of unique
exit blocks. The output is dependent on addresses of basic block.

Add and use Loop::getUniqueExitBlocks.

llvm-svn: 29966
2006-08-29 22:29:16 +00:00
Reid Spencer
2567610703 For PR387:
Close out this long standing bug by removing the remaining overloaded
virtual functions in LLVM. The -Woverloaded-virtual option is now turned on.

llvm-svn: 29934
2006-08-28 01:02:49 +00:00
Chris Lattner
8a59e8be23 simplify AnalysisGroup registration, eliminating one typeid call.
llvm-svn: 29932
2006-08-28 00:42:29 +00:00
Chris Lattner
a39dcb5377 eliminate RegisterOpt. It does the same thing as RegisterPass.
llvm-svn: 29925
2006-08-27 22:42:52 +00:00
Chris Lattner
dda3f0344e Fit to 80 cols
llvm-svn: 29922
2006-08-27 22:31:12 +00:00
Chris Lattner
f530302eda Eliminate RegisterAnalysis. RegisterPass now does all that is necessary.
llvm-svn: 29921
2006-08-27 22:30:17 +00:00
Chris Lattner
33bd5dcfb7 s|llvm/Support/Visibility.h|llvm/Support/Compiler.h|
llvm-svn: 29911
2006-08-27 12:54:02 +00:00
Chris Lattner
0ad370eeb7 Fix PR885
llvm-svn: 29794
2006-08-21 17:20:01 +00:00
Chris Lattner
9781d44b6e Make Loop::getExitBlocks significantly faster for large loops. Instead of
pounding on Loop::contains (which is O(n) in the size of the loop), use a
sorted vector, which is O(log(N)) for each query.  This speeds up Duraid's
horrible testcase from ~72s to ~31s in a debug build.

llvm-svn: 29645
2006-08-12 05:02:03 +00:00
Chris Lattner
a21497f1b8 Speed up Loop::isLCSSAForm by using a binary search and single-entry cache.
This reduces LCSSA pass time from 1.5s to 0.96s when run on eon in release+asserts mode.

llvm-svn: 29464
2006-08-02 00:14:16 +00:00
Chris Lattner
e5e2e8d917 Change the callgraph representation to store the callsite along with the
target CG node.  This allows the inliner to properly update the callgraph
when using the pruning inliner.  The pruning inliner may not copy over all
call sites from a callee to a caller, so the edges corresponding to those
call sites should not be copied over either.

This fixes PR827 and Transforms/Inline/2006-07-12-InlinePruneCGUpdate.ll

llvm-svn: 29120
2006-07-12 18:29:36 +00:00
Jim Laskey
d19ba2cf6c It was pointed out that DEBUG() is only available with -debug.
llvm-svn: 29106
2006-07-11 18:25:13 +00:00
Jim Laskey
4c0d841280 Ensure that dump calls that are associated with asserts are removed from
non-debug build.

llvm-svn: 29105
2006-07-11 17:58:07 +00:00
Chris Lattner
496bd3fbf6 Use hidden visibility to make symbols in an anonymous namespace get
dropped.  This shrinks libllvmgcc.dylib another 67K

llvm-svn: 28975
2006-06-28 23:17:24 +00:00
Andrew Lenharth
24a9a6df27 add some missing externals
llvm-svn: 28955
2006-06-28 01:16:06 +00:00
Chris Lattner
fb34ed6ed4 Handle alias sets that have been unified, and thus can have other references
to them.  This fixes a regression in my previous checkin.

llvm-svn: 28951
2006-06-27 23:56:13 +00:00
Chris Lattner
a3a29d82b6 Don't implement AliasSetTracker::remove in terms of deleteValue. deleteValue
causes the pointer to be removed from the underlying alias analysis
implementation as well.  This impl of remove is also significantly faster than
the old one.  This fixes:
Regression/Transforms/DeadStoreElimination/2006-06-27-AST-Remove.ll

llvm-svn: 28950
2006-06-27 23:48:59 +00:00
Reid Spencer
938be45012 For PR801:
Refactor the Graph writing code to use a common implementation which is
now in lib/Support/GraphWriter.cpp. This completes the PR.

Patch by Anton Korobeynikov. Thanks, Anton!

llvm-svn: 28925
2006-06-27 16:49:46 +00:00
Chris Lattner
e2d4b2f3e2 Fix a stale pointer issue that caused 300.twolf to fail to build on zion
last night.

llvm-svn: 28916
2006-06-26 19:20:48 +00:00
Andrew Lenharth
f0ecdbe7ef Do partial inlining in BU. This resolves more call sites. Also add options to merge in globals during recursion and to back annotate DSNodes when function pointers are resolved. This makes PA work for a whole lot more things (unresolved call sites being what has been killing various DSA based passes)
llvm-svn: 28859
2006-06-19 18:23:36 +00:00
Andrew Lenharth
3ab1711306 Fix a bug, don't drop indirect call sites, especially if there is nothing known about them yet, and restore a simple version of a removed function
llvm-svn: 28857
2006-06-19 15:42:47 +00:00
Chris Lattner
9d028c26c8 Constant fold sqrtf
llvm-svn: 28853
2006-06-17 18:17:52 +00:00
Andrew Lenharth
9f4587fa50 Add a error message to cbu to match bu
llvm-svn: 28819
2006-06-16 14:43:36 +00:00
Andrew Lenharth
71d1cfa5c4 move header
llvm-svn: 28818
2006-06-16 14:33:53 +00:00
Owen Anderson
fab2186a2f Update isLCSSAForm to handle PHI nodes specially for live-out detection. This
is the same as the recent patch to LCSSA.cpp.

llvm-svn: 28773
2006-06-13 20:45:22 +00:00
Owen Anderson
15b85dbfa5 Re-commit the safe parts of my 6/9 patch. Still working on fixing the unsafe parts.
llvm-svn: 28748
2006-06-11 19:22:28 +00:00
Evan Cheng
d99c8e2e5f Back out Owen's 6/9 changes. They broke MultiSource/Benchmarks/Prolangs-C/bison (and perhaps others).
llvm-svn: 28747
2006-06-11 09:32:57 +00:00
Owen Anderson
6c2f7512a6 Make Loop able to verify that it is in LCSSA-form, and have the LCSSA pass assert
on this.

llvm-svn: 28738
2006-06-09 18:33:30 +00:00
Reid Spencer
560366562b For PR780:
1. Fix the macros in IncludeFile.h to put everything in the llvm namespace
2. Replace the previous explicit mechanism in all the .h and .cpp files
   with the macros in IncludeFile.h
This gets us a consistent mechanism throughout LLVM for ensuring linkage.
Next step is to make sure its used in enough places.

llvm-svn: 28715
2006-06-07 22:00:26 +00:00
Reid Spencer
3832b7f9c4 For PR780:
Break the "IncludeFile" mechanism into its own header file and adjust other
files accordingly. Use this facility for the IntrinsicInst problem which
was the subject of PR800.
More to follow on this.

llvm-svn: 28709
2006-06-07 20:00:19 +00:00
Reid Spencer
d9e9ae6b64 For PR798:
Add support for Graphviz. Patch contributed by Anton Korobeynikov.

llvm-svn: 28684
2006-06-05 15:44:46 +00:00
Chris Lattner
3d631893f9 Fix -pedantic warning
llvm-svn: 28634
2006-06-01 17:17:46 +00:00
Reid Spencer
2c6d390a60 Change from using a stub function to a stub variable for passing to the
IncludeFile hack to ensure linkage of analysis passes. This works around
some -pedantic warnings about assigning an object to a function.

llvm-svn: 28621
2006-06-01 07:02:51 +00:00
Andrew Lenharth
ec5b37953c move calltarget to dsa
llvm-svn: 28546
2006-05-29 23:39:48 +00:00
Andrew Lenharth
bc04a6c143 Since there was interest on the mailing list, this is a utility pass that
uses DSA to make find targets of calls.  It provides a very convinient
interface to DSA results to do things with indirect calls, such as
write a devirtualizer (which I have and may commit one of these days).

llvm-svn: 28545
2006-05-29 22:58:38 +00:00
Chris Lattner
f604017e47 Patches to make the LLVM sources more -pedantic clean. Patch provided
by Anton Korobeynikov!  This is a step towards closing PR786.

llvm-svn: 28447
2006-05-24 17:04:05 +00:00
Chris Lattner
9930cf948e Remove dead variable
llvm-svn: 28249
2006-05-12 17:41:45 +00:00
Chris Lattner
b42f17a66a Implement Transforms/IndVarsSimplify/complex-scev.ll, a case where we didn't
recognize some simple affine IV's.

llvm-svn: 27982
2006-04-26 18:34:07 +00:00
Andrew Lenharth
d62d88bae0 slightly more useful error message
llvm-svn: 27971
2006-04-25 19:33:41 +00:00
Andrew Lenharth
39d53414a5 better c99 struct handling
llvm-svn: 27970
2006-04-25 19:33:23 +00:00
Andrew Lenharth
ca2734f9f1 Another simple case type merge case to try
llvm-svn: 27831
2006-04-19 15:34:34 +00:00
Andrew Lenharth
ef07d5c5a5 deal with memchr
llvm-svn: 27830
2006-04-19 15:34:02 +00:00
Andrew Lenharth
09948a5331 friendlier error message
llvm-svn: 27829
2006-04-19 15:33:35 +00:00
Andrew Lenharth
d89cdc541a stupid stuff
llvm-svn: 27821
2006-04-19 03:45:25 +00:00
Andrew Lenharth
87c0d713cc I understand now. Shoot.
llvm-svn: 27819
2006-04-18 22:36:11 +00:00
Andrew Lenharth
4d432bcb19 llvm.memc* improvements. helps PA a lot in some specmarks
llvm-svn: 27812
2006-04-18 20:59:52 +00:00
Andrew Lenharth
d5fd116ede llvm.memc* improvements. helps PA a lot in some specmarks
llvm-svn: 27811
2006-04-18 19:54:11 +00:00
Chris Lattner
9f3ef19ced Implement value #'ing for vector operations, implementing
Regression/Transforms/GCSE/vectorops.ll

llvm-svn: 27691
2006-04-14 05:10:20 +00:00
Andrew Lenharth
b6264f0dbd Handle some kernel code than ends in [0 x sbyte]. I think this is safe
llvm-svn: 27672
2006-04-13 19:31:49 +00:00
Andrew Lenharth
038b30839d Move this to lib/Analysis.
This reduces Core size, yay.

llvm-svn: 27468
2006-04-06 22:58:58 +00:00
Andrew Lenharth
58b9d4af7a revert this, this is safe, if conservative. leave a note to that effect
llvm-svn: 27428
2006-04-05 02:42:36 +00:00
Chris Lattner
020ff34600 Signed shr by a constant is not the same as sdiv by 2^k
llvm-svn: 27395
2006-04-04 06:11:42 +00:00
Chris Lattner
a76347d917 Fix Transforms/IndVarsSimplify/2006-03-31-NegativeStride.ll and
PR726 by performing consistent signed division, not consistent unsigned
division when evaluating scev's.  Do not touch udivs.

llvm-svn: 27326
2006-04-01 04:48:52 +00:00
Andrew Lenharth
4130ea834c If adding a link to a collapsed, node, ignore offset.
Fixes 2006-03-27-LinkedCollapsed.ll

llvm-svn: 27194
2006-03-27 23:39:58 +00:00
Andrew Lenharth
fc55d15963 no heap is happening here
llvm-svn: 26781
2006-03-15 19:03:16 +00:00
Andrew Lenharth
b377837353 remove qsort for now
llvm-svn: 26779
2006-03-15 18:32:18 +00:00
Andrew Lenharth
ad29f8dfab allow field sensitivity to be a tunable parameter
llvm-svn: 26777
2006-03-15 05:43:41 +00:00
Andrew Lenharth
c285b5ff1f Handle one offset with growth case seen in povray. Namely, if we have an offset,
and the offset lands at a field boundary in the old type, construct a new type,
copying the fields masked by the offset from the old type, and unify with that.

llvm-svn: 26775
2006-03-15 04:04:21 +00:00
Andrew Lenharth
f3e73e10cf improve mem intrinsics and add a few things povray uses
llvm-svn: 26774
2006-03-15 03:43:59 +00:00
Nate Begeman
7c2afcfc02 Fix PR681 by using the standard Lengauer and Tarjan algorithm for dominator
set construction, rather than intersecting various std::sets.  This reduces
the memory usage for the testcase in PR681 from 496 to 26MB of ram on my
darwin system, and reduces the runtime from 32.8 to 0.8 seconds on a
2.5GHz G5.  This also enables future code sharing between Dom and PostDom
now that they share near-identical implementations.

llvm-svn: 26707
2006-03-11 02:20:46 +00:00
Chris Lattner
f53321422d Use autogenerated mod/ref info for intrinsics.
llvm-svn: 26670
2006-03-09 22:31:29 +00:00
Chris Lattner
805838e63e Fix a crash compiling Obsequi
llvm-svn: 26529
2006-03-04 21:48:01 +00:00
Chris Lattner
0d3abd353b Be more conservative with our symbolic alias analysis. In particular,
don't assume that A[1][0] and A[0][i] can't alias.  "i" might be out of
range, or even negative.  This fixes a miscompilation of 188.ammp (which
does bad pointer tricks) with the new CFE.

Testcase here: Analysis/BasicAA/2006-03-03-BadArraySubscript.ll

llvm-svn: 26515
2006-03-04 02:06:34 +00:00
Chris Lattner
4ccc8d7926 updates for recent changes
llvm-svn: 26481
2006-03-03 01:21:36 +00:00
Chris Lattner
ab22220755 Split memcpy/memset/memmove intrinsics into i32/i64 versions, resolving
PR709, and paving the way for future progress.

llvm-svn: 26476
2006-03-03 00:00:25 +00:00
Chris Lattner
f5f9a68dec add an assert
llvm-svn: 26178
2006-02-14 20:14:17 +00:00
Chris Lattner
151eb931ec Pull the InsertCastOfTo out of the header, implement CSE'ing of arguments.
llvm-svn: 25973
2006-02-04 09:51:53 +00:00
Chris Lattner
964e9b66f8 Value# select instructions, allowing -gcse to remove duplicates
llvm-svn: 25969
2006-02-04 09:15:29 +00:00
Chris Lattner
15ec384b49 Add explicit iostream #includes
llvm-svn: 25513
2006-01-22 23:19:18 +00:00
Chris Lattner
adff158fbd Add explicit #includes of <iostream>
llvm-svn: 25509
2006-01-22 22:53:01 +00:00
Reid Spencer
3cecd3c4cf For PR411:
This patch is an incremental step towards supporting a flat symbol table.
It de-overloads the intrinsic functions by providing type-specific intrinsics
and arranging for automatically upgrading from the old overloaded name to
the new non-overloaded name. Specifically:
  llvm.isunordered -> llvm.isunordered.f32, llvm.isunordered.f64
  llvm.sqrt -> llvm.sqrt.f32, llvm.sqrt.f64
  llvm.ctpop -> llvm.ctpop.i8, llvm.ctpop.i16, llvm.ctpop.i32, llvm.ctpop.i64
  llvm.ctlz -> llvm.ctlz.i8, llvm.ctlz.i16, llvm.ctlz.i32, llvm.ctlz.i64
  llvm.cttz -> llvm.cttz.i8, llvm.cttz.i16, llvm.cttz.i32, llvm.cttz.i64
New code should not use the overloaded intrinsic names. Warnings will be
emitted if they are used.

llvm-svn: 25366
2006-01-16 21:12:35 +00:00
Chris Lattner
551df64bd0 Change ET-Forest to automatically recalculate its DFSnum's if too many slow
queries are made.

Patch by Daniel Berlin!

llvm-svn: 25323
2006-01-14 20:55:09 +00:00
Chris Lattner
ab3707bf90 Add a new CallGraph::getOrInsertFunction for clients to use when updating
the callgraph.

llvm-svn: 25317
2006-01-14 20:03:00 +00:00
Chris Lattner
f75f017cae add a dump method to CallGraph
llvm-svn: 25314
2006-01-14 19:17:02 +00:00
Nate Begeman
4750001146 Add bswap intrinsics as documented in the Language Reference
llvm-svn: 25309
2006-01-14 01:25:24 +00:00
Chris Lattner
ed83d93696 Switch loopinfo to using ETForest instead of DominatorSet to compute itself.
Patch by Daniel Berlin!

llvm-svn: 25199
2006-01-11 05:08:29 +00:00
Reid Spencer
62f26934e7 Remove unused inclusion of SymbolTable.h
llvm-svn: 25170
2006-01-10 03:48:34 +00:00
Chris Lattner
4266c0b9cb 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

llvm-svn: 25146
2006-01-08 09:10:04 +00:00
Chris Lattner
84a9d11b28 Initial implementation of the ET-Forest data structure for dominators and
post-dominators.  This code was written/adapted by Daniel Berlin!

llvm-svn: 25144
2006-01-08 08:22:18 +00:00
Chris Lattner
63a5dea457 Make the -print-alias-sets pass work for printing out something other than
the default aa impl results.

llvm-svn: 25062
2006-01-03 06:05:22 +00:00
Chris Lattner
7f45e655a8 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!

llvm-svn: 24944
2005-12-22 06:07:52 +00:00
John Criswell
48bcd84894 Prefix DSA specific options with dsa.
Make the dsa-alloc-list and dsa-free-list options hidden.

llvm-svn: 24864
2005-12-19 20:14:38 +00:00
John Criswell
79deec95cc Added an option to specify the names of heap freeing functions.
llvm-svn: 24863
2005-12-19 19:54:23 +00:00
John Criswell
1e3346ebd3 Added a command line option that allows the user to specify a list of
functions that allocate memory.

llvm-svn: 24862
2005-12-19 17:38:39 +00:00
Sumant Kowshik
287f45f715 Collapsing node if variable length struct with final field of length zero
llvm-svn: 24621
2005-12-06 18:04:30 +00:00
Chris Lattner
bd00b4a18e post-dom-frontiers requires proper post-dominance
llvm-svn: 24409
2005-11-18 07:28:26 +00:00
Andrew Lenharth
177491a9a2 prevent cse of readcyclecounter
llvm-svn: 24303
2005-11-11 19:02:54 +00:00
Andrew Lenharth
dca2f13e76 continued readcyclecounter support
llvm-svn: 24300
2005-11-11 16:47:30 +00:00
Chris Lattner
2724ebe02e 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

llvm-svn: 24102
2005-10-30 06:24:33 +00:00
Chris Lattner
8a257558a0 remove a dead file
llvm-svn: 24085
2005-10-29 04:43:38 +00:00
John Criswell
0893d5847f Move some constant folding functions into LLVMAnalysis since they are used
by Analysis and Transformation passes.

llvm-svn: 24038
2005-10-27 16:00:10 +00:00
John Criswell
d6538108e8 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.

llvm-svn: 24036
2005-10-27 15:54:34 +00:00
Chris Lattner
22c8bcd5c6 Remove this pass, it is not useful
llvm-svn: 23949
2005-10-24 02:35:43 +00:00
Chris Lattner
e6f7a38925 DONT_BUILD_RELINKED is gone and implied by BUILD_ARCHIVE now
llvm-svn: 23940
2005-10-24 02:26:13 +00:00
Chris Lattner
a4b13acd52 Only build .a file versions of these libraries, instead of .a and .o versions.
This should speed up build times.

llvm-svn: 23933
2005-10-24 01:59:48 +00:00
Chris Lattner
ffba9fcbff don't bother building the archive version of this library
llvm-svn: 23927
2005-10-24 01:08:20 +00:00
Chris Lattner
17f407da37 expose a ctor
llvm-svn: 23924
2005-10-24 01:00:45 +00:00
Chris Lattner
a1b11b2aa4 implement some prototypes
llvm-svn: 23920
2005-10-24 00:38:38 +00:00
Chris Lattner
67d9e82237 move this to the analyze tool
llvm-svn: 23918
2005-10-24 00:27:36 +00:00
Chris Lattner
8503ee5b01 wrap a long line
llvm-svn: 23507
2005-09-28 22:30:58 +00:00
Chris Lattner
ab0448905e Add a new getLoopLatch() method.
llvm-svn: 23315
2005-09-12 17:03:55 +00:00
Chris Lattner
f369fd383d floor/ceil don't read/write memory. This allows gcse to eliminate 6 calls
in mesa.

llvm-svn: 23015
2005-08-24 16:58:56 +00:00
Chris Lattner
3bfebb1e8f Fix Transforms/LoopStrengthReduce/2005-08-15-AddRecIV.ll
llvm-svn: 22797
2005-08-16 00:37:01 +00:00
Chris Lattner
c2cbe96e25 Teach LLVM to know how many times a loop executes when constructed with
a < expression, e.g.: for (i = m; i < n; ++i)

llvm-svn: 22793
2005-08-15 23:33:51 +00:00
Chris Lattner
0730ac081a Fix an obvious oops
llvm-svn: 22742
2005-08-10 00:59:40 +00:00
Chris Lattner
6ca08d5739 implement two helper methods
llvm-svn: 22736
2005-08-09 23:36:33 +00:00
Misha Brukman
e094f6c611 * Unbreak optimized build (noticed by Eric van Riet Paap)
* Comment #endif clauses for readability

llvm-svn: 22646
2005-08-04 14:16:48 +00:00
Chris Lattner
62b0ecdfb8 add support for Graphviz when viewing CFGs
llvm-svn: 22620
2005-08-03 17:55:05 +00:00
Nate Begeman
0d1a7b6737 Break SCEVExpander out of IndVarSimplify into its own .h/.cpp file so that
other passes may use it.

llvm-svn: 22557
2005-07-30 00:12:19 +00:00
Jeff Cohen
bd51ec7461 Eliminate all remaining tabs and trailing spaces.
llvm-svn: 22523
2005-07-27 06:12:32 +00:00
Andrew Lenharth
10f725f64b Remove glibc specific functions, and mark a couple as C99
llvm-svn: 22384
2005-07-11 20:35:20 +00:00
Andrew Lenharth
8089fbc902 because on alpha:
#   define errno (*__errno_location ())

*shakes head

llvm-svn: 22383
2005-07-11 17:41:12 +00:00
Andrew Lenharth
4e1c8055ea the correct fix was to fix AliasAnalysis.getModRefInfo
llvm-svn: 22268
2005-06-20 15:25:22 +00:00
Andrew Lenharth
262b657737 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.
llvm-svn: 22266
2005-06-20 15:02:05 +00:00
Andrew Lenharth
a9214fec08 core changes for varargs
llvm-svn: 22254
2005-06-18 18:34:52 +00:00
Chris Lattner
5a7f1642b7 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

llvm-svn: 21796
2005-05-08 23:58:12 +00:00
Chris Lattner
4f7bba1106 These intrinsics do not access memory
llvm-svn: 21718
2005-05-06 05:21:04 +00:00
Misha Brukman
d29b27d73b Remove extra blank line
llvm-svn: 21706
2005-05-05 23:43:47 +00:00
Chris Lattner
234ffe2395 Add llvm.sqrt intrinsic, patch contributed by Morten Ofstad
llvm-svn: 21627
2005-04-30 03:44:07 +00:00
Chris Lattner
fb0d0ea349 These functions can set errno!
llvm-svn: 21609
2005-04-28 21:52:31 +00:00
Chris Lattner
5dc0b9e938 Make interval partition print correctly, patch contributed by
Vladimir Prus!

llvm-svn: 21566
2005-04-26 14:48:28 +00:00
Chris Lattner
bab9c90db4 Correctly handle global-argument aliases induced in main
llvm-svn: 21537
2005-04-25 19:16:31 +00:00
Chris Lattner
e39652d21c Don't mess up SCC traversal when a node has null edges out of it.
llvm-svn: 21536
2005-04-25 19:16:17 +00:00
Chris Lattner
0bc1588c47 Propagate eq sets through the bu graphs to the cbu and eq graphs, fixing
a crash of the sfv on 188.ammp

llvm-svn: 21478
2005-04-23 21:11:05 +00:00
Chris Lattner
c638ca05a0 Malloc/Free have mod/ref effects. Do not allow CSE of function calls that
call malloc/free.  This fixes PR555.

llvm-svn: 21443
2005-04-22 05:36:59 +00:00
Misha Brukman
a9a1982a44 Convert tabs to spaces
llvm-svn: 21439
2005-04-22 04:01:18 +00:00
Misha Brukman
122d682689 Remove trailing whitespace
llvm-svn: 21416
2005-04-21 21:13:18 +00:00
Chris Lattner
9d2c6a3981 add support for taking and resolving the address of free.
llvm-svn: 21396
2005-04-21 16:09:43 +00:00
Chris Lattner
f8d9224d8c Fix a crash analyzing MultiSource/Benchmarks/MallocBench/gs
llvm-svn: 21245
2005-04-12 03:59:27 +00:00
Chris Lattner
49d166c6b6 Don't make this require loopsimplify. It works BETTER with loop simplify
but should not require it.

llvm-svn: 21123
2005-04-06 21:45:00 +00:00
Chris Lattner
c5b8fbe7f9 do not crash when using -debug
llvm-svn: 21092
2005-04-05 01:12:03 +00:00
Chris Lattner
57ea4daa2e 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

llvm-svn: 21088
2005-04-04 22:23:21 +00:00
Chris Lattner
0938200804 fix some VC compilation problems, thanks to Jeff C for pointing this out!
llvm-svn: 21044
2005-04-02 20:17:09 +00:00
Chris Lattner
e6d28e8aac EquivClassGraphs is now in DataStructure.h
llvm-svn: 21042
2005-04-02 20:08:17 +00:00
Chris Lattner
54ab60f08d use a callee_iterator typedef.
llvm-svn: 21038
2005-04-02 20:02:41 +00:00
Chris Lattner
23ef46ddca 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.

llvm-svn: 21031
2005-04-02 19:17:18 +00:00
Chris Lattner
761bb09edb import all of the rest of the stubs that dsa uses for direct comparison
llvm-svn: 20932
2005-03-29 20:36:05 +00:00
Chris Lattner
94ea4d104c learn about some more functions.
llvm-svn: 20929
2005-03-29 20:04:24 +00:00
Chris Lattner
cc1644eb2c Fix a problem where we not marking incoming arguments to functions with
external linkage as incomplete.

llvm-svn: 20927
2005-03-29 19:16:59 +00:00
Chris Lattner
39064a8ca0 there is no point comparing against null pointer.
llvm-svn: 20925
2005-03-29 17:44:52 +00:00
Chris Lattner
5ceaf630ab 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)

llvm-svn: 20922
2005-03-29 17:21:53 +00:00
Chris Lattner
4f9c2cde55 add some more functions, ignore setcc for constraints!
llvm-svn: 20917
2005-03-29 06:52:20 +00:00
Chris Lattner
813ef90a12 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

llvm-svn: 20914
2005-03-29 06:09:07 +00:00
Chris Lattner
47fcba56f8 Teach andersens that non-escaping memory cannot be mod/ref'd by external fn calls.
llvm-svn: 20891
2005-03-28 06:21:17 +00:00
Misha Brukman
b97b449309 Fix grammar
llvm-svn: 20890
2005-03-28 04:32:12 +00:00
Chris Lattner
abb512a593 Make anders-aa much more precise by not being completely pessimistic about
external functions.  Teach it about a few important ones.

llvm-svn: 20889
2005-03-28 04:03:52 +00:00
Chris Lattner
691b1987e1 wrap some long lines
llvm-svn: 20884
2005-03-27 22:03:46 +00:00
Chris Lattner
6b31704450 remove ...
llvm-svn: 20883
2005-03-27 21:57:09 +00:00
Chris Lattner
15741f8877 speed up steens by using spliceFrom, improve its precision by realizing that
an incomplete node cannot alias a complete node.

llvm-svn: 20882
2005-03-27 21:56:55 +00:00
Chris Lattner
7f0903e187 teach andersens about undef
llvm-svn: 20881
2005-03-27 18:58:23 +00:00
Chris Lattner
de6cc372e3 Don't give up completely, maybe other AA can say something about this.
llvm-svn: 20873
2005-03-27 00:02:33 +00:00
Chris Lattner
3a88055932 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)

llvm-svn: 20872
2005-03-26 23:56:33 +00:00
Chris Lattner
b84076a278 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

llvm-svn: 20871
2005-03-26 23:29:03 +00:00
Chris Lattner
21d25dd835 Remove more long dead code: dsa doesn't provide must alias info
llvm-svn: 20870
2005-03-26 22:54:46 +00:00
Chris Lattner
8638fbf4d6 remove some unsafe code that has long been dead
llvm-svn: 20869
2005-03-26 22:48:42 +00:00
Chris Lattner
ee96215ded slightly improve mod/ref for DSAA by checking the globals graph for fallback
llvm-svn: 20868
2005-03-26 22:47:03 +00:00
Chris Lattner
02275101be 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.

llvm-svn: 20867
2005-03-26 22:43:20 +00:00
Chris Lattner
bbec058833 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.

llvm-svn: 20866
2005-03-26 22:16:44 +00:00
Chris Lattner
d11e075664 no really, don't double count these nodes either!
llvm-svn: 20837
2005-03-25 20:54:45 +00:00
Chris Lattner
81e77226bb Don't count all of the nodes in the SCC once for each function in the SCC.
llvm-svn: 20836
2005-03-25 20:37:32 +00:00
Chris Lattner
14fd1844ba 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.

llvm-svn: 20834
2005-03-25 16:45:43 +00:00
Chris Lattner
549f99e537 Treat free operations as volatile, since they cannot be moved. This fixes
Transforms/LICM/2005-03-24-LICM-Aggregate-Crash.ll

llvm-svn: 20830
2005-03-25 05:49:37 +00:00
Chris Lattner
52e28abe6e remove a debugging timer.
llvm-svn: 20827
2005-03-25 00:06:09 +00:00
Chris Lattner
5d60f10a1d 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.

llvm-svn: 20826
2005-03-25 00:05:04 +00:00
Chris Lattner
02206c42f2 Make the spliceFrom case where one graph is completely empty be constant time.
llvm-svn: 20825
2005-03-25 00:02:41 +00:00
Chris Lattner
a90eb0ff31 add a new DSGraph::spliceFrom method, which violently takes the content of
one graph and plops it into another, without breaking a sweat.

llvm-svn: 20824
2005-03-24 23:46:04 +00:00
Chris Lattner
5f6b30b7c0 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 :)

llvm-svn: 20820
2005-03-24 23:06:02 +00:00
Chris Lattner
dec4b495c9 only look at successors of globals. This gets us down to "only" 22s in the
bu pass for 176.gcc

llvm-svn: 20818
2005-03-24 21:17:27 +00:00
Chris Lattner
0a5c8b7f21 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

llvm-svn: 20817
2005-03-24 21:07:47 +00:00
Chris Lattner
32dc61b75e don't bother |'ing in 0's
llvm-svn: 20815
2005-03-24 18:42:51 +00:00
Chris Lattner
0530cce5a5 be more aggressive about incompleteness marking
llvm-svn: 20814
2005-03-24 18:42:28 +00:00
Chris Lattner
120bfecc01 Fix a crash while promoting a value out of a loop from a global variable
when using ds-aa

llvm-svn: 20802
2005-03-24 04:22:04 +00:00
Chris Lattner
586f97a8b6 teach ds-aa about mod/ref for external function calls.
llvm-svn: 20801
2005-03-24 03:04:50 +00:00
Chris Lattner
1a860712dc Simplify dead code into a fixme :)
llvm-svn: 20800
2005-03-24 02:41:19 +00:00
Chris Lattner
1dfea3e0f7 fix a compiler crash in runtime/libprofile
llvm-svn: 20799
2005-03-24 01:22:52 +00:00
Chris Lattner
be7663e15e wrap a long line
llvm-svn: 20797
2005-03-23 23:51:12 +00:00
Chris Lattner
78ee200153 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

llvm-svn: 20796
2005-03-23 23:49:47 +00:00
Chris Lattner
e64b77f6c3 Make this more efficient by only making one virtual method call.
llvm-svn: 20793
2005-03-23 23:26:58 +00:00
Chris Lattner
db762dadcb Make this a bit more aggressive
llvm-svn: 20792
2005-03-23 22:06:41 +00:00
Chris Lattner
03631d6bc4 a hack to allow count-aa to work with ds-aa :(
llvm-svn: 20791
2005-03-23 21:59:34 +00:00