Commit Graph

913 Commits

Author SHA1 Message Date
Owen Anderson
6e6074508c Revert r55859. This is breaking the build in the abscence of its companion commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55865 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 23:36:01 +00:00
Duncan Sands
c94fe21a56 Delete the removeCallEdgeTo callgraph method,
because it does not maintain a correct list
of callsites.  I discovered (see following
commit) that the inliner will create a wrong
callgraph if it is fed a callgraph with
correct edges but incorrect callsites.  These
were created by Prune-EH, and while it wasn't
done via removeCallEdgeTo, it could have been
done via removeCallEdgeTo, which is an accident
waiting to happen.  Use removeCallEdgeFor
instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55859 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 21:43:04 +00:00
Duncan Sands
e4a48c7581 Strip trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55834 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 12:31:56 +00:00
Dan Gohman
ae73dc1448 Tidy up several unbeseeming casts from pointer to intptr_t.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55779 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-04 17:05:41 +00:00
Chris Lattner
db57ef1cb3 rename destroy -> releaseMemory to properly hook into passmgr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55508 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-28 22:56:53 +00:00
Owen Anderson
3688f268cb Remove GCSE, ValueNumbering, and LoadValueNumbering. These have been deprecated for almost a year; it's finally time for them to go away.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54822 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-15 21:31:02 +00:00
Dan Gohman
a8c763b307 Use empty() instead of begin() == end().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54780 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-14 18:13:49 +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
fed90b6d09 Fold the useful features of alist and alist_node into ilist, and
a new ilist_node class, and remove them. Unlike alist_node,
ilist_node doesn't attempt to manage storage itself, so it avoids
the associated problems, including being opaque in gdb.

Adjust the Recycler class so that it doesn't depend on alist_node.
Also, change it to use explicit Size and Align parameters, allowing
it to work when the largest-sized node doesn't have the greatest
alignment requirement.

Change MachineInstr's MachineMemOperand list from a pool-backed
alist to a std::list for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54146 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-28 21:51:04 +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
e4f1a7e8ff Fix typos in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53487 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 22:48:20 +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
Dan Gohman
1002c02034 Add explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53179 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 18:00:37 +00:00
Devang Patel
a45a9e416f Fix dom tree compare. Don't forget to compare children!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52984 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 21:41:00 +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
c602769822 Add an isReachableFromEntry method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52916 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 20:28:02 +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
69c8d9be02 Because of the laziness, the required passes must exist even after
LoopVR::runOnFunction runs.

This should accomplish that, but it doesn't. I think that's a PassManager bug,
but without a consumer of LoopVR in the tree, I can't give steps to reproduce.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52886 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 01:04:39 +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
Cedric Venet
5e950627f9 Add an include file needed for VS.
Add two new file to codegen project (VS).
This unbreak the build for VS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52831 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 18:00:09 +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
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
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
Dan Gohman
65c6795af4 It's invalid to take the one-past-the-end address of a non-array
object.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52515 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 00:49:21 +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
Devang Patel
6d0cc55ef3 Check empty dominance frontier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52437 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-18 02:12:09 +00:00
Matthijs Kooijman
de9256ad2e Forgot to commit the ValueTracking header file along with r52396.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52401 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-17 13:54:33 +00:00
Matthijs Kooijman
74fc4d9686 80 column fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52391 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-17 08:26:32 +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
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
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
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
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
Evan Cheng
652f7ea955 Revert 51775.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51795 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 22:47:19 +00:00
Evan Cheng
babf11f249 Patches for building llvm on Solaris x86. Contributed by Nathan Keynes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51775 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 17:16:20 +00:00
Dan Gohman
64d237cfae Fix doxygen comment syntax.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51716 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 00:01:36 +00:00
Dan Gohman
1baa88e3de Prune and tidy #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51697 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-29 19:52:31 +00:00
Anton Korobeynikov
43d1fd449f For PR1338: rename include/llvm/ADT/ilist and friends to end with ".h"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51687 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-29 17:41:17 +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
Dan Gohman
201694b0c6 Fix a word-o and add an explicit keyword.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51610 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-27 20:41:18 +00:00