Commit Graph

1910 Commits

Author SHA1 Message Date
Duncan Sands
81b06be055 Teach constant folding that an inttoptr of a
ptrtoint can be turned into a bitcast if the
integer is at least as wide as a pointer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54752 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-13 20:20:35 +00:00
Dan Gohman
3837218ea0 Extend ScalarEvolution's executesAtLeastOnce logic to be able to
continue past the first conditional branch when looking for a
relevant test. This helps it avoid using MAX expressions in
loop trip counts in more cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54697 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-12 20:17:31 +00:00
Chris Lattner
afcde473c5 "This patch adds a virtual call to AbstractLatticeFunction to derive a
type lattice value for an Argument*, giving clients the opportunity to
use something other than Top for it if they choose to."

Patch by John McCall!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54589 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 17:23:35 +00:00
Dan Gohman
d9cc749318 Canonicalize nested AddRecs in by nesting them in order of loop depth.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54545 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 18:33:12 +00:00
Chris Lattner
0dabb7e8f3 Don't call getAnalysisUsage unless -debug-pass is enabled. This speeds
up the passmgr by avoiding useless work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54528 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 15:14:09 +00:00
Eli Friedman
b42a626122 PR2621: Improvements to the SCEV AddRec binomial expansion. This
version uses a new algorithm for evaluating the binomial coefficients 
which is significantly more efficient for AddRecs of more than 2 terms 
(see the comments in the code for details on how the algorithm works).  
It also fixes some bugs: it removes the arbitrary length restriction for 
AddRecs, it fixes the silent generation of incorrect code for AddRecs 
which require a wide calculation width, and it fixes an issue where we 
were incorrectly truncating the iteration count too far when evaluating 
an AddRec expression narrower than the induction variable.

There are still a few related issues I know of: I think there's 
still an issue with the SCEVExpander expansion of AddRec in terms of
the width of the induction variable used.  The hack to avoid generating 
too-wide integers shouldn't be necessary; instead, the callers should be 
considering the cost of the expansion before expanding it (in addition 
to not expanding too-wide integers, we might not want to expand 
expressions that are really expensive, especially when optimizing for 
size; calculating an length-17 32-bit AddRec currently generates about 250 
instructions of straight-line code on X86).  Also, for long 32-bit 
AddRecs on X86, CodeGen really sucks at scheduling the code.  I'm planning on 
filing follow-up PRs for these issues.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54332 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-04 23:49:06 +00:00
Eli Friedman
1fbffe0cef Another SCEV issue from PR2607; essentially the same issue, but this
time applying to the implicit comparison in smin expressions. The 
correct way to transform an inequality into the opposite 
inequality, either signed or unsigned, is with a not expression.

I looked through the SCEV code, and I don't think there are any more 
occurrences of this issue.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54194 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-30 04:36:32 +00:00
Eli Friedman
068acc3caa Fix for PR2607: SCEV miscomputing the loop count for loops with an
SGT exit condition.  Essentially, the correct way to flip an inequality 
in 2's complement is the not operator, not the negation operator.  
That said, the difference only affects cases involving INT_MIN.

Also, enhance the pre-test search logic to be a bit smarter about 
inequalities flipped with a not operator, so it can eliminate the smax 
from the iteration count for simple loops.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54184 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-30 00:04:08 +00:00
Owen Anderson
d4310a5d41 Fix a subtle bug when removing instructions from memdep. In very specific
circumstances we could end up remapping a dependee to the same instruction 
that we're trying to remove.  Handle this properly by just falling back to
a conservative solution.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54132 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-28 16:00:58 +00:00
Nate Begeman
b5557abcf1 Fix minor issues with VICmp/VFCmp constant expressions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54030 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-25 17:35:37 +00:00
Nick Lewycky
9e13cbc171 Revert r53812 -- premature. LegalizeTypes isn't actually on yet!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53816 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 04:03:00 +00:00
Nick Lewycky
2ceb40f3da Switch on the use of arbitrary precision integers in scalar evolution. This will
bail after 256-bits to avoid producing code that the backends can't handle.
Previously, we capped it at 64-bits, preferring to miscompile in those cases.

This change also reverts much of r52248 because the invariants the code was
expecting are now being met.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53812 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 02:51:31 +00:00
Wojciech Matyjewicz
8b82c49084 This header isn't necessary now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53811 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-20 17:35:32 +00:00
Wojciech Matyjewicz
de0f2382e4 Fix PR2088. Use modulo linear equation solver to compute loop iteration
count.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53810 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-20 15:55:14 +00:00
Matthijs Kooijman
dddc827125 Don't use ++idx_begin when I actually mean idx_begin + 1, especially since we
also use *idx_begin in the same expression, giving unpredictable results.

This fixes this bug: http://lists.cs.uiuc.edu/pipermail/llvmdev/2008-July/015877.html



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53670 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-16 10:47:35 +00:00
Nick Lewycky
8ae38e1516 Correct this inversion!
I swear that didn't show up in svn diff...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53587 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-15 03:47:44 +00:00
Nick Lewycky
86dae65baa Fix up comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53586 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-15 03:40:27 +00:00
Nick Lewycky
59cff12f88 Stop creating extraneous smax/umax in SCEV. This removes a regression where we
started complicating many loops ('for' loops, in fact).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53508 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-12 07:41:32 +00:00
Dan Gohman
e6acf36dca Fix spelling of "hierarchy" in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53489 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 22:51:32 +00:00
Dan Gohman
c418bf3dd5 Use find instead of lower_bound.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53474 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 20:58:19 +00:00
Nick Lewycky
b0b046848f Remove getValueRange from SCEV. It wasn't doing anything there anyways, and a
more complete version is now available from the LoopVR pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53269 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 03:21:51 +00:00
Nick Lewycky
6177fd4fce Expand SCEVUDiv of power of 2 to a lshr instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53217 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-08 05:05:37 +00:00
Nick Lewycky
01eaf803ca Handle 'lshr' instruction with SCEVUDiv object.
Comment the xor %x, -1 case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53167 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 06:15:49 +00:00
Devang Patel
70c09c54b1 Keep track of inherited analysis (e.g. dominator tree).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53088 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-03 07:02:30 +00:00
Owen Anderson
f2aa160b35 A better fix for PR2503 that doesn't pessimize GVN in the presence of unreachable blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53032 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-02 17:20:16 +00:00
Devang Patel
844a3d163b Fix typos in comments.
Thanks for the feedback!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52978 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 19:50:56 +00:00
Devang Patel
5b57e720c8 Add dom info verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52967 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 17:44:24 +00:00
Owen Anderson
c4b871c650 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52946 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 00:40:58 +00:00
Evan Cheng
0ff39b3feb - 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52891 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 07:31:25 +00:00
Nick Lewycky
a11e2eb845 Add a value range analysis that lazily computes ranges using ScalarEvolutions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52885 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 00:04:21 +00:00
Anton Korobeynikov
6d116bc7ce 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52884 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-29 17:57:03 +00:00
Chris Lattner
b746b82113 Add back the capability to include nul characters in strings with
GetConstantStringInfo.  This will hopefully restore llvm-gcc to 
happy bootstrap land.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52851 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-28 05:33:32 +00:00
Chris Lattner
3284d42c17 Tighten up checking.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52850 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-28 04:37:04 +00:00
Chris Lattner
3648f9f0ae fix the regressions from Eric's patch by making GetConstantStringInfo
tolerate a non-nul-terminated string, and handling a direct global 
reference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52813 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 03:36:51 +00:00
Owen Anderson
aefacb5972 Reserve the size we'll need in advance.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52763 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-26 04:47:41 +00:00
Eric Christopher
0d2b0aba42 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52748 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-26 00:31:12 +00:00
Dan Gohman
6c459a28ec Generalize createSCEV to be able to form SCEV expressions from
ConstantExprs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52615 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-22 19:56:46 +00:00
Dan Gohman
17f1972c77 Use SCEVAddRecExpr::isAffine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52614 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-22 19:23:09 +00:00
Dan Gohman
11f6d3b478 Move a few more SCEVExpander methods out-of-line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52612 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-22 19:09:18 +00:00
Chris Lattner
9d2c9bd113 fix warning when assertions disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52589 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-21 19:48:22 +00:00
Duncan Sands
9954c76f2c Fix some warnings reported by gcc-4.3. Hopefully
this still compiles on windows - I can't test!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52488 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 08:47:31 +00:00
Dan Gohman
e24fa64d52 Move SCEVExpander::visitAddExpr out-of-line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52464 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-18 16:37:11 +00:00
Dan Gohman
cfeb6a4506 Move LSR's private isZero function to a public SCEV member
function, and make use of it in several places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52463 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-18 16:23:07 +00:00
Matthijs Kooijman
3faf9df08f Use a SmallVector instead of an array, since auto_ptr doesn't handle arrays
properly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52390 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-17 08:24:37 +00:00
Matthijs Kooijman
0a9aaf46be 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52328 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 14:13:46 +00:00
Matthijs Kooijman
9772891219 Make the InsertBefore argument to FindInsertedValue optional, so you can find an inserted value without modifying the code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52319 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 13:28:31 +00:00
Matthijs Kooijman
0a7413dad8 Pass around Instruction* instead of Instruction& in FindInsertedValue and friends.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52318 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 13:13:08 +00:00
Matthijs Kooijman
710eb236e6 80 column fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52316 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 12:57:37 +00:00
Matthijs Kooijman
b23d5adbc8 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52315 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 12:48:21 +00:00
Chris Lattner
25df20f169 simplify some code by using a helper function. This really really
wants a 'nocapture' predicate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52304 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 06:38:26 +00:00
Chris Lattner
defa1c8034 move a bunch of predicates up into their own section
in this file, no other changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52303 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 06:30:22 +00:00
Chris Lattner
e7275794d3 Other parts of this code treat noalias arguments as objects for
the purposes of escape analysis.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52302 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 06:28:01 +00:00
Chris Lattner
845f0d2f0f 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52301 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 06:19:11 +00:00
Chris Lattner
a413960a48 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52299 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 06:10:11 +00:00
Wojciech Matyjewicz
8a08769bad 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52291 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-15 19:07:39 +00:00
Wojciech Matyjewicz
5d2bc857ec 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52275 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-14 16:48:22 +00:00
Nick Lewycky
6f8abf929a 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52248 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-13 04:38:55 +00:00
Chris Lattner
5c490610a1 Expose a public interface to this pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52029 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 23:45:18 +00:00
Chris Lattner
15ccbf59a9 Let libcall semantics decide whether it knows about functions
with definitions or not.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52028 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 23:38:34 +00:00
Matthijs Kooijman
845f524c25 Update comments and documentation to reflect that GCSE and ValueNumbering are
deprecated by the GVN and GVNPRE passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51983 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 07:55:49 +00:00
Matthijs Kooijman
227c27dd06 Replace two manual loops with calls to CallSite::hasArguments (no functional changes).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51947 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 16:57:50 +00:00
Chris Lattner
32a9e7a265 Add #includes required by GCC 4.3, thanks for Zhongxing Xu
for reporting this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51926 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 04:46:14 +00:00
Chris Lattner
d82e511aec Remove unneeded code I added.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51878 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-02 18:39:07 +00:00
Wojciech Matyjewicz
98e3a6829a 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51875 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-02 17:26:12 +00:00
Chris Lattner
833f25d79e move CannotBeNegativeZero to ValueTracking. Simplify some signbit comparisons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51864 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-02 01:29:46 +00:00
Chris Lattner
173234a68f 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51863 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-02 01:18:21 +00:00
Owen Anderson
6bd15ce03f Remember to update the reverse non-local cache when cleaning up dirty entries. This fixes PR2397.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51846 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-01 21:03:52 +00:00
Owen Anderson
d8f34fa3d6 Make ping more aggressive in finding nonlocal caching errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51845 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-01 20:51:41 +00:00
Dan Gohman
5bd91232c3 Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51718 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 00:08:18 +00:00
Dan Gohman
5a56bf631e Fix a copy+paste error in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51717 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 00:02:02 +00:00
Owen Anderson
9491195710 Add newline at end of file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51701 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-29 21:05:16 +00:00
Owen Anderson
5771d6c16d Force postdom to be linked into opt and bugpoint, even though it is no longer used by any passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51686 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-29 17:00:13 +00:00
Gabor Greif
3e93e630aa convert another operand loop to iterator formulation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51661 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-29 00:51:08 +00:00
Dan Gohman
ef61af01df Use Function::getEntryBlock instead of Function::begin, for clarity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51613 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-27 20:55:29 +00:00
Dan Gohman
b22d6ac348 Print debug output when any edge becomes executable, including
the first visited edge.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51612 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-27 20:47:30 +00:00
Duncan Sands
43e2a03530 Fix some constructs that gcc-4.4 warns about.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51591 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-27 11:50:51 +00:00
Nick Lewycky
04b35e8532 Don't treat values as signed when looking at loop steppings in HowForToNonZero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51560 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-25 23:43:32 +00:00
Nick Lewycky
3dfd7bf511 "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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51559 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-25 20:56:15 +00:00
Dan Gohman
b64aa119d8 Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51452 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 23:43:22 +00:00
Gabor Greif
785c6af979 transform more loops to iterator form, detabify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51436 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 19:24:54 +00:00
Gabor Greif
de2d74b213 Rewrite operand loops to use iterators. This shrinks .o file (at gcc4.0.1 -O3 x86) substantially (>500 bytes). Reason still unknown.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51423 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 06:43:33 +00:00
Chris Lattner
05a24e5efe Free and vaarg are not really volatile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51407 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 03:23:06 +00:00
Gabor Greif
33e456d5f3 suppress gcc3.4.6's <no value returned> warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51372 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21 14:07:30 +00:00
Chris Lattner
eb0fdc150a Fix PR2346 by marking vaarg as volatile so that licm doesn't try to
hoist them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51356 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 22:05:28 +00:00
Chris Lattner
28a8dbc35f Add a bool to isEdgeFeasible that tells it whether to treat unknown
value as undef or untracked.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51295 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 03:39:39 +00:00
Gabor Greif
7cbd8a3e92 API change for {BinaryOperator|CmpInst|CastInst}::create*() --> Create. Legacy interfaces will be in place for some time. (Merge from use-diet branch.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51200 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-16 19:29:10 +00:00
Dan Gohman
d208a803a6 Use static and anonymous namespaces consistently with other passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51156 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-15 19:43:55 +00:00
Owen Anderson
ff5a535378 Fix memdep's handling of invokes when finding the dependency of another call
instruction.  This fixes some Ada miscompiles reported in PR2324.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51069 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13 21:25:37 +00:00
Dan Gohman
844731a7f1 Clean up the use of static and anonymous namespaces. This turned up
several things that were neither in an anonymous namespace nor static
but not intended to be global.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51017 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13 00:00:25 +00:00
Chris Lattner
4651f3de34 prune #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50962 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-12 01:13:53 +00:00
Chris Lattner
ab7d9ccf18 Add a new SparsePropagation analysis utility, which allows you to do
SCCP like sparse lattice analysis with relative ease.  Just pick your
lattice function and implement the transfer function and you're good.
Just make sure you don't break monotonicity ;-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50961 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-12 01:12:24 +00:00
Torok Edwin
f03893acf0 put LibCallAliasAnalysis into anonymous namespace to avoid
clashes on ::X


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50912 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-09 20:35:45 +00:00
Chris Lattner
76e2e4a2bc Remove dead return. Thanks to Bill for the review!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50863 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-08 18:26:56 +00:00
Chris Lattner
268e7d7a94 Add support for constant folding the 'offsetof' pattern even if the
base is not zero.  This fixes test/C++Frontend/2008-05-07-CrazyOffsetOf.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50840 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-08 04:54:43 +00:00
Chris Lattner
029840c935 Add a new LibCallAliasAnalysis pass, which is parameterized
by an instance of LibCallInfo to provide mod/ref info of
standard library functions.  This is powerful enough to
say that 'sqrt' is readonly except that it modifies errno,
or that "printf doesn't store to memory unless the %n
constraint is present" etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50827 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-07 19:53:05 +00:00
Chris Lattner
14852f27e7 Add a new interface for describing the behavior of library calls. This
Currently is sufficient to describe mod/ref behavior but will hopefully
eventually be extended for other purposes.

This isn't used by anything yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50820 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-07 18:21:13 +00:00
Nick Lewycky
08de613d2d Fix typo and indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50706 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 04:03:18 +00:00
Dan Gohman
4a3f6c8882 Make several variable declarations static.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50696 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 01:53:16 +00:00
Dan Gohman
84b7df43fb Remove uses of llvm/System/IncludeFile.h that are no longer needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50695 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 01:32:53 +00:00
Torok Edwin
f6055806d4 Implement destructor for PostDominatorTree to eliminate a memory leak.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50607 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-03 20:25:26 +00:00