1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-28 06:22:51 +01:00
Commit Graph

1796 Commits

Author SHA1 Message Date
Devang Patel
0fc2badc38 Fix typos in comments.
Thanks for the feedback!

llvm-svn: 52978
2008-07-01 19:50:56 +00:00
Devang Patel
1e1f4a0bdd Add dom info verifier.
llvm-svn: 52967
2008-07-01 17:44:24 +00:00
Owen Anderson
99a71c6ac6 Properly handle cases where a predecessor of the block being queried on is unreachable.
This fixes PR2503, though we should also fix other passes not to emit this kind of code.

llvm-svn: 52946
2008-07-01 00:40:58 +00:00
Evan Cheng
2005804de6 - Re-apply 52748 and friends with fix. GetConstantStringInfo() returns an empty string for ConstantAggregateZero case which surprises selectiondag.
- Correctly handle memcpy from constant string which is zero-initialized.

llvm-svn: 52891
2008-06-30 07:31:25 +00:00
Nick Lewycky
d63159dcd4 Add a value range analysis that lazily computes ranges using ScalarEvolutions.
llvm-svn: 52885
2008-06-30 00:04:21 +00:00
Anton Korobeynikov
6f260767ec Revert (52748 and friends):
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.

This unbreaks llvm-gcc bootstrap.

llvm-svn: 52884
2008-06-29 17:57:03 +00:00
Chris Lattner
090d81df5e Add back the capability to include nul characters in strings with
GetConstantStringInfo.  This will hopefully restore llvm-gcc to 
happy bootstrap land.

llvm-svn: 52851
2008-06-28 05:33:32 +00:00
Chris Lattner
98b286ff98 Tighten up checking.
llvm-svn: 52850
2008-06-28 04:37:04 +00:00
Chris Lattner
c94b39d65c fix the regressions from Eric's patch by making GetConstantStringInfo
tolerate a non-nul-terminated string, and handling a direct global 
reference.

llvm-svn: 52813
2008-06-27 03:36:51 +00:00
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