Commit Graph

6853 Commits

Author SHA1 Message Date
Duncan Sands
edfcf598fa Sometimes (rarely) nodes held in LegalizeTypes
maps can be deleted.  This happens when RAUW
replaces a node N with another equivalent node
E, deleting the first node.  Solve this by
adding (N, E) to ReplacedNodes, which is already
used to remap nodes to replacements.  This means
that deleted nodes are being allowed in maps,
which can be delicate: the memory may be reused
for a new node which might get confused with the
old deleted node pointer hanging around in the
maps, so detect this and flush out maps if it
occurs (ExpungeNode).  The expunging operation
is expensive, however it never occurs during
a llvm-gcc bootstrap or anywhere in the nightly
testsuite.  It occurs three times in "make check":
Alpha/illegal-element-type.ll,
PowerPC/illegal-element-type.ll and
X86/mmx-shift.ll.  If expunging proves to be too
expensive then there are other more complicated
ways of solving the problem.
In the normal case this patch adds the overhead
of a few more map lookups, which is hopefully
negligable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52214 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-11 11:42:12 +00:00
Duncan Sands
02703ba753 Small doc fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52190 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-10 20:54:01 +00:00
Duncan Sands
893076354a Various tweaks related to apint codegen. No functionality
change for non-funky-sized integers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52151 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-09 15:48:25 +00:00
Duncan Sands
8eab8a2798 Remove some DAG combiner assumptions about sizes
of integer types.  Fix the isMask APInt method to
actually work (hopefully) rather than crashing
because it adds apints of different bitwidths.
It looks like isShiftedMask is also broken, but
I'm leaving that one to the APInt people (it is
not used anywhere).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52142 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-09 11:32:28 +00:00
Chris Lattner
d10e467ad9 Add a simple, but efficient, generic scoped hash table
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52112 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-09 00:42:10 +00:00
Duncan Sands
8e4eb09b1e Remove comparison methods for MVT. The main cause
of apint codegen failure is the DAG combiner doing
the wrong thing because it was comparing MVT's using
< rather than comparing the number of bits.  Removing
the < method makes this mistake impossible to commit.
Instead, add helper methods for comparing bits and use
them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52098 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-08 20:54:56 +00:00
Gabor Greif
76aca6f38f get rid of ExtractValueInst::init's Value argument, it is already passed to the UnaryInstruction ctor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52064 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06 21:06:32 +00:00
Gabor Greif
d4f268bdd4 make ExtractValueInst derived from UnaryInstruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52061 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06 20:28:12 +00:00
Duncan Sands
3b3adbb745 Tighten up the abstraction slightly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52045 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06 12:49:32 +00:00
Duncan Sands
83ec4b6711 Wrap MVT::ValueType in a struct to get type safety
and better control the abstraction.  Rename the type
to MVT.  To update out-of-tree patches, the main
thing to do is to rename MVT::ValueType to MVT, and
rewrite expressions like MVT::getSizeInBits(VT) in
the form VT.getSizeInBits().  Use VT.getSimpleVT()
to extract a MVT::SimpleValueType for use in switch
statements (you will get an assert failure if VT is
an extended value type - these shouldn't exist after
type legalization).
This results in a small speedup of codegen and no
new testsuite failures (x86-64 linux).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52044 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06 12:08:01 +00:00
Evan Cheng
9c3c221364 Refine stack slot interval weight computation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52040 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06 07:54:39 +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
Owen Anderson
c4dc132c8a Add a helper for constructing new live ranges that ended from an instruction to the end of its MBB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52012 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 17:15:43 +00:00
Matthijs Kooijman
045b3f7bf1 * Make CallSite::hasArgument const and let it take a const parameter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51989 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 08:04:58 +00:00
Bill Wendling
67944fc427 Cast because I think I know what I'm doing. There are warnings about converting
from 64-bit to 32-bit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51982 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 07:35:27 +00:00
Matthijs Kooijman
cfd5b7d18b Fix 80 column violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51981 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 07:26:15 +00:00
Bill Wendling
12c846f5d2 Remove unused parameter. Some clients might use -Werror when compiling and
cause drama.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51980 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 07:24:08 +00:00
Matthijs Kooijman
9515a8f88a Add CallSite::hasArgument to allow for seeing if a call passes a certain value as an argument quickly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51946 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 16:31:12 +00:00
Matthijs Kooijman
338169ddc9 Add a Name parameter to two of the init methods of GetElementPointer to make the name setting more consistent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51945 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 16:14:12 +00:00
Matthijs Kooijman
444099f615 Implement the two constructors in InsertValueInst and ExtractValueInst.
Add a Name argment to two init methods in these classes as well to make things
a bit more consistent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51937 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 14:40:55 +00:00
Evan Cheng
3f32d65912 Add a stack slot coloring pass. Not yet enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51934 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 09:18:41 +00:00
Duncan Sands
a0fcc08e65 Change packed struct layout so that field sizes
are the same as in unpacked structs, only field
positions differ.  This only matters for structs
containing x86 long double or an apint; it may
cause backwards compatibility problems if someone
has bitcode containing a packed struct with a
field of one of those types.
The issue is that only 10 bytes are needed to
hold an x86 long double: the store size is 10
bytes, but the ABI size is 12 or 16 bytes (linux/
darwin) which comes from rounding the store size
up by the alignment.  Because it seemed silly not
to pack an x86 long double into 10 bytes in a
packed struct, this is what was done.  I now
think this was a mistake.  Reserving the ABI size
for an x86 long double field even in a packed
struct makes things more uniform: the ABI size is
now always used when reserving space for a type.
This means that developers are less likely to
make mistakes.  It also makes life easier for the
CBE which otherwise could not represent all LLVM
packed structs (PR2402).
Front-end people might need to adjust the way
they create LLVM structs - see following change
to llvm-gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51928 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 08:21:45 +00:00
Dale Johannesen
bd44c2e383 Expand documentation of StringConstantPrefix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51911 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03 18:15:03 +00:00
Dale Johannesen
428ac54894 Add StringConstantPrefix to control what the
assembler names of string constants look like.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51909 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03 18:09:06 +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
Chris Lattner
b8d0b807fc add a predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51842 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-01 18:09:04 +00:00
Dan Gohman
8e6404180c Fix a copy+paste error in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51821 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 19:09:47 +00:00
Dan Gohman
35651cdf0b Fix some bugs with the handling of indices in insertvalue/extractvalue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51820 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 19:09:08 +00:00
Dan Gohman
7e2dd6628e Factor several methods, including getInversePredicate and
getSwappedPredicate, from ICmpInst and FCmpInst into common
methods in CmpInst. This allows CmpInsts to be manipulated
generically.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51810 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 02:47:54 +00:00
Dan Gohman
81a0c0b44e IR, bitcode reader, bitcode writer, and asmparser changes to
insertvalue and extractvalue to use constant indices instead of
Value* indices. And begin updating LangRef.html.

There's definately more to come here, but I'm checking this 
basic support in now to make it available to people who are
interested.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51806 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 00:58:22 +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
Dan Gohman
8666cc3b99 Add an isAggregateType predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51794 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 22:40:06 +00:00
Dan Gohman
11bf2ace55 Add an operator< for SmallVector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51791 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 22:37:47 +00:00
Owen Anderson
15a17f5481 Forgot to commit this file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51786 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 20:14:04 +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
cdff51cabc Fix an error in the comment for APInt::getMinSignedBits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51720 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 00:46:49 +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
Gabor Greif
07252fd463 add doxygen comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51712 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-29 22:58:33 +00:00
Anton Korobeynikov
81fb27cc3a Remove guard, so *each* inclusion will result in a warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51708 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-29 21:57:11 +00:00
Bill Wendling
eecfa369eb Remove more iostream header includes. Needed to implement a "FlushStream"
function to flush a specified std::ostream.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51705 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-29 21:46:33 +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
b372d59a11 Add file with warning for backward comptibility. Should be removed after 2.4
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51693 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-29 18:18:15 +00:00
Anton Korobeynikov
1ff4ed726b Update guards
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51692 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-29 18:17:53 +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
Bill Wendling
8370d38ade Add a flag to indicate that an instruction is as cheap (or cheaper) than a move
instruction to execute. This can be used for transformations (like two-address
conversion) to remat an instruction instead of generating a "move"
instruction. The idea is to decrease the live ranges and register pressure and
all that jazz.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51660 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-28 22:54:52 +00:00
Owen Anderson
80b3ce65e2 Factor the numbering computation into a separate method, and add the slightest attempt at some renumbering logic, which is currently unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51652 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-28 20:54:50 +00:00
Gabor Greif
1b9e1672fb Make Use::init() private, it breaks invariants, clients should assign or use set().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51615 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-27 21:29:38 +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