Owen Anderson
8c36469880
Reserve the size we'll need in advance.
...
llvm-svn: 52763
2008-06-26 04:47:41 +00:00
Eric Christopher
4f05c48718
Move GetConstantStringInfo to lib/Analysis. Remove
...
string output routine from Constant. Update all
callers. Change debug intrinsic api slightly to
accomodate move of routine, these now return values
instead of strings.
llvm-svn: 52748
2008-06-26 00:31:12 +00:00
Dan Gohman
90894ac18b
Generalize createSCEV to be able to form SCEV expressions from
...
ConstantExprs.
llvm-svn: 52615
2008-06-22 19:56:46 +00:00
Dan Gohman
81c83d9a1d
Use SCEVAddRecExpr::isAffine.
...
llvm-svn: 52614
2008-06-22 19:23:09 +00:00
Dan Gohman
311865bd24
Move a few more SCEVExpander methods out-of-line.
...
llvm-svn: 52612
2008-06-22 19:09:18 +00:00
Chris Lattner
76d8bbc7c2
fix warning when assertions disabled.
...
llvm-svn: 52589
2008-06-21 19:48:22 +00:00
Duncan Sands
054b82d555
Fix some warnings reported by gcc-4.3. Hopefully
...
this still compiles on windows - I can't test!
llvm-svn: 52488
2008-06-19 08:47:31 +00:00
Dan Gohman
606a60ad68
Move SCEVExpander::visitAddExpr out-of-line.
...
llvm-svn: 52464
2008-06-18 16:37:11 +00:00
Dan Gohman
82f9df016e
Move LSR's private isZero function to a public SCEV member
...
function, and make use of it in several places.
llvm-svn: 52463
2008-06-18 16:23:07 +00:00
Matthijs Kooijman
dd18157e57
Use a SmallVector instead of an array, since auto_ptr doesn't handle arrays
...
properly.
llvm-svn: 52390
2008-06-17 08:24:37 +00:00
Matthijs Kooijman
2ba9a750dd
Make BuildSubAggregate use FindInsertedElement again to prevent it from
...
inserting extractvalues. In particular, this prevents the insertion of
extractvalues that can't be folded away later. Also add an example of when this
stuff is needed.
llvm-svn: 52328
2008-06-16 14:13:46 +00:00
Matthijs Kooijman
544c9b2fb0
Make the InsertBefore argument to FindInsertedValue optional, so you can find an inserted value without modifying the code.
...
llvm-svn: 52319
2008-06-16 13:28:31 +00:00
Matthijs Kooijman
238b1e8d69
Pass around Instruction* instead of Instruction& in FindInsertedValue and friends.
...
llvm-svn: 52318
2008-06-16 13:13:08 +00:00
Matthijs Kooijman
dedcf00fcc
80 column fixes.
...
llvm-svn: 52316
2008-06-16 12:57:37 +00:00
Matthijs Kooijman
1dd7d9cdc1
Move FindScalarValue from InstructionCombining.cpp to ValueTracking.cpp. While
...
I'm at it, rename it to FindInsertedValue.
The only functional change is that newly created instructions are no longer
added to instcombine's worklist, but that is not really necessary anyway (and
I'll commit some improvements next that will completely remove the need).
llvm-svn: 52315
2008-06-16 12:48:21 +00:00
Chris Lattner
0bc9e4aa8f
simplify some code by using a helper function. This really really
...
wants a 'nocapture' predicate.
llvm-svn: 52304
2008-06-16 06:38:26 +00:00
Chris Lattner
35be1f6c83
move a bunch of predicates up into their own section
...
in this file, no other changes.
llvm-svn: 52303
2008-06-16 06:30:22 +00:00
Chris Lattner
12453dd555
Other parts of this code treat noalias arguments as objects for
...
the purposes of escape analysis.
llvm-svn: 52302
2008-06-16 06:28:01 +00:00
Chris Lattner
e987a3bdd1
If we are checking to see if the result of a call aliases a
...
pointer derived from a local allocation, if the local allocation
never escapes, the pointers can't alias. This implements PR2436
llvm-svn: 52301
2008-06-16 06:19:11 +00:00
Chris Lattner
4e38446b34
Refactor basicaa's main alias function somethin' fierce.
...
This fixes several minor bugs (such as returning noalias
for comparisons between external weak functions an null) but
is mostly a cleanup.
llvm-svn: 52299
2008-06-16 06:10:11 +00:00
Wojciech Matyjewicz
58f5cc8864
Fix PR2434. When scanning for exising binary operator to reuse don't
...
take into account the instrucion pointed by InsertPt. Thanks to it,
returning the new value of InsertPt to the InsertBinop() caller can be
avoided. The bug was, actually, in visitAddRecExpr() method which wasn't
correctly handling changes of InsertPt. There shouldn't be any
performance regression, as -gvn pass (run after -indvars) removes any
redundant binops.
llvm-svn: 52291
2008-06-15 19:07:39 +00:00
Wojciech Matyjewicz
f66a7fe9de
Change 'while' loop to 'do' loop.
...
Add a safety measure. It isn't safe to assume in ScalarEvolutionExpander that
all loops are in canonical form (but it should be safe for loops that have
AddRecs).
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
llvm-svn: 52275
2008-06-14 16:48:22 +00:00
Nick Lewycky
0aa53f2b52
Crash less. The i64 restriction in BinomialCoefficient caused some problems
...
with code that was expecting different bit widths for different values.
Make getTruncateOrZeroExtend a method on ScalarEvolution, and use it.
llvm-svn: 52248
2008-06-13 04:38:55 +00:00
Chris Lattner
67a5a4eba8
Expose a public interface to this pass.
...
llvm-svn: 52029
2008-06-05 23:45:18 +00:00
Chris Lattner
ea07bf8c1b
Let libcall semantics decide whether it knows about functions
...
with definitions or not.
llvm-svn: 52028
2008-06-05 23:38:34 +00:00
Matthijs Kooijman
1fd76cd396
Update comments and documentation to reflect that GCSE and ValueNumbering are
...
deprecated by the GVN and GVNPRE passes.
llvm-svn: 51983
2008-06-05 07:55:49 +00:00
Matthijs Kooijman
a03f85df05
Replace two manual loops with calls to CallSite::hasArguments (no functional changes).
...
llvm-svn: 51947
2008-06-04 16:57:50 +00:00
Chris Lattner
5839247e92
Add #includes required by GCC 4.3, thanks for Zhongxing Xu
...
for reporting this.
llvm-svn: 51926
2008-06-04 04:46:14 +00:00
Chris Lattner
3e1cd5c9bf
Remove unneeded code I added.
...
llvm-svn: 51878
2008-06-02 18:39:07 +00:00
Wojciech Matyjewicz
06e4c8a420
Fixes PR2395. Looking for a constant in a GEP tail (when the first GEP
...
is longer than the second one) should stop after finding one. Added break
instruction guarantees it. It also changes difference between offsets to
absolute value of this difference in the condition.
llvm-svn: 51875
2008-06-02 17:26:12 +00:00
Chris Lattner
ea60f0ccc3
move CannotBeNegativeZero to ValueTracking. Simplify some signbit comparisons.
...
llvm-svn: 51864
2008-06-02 01:29:46 +00:00
Chris Lattner
4960857273
move ComputeMaskedBits, MaskedValueIsZero, and ComputeNumSignBits
...
out of instcombine into a new file in libanalysis. This also teaches
ComputeNumSignBits about the number of sign bits in a constantint.
llvm-svn: 51863
2008-06-02 01:18:21 +00:00
Owen Anderson
ee111c28b8
Remember to update the reverse non-local cache when cleaning up dirty entries. This fixes PR2397.
...
llvm-svn: 51846
2008-06-01 21:03:52 +00:00
Owen Anderson
67a1d5ec35
Make ping more aggressive in finding nonlocal caching errors.
...
llvm-svn: 51845
2008-06-01 20:51:41 +00:00
Dan Gohman
15eb8b47aa
Fix a typo in a comment.
...
llvm-svn: 51718
2008-05-30 00:08:18 +00:00
Dan Gohman
24ad4a21e3
Fix a copy+paste error in a comment.
...
llvm-svn: 51717
2008-05-30 00:02:02 +00:00
Owen Anderson
0eabbbfc58
Add newline at end of file.
...
llvm-svn: 51701
2008-05-29 21:05:16 +00:00
Owen Anderson
0e26c5897a
Force postdom to be linked into opt and bugpoint, even though it is no longer used by any passes.
...
llvm-svn: 51686
2008-05-29 17:00:13 +00:00
Gabor Greif
39350bab39
convert another operand loop to iterator formulation
...
llvm-svn: 51661
2008-05-29 00:51:08 +00:00
Dan Gohman
4b11213552
Use Function::getEntryBlock instead of Function::begin, for clarity.
...
llvm-svn: 51613
2008-05-27 20:55:29 +00:00
Dan Gohman
327d2c6167
Print debug output when any edge becomes executable, including
...
the first visited edge.
llvm-svn: 51612
2008-05-27 20:47:30 +00:00
Duncan Sands
4757a8dd76
Fix some constructs that gcc-4.4 warns about.
...
llvm-svn: 51591
2008-05-27 11:50:51 +00:00
Nick Lewycky
f24743a6bb
Don't treat values as signed when looking at loop steppings in HowForToNonZero.
...
llvm-svn: 51560
2008-05-25 23:43:32 +00:00
Nick Lewycky
744dad8004
"ret (constexpr)" can't be folded into a Constant. Add a method to
...
Analysis/ConstantFolding to fold ConstantExpr's, then make instcombine use it
to try to use targetdata to fold constant expressions on void instructions.
Also extend the icmp(inttoptr, inttoptr) folding to handle the case where
int size != ptr size.
llvm-svn: 51559
2008-05-25 20:56:15 +00:00
Dan Gohman
f25b89f697
Use isSingleValueType instead of isFirstClassType to
...
exclude struct and array types.
llvm-svn: 51452
2008-05-22 23:43:22 +00:00
Gabor Greif
0c41f351cc
transform more loops to iterator form, detabify
...
llvm-svn: 51436
2008-05-22 19:24:54 +00:00
Gabor Greif
0c8b237857
Rewrite operand loops to use iterators. This shrinks .o file (at gcc4.0.1 -O3 x86) substantially (>500 bytes). Reason still unknown.
...
llvm-svn: 51423
2008-05-22 06:43:33 +00:00
Chris Lattner
5a09a5fb88
Free and vaarg are not really volatile.
...
llvm-svn: 51407
2008-05-22 03:23:06 +00:00
Gabor Greif
aa0a5c230c
suppress gcc3.4.6's <no value returned> warnings
...
llvm-svn: 51372
2008-05-21 14:07:30 +00:00
Chris Lattner
821dc30131
Fix PR2346 by marking vaarg as volatile so that licm doesn't try to
...
hoist them.
llvm-svn: 51356
2008-05-20 22:05:28 +00:00