Commit Graph

7128 Commits

Author SHA1 Message Date
Owen Anderson
26bb50ab48 Add an insertBefore method for attaching previously unattached instructions,
such as those created by clone(), to a basic block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52424 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-17 18:29:27 +00:00
Owen Anderson
2b7470eb54 Fix use of placement new to actually use an address.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52423 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-17 18:07:43 +00:00
Anton Korobeynikov
210539ebc4 Provide generic hooks for icache invalidation. Add PPC implementation.
Patch by Gary Benson!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52418 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-17 17:30:05 +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
Chris Lattner
ead0d88ad7 add a new -enable-value-prop flag for llcbeta, that enables propagation
of value info (sign/zero ext info) from one MBB to another.  This doesn't
handle much right now because of two limitations:

1) only handles zext/sext, not random bit propagation (no assert exists 
   for this)
2) doesn't handle phis.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52383 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-17 06:09:18 +00:00
Evan Cheng
4e444436f2 Horizontal-add instructions are not commutative.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52363 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 21:16:24 +00:00
Gabor Greif
e98fc279e2 Move some documentation from the header file into ProgrammersManual. About to improve.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52360 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 21:06:12 +00:00
Evan Cheng
6bd9567a6a - Add "Commutative" property to intrinsics. This allows tblgen to generate the commuted variants for dagisel matching code.
- Mark lots of X86 intrinsics as "Commutative" to allow load folding.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52353 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 20:29:38 +00:00
Chris Lattner
e846db6675 Add a new flag that disables symbol lookup with dlsym when set. This allows
a JIT client to completely control symbol lookup with the LazyFunctionCreator
interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52335 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 17:44:14 +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
Matthijs Kooijman
069f42a058 Add comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52313 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 12:20:05 +00:00
Duncan Sands
ad205a7687 Allow these transforms for types like i256 while
still excluding types like i1 (not byte sized)
and i120 (loading an i120 requires loading an i64,
an i32, an i16 and an i8, which is expensive). 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52310 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 08:14:38 +00:00
Evan Cheng
58dcb0e0cd Add option to commuteInstruction() which forces it to create a new (commuted) instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52308 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 07:33:11 +00:00
Chris Lattner
0ad4d9be03 add a const version of stripPointerCasts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52305 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 06:43:06 +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
Andrew Lenharth
507a58ac9b add missing atomic intrinsic from gcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52270 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-14 05:48:15 +00:00
Duncan Sands
d4b9c17fb7 Disable some DAG combiner optimizations that may be
wrong for volatile loads and stores.  In fact this
is almost all of them!  There are three types of
problems: (1) it is wrong to change the width of
a volatile memory access.  These may be used to
do memory mapped i/o, in which case a load can have
an effect even if the result is not used.  Consider
loading an i32 but only using the lower 8 bits.  It
is wrong to change this into a load of an i8, because
you are no longer tickling the other three bytes.  It
is also unwise to make a load/store wider.  For
example, changing an i16 load into an i32 load is
wrong no matter how aligned things are, since the
fact of loading an additional 2 bytes can have
i/o side-effects.  (2) it is wrong to change the
number of volatile load/stores: they may be counted
by the hardware.  (3) it is wrong to change a volatile
load/store that requires one memory access into one
that requires several.  For example on x86-32, you
can store a double in one processor operation, but to
store an i64 requires two (two i32 stores).  In a
multi-threaded program you may want to bitcast an i64
to a double and store as a double because that will
occur atomically, and be indivisible to other threads.
So it would be wrong to convert the store-of-double
into a store of an i64, because this will become two
i32 stores - no longer atomic.  My policy here is
to say that the number of processor operations for
an illegal operation is undefined.  So it is alright
to change a store of an i64 (requires at least two
stores; but could be validly lowered to memcpy for
example) into a store of double (one processor op).
In short, if the new store is legal and has the same
size then I say that the transform is ok.  It would
also be possible to say that transforms are always
ok if before they were illegal, whether after they
are illegal or not, but that's more awkward to do
and I doubt it buys us anything much.
However this exposed an interesting thing - on x86-32
a store of i64 is considered legal!  That is because
operations are marked legal by default, regardless of
whether the type is legal or not.  In some ways this
is clever: before type legalization this means that
operations on illegal types are considered legal;
after type legalization there are no illegal types
so now operations are only legal if they really are.
But I consider this to be too cunning for mere mortals.
Better to do things explicitly by testing AfterLegalize.
So I have changed things so that operations with illegal
types are considered illegal - indeed they can never
map to a machine operation.  However this means that
the DAG combiner is more conservative because before
it was "accidentally" performing transforms where the
type was illegal because the operation was nonetheless
marked legal.  So in a few such places I added a check
on AfterLegalize, which I suppose was actually just
forgotten before.  This causes the DAG combiner to do
slightly more than it used to, which resulted in the X86
backend blowing up because it got a slightly surprising
node it wasn't expecting, so I tweaked it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52254 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-13 19:07:40 +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
Evan Cheng
502a4f5162 Do not speculatively execute an instruction by hoisting it to its predecessor BB if any of its operands are defined but not used in BB. The transformation will prevent the operand from being sunk into the use block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52244 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-12 21:15:59 +00:00
Duncan Sands
4c54067f67 If queried as to whether an operation is legal
for a particular MVT, return false if the type
is illegal rather than barfing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52229 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-12 09:01:30 +00:00
Gabor Greif
0039adb514 remove bogus comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52216 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-11 13:53:41 +00:00
Gabor Greif
37e5484004 op_iterator-ify dropAllReferences
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52215 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-11 11:45:26 +00:00
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
Matthijs Kooijman
8e1cddc11d Use an explicit llvm:: prefix in the STATISTIC macro, so STATISTIC can still be
used when "using namespace llvm" is not in effect.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51592 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-27 12:41:24 +00:00
Gabor Greif
6c80c38160 eliminate calls to deprecated Use::init() interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51570 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-26 21:33:52 +00:00
Duncan Sands
28c3cff825 Factor code to copy global value attributes like
the section or the visibility from one global
value to another: copyAttributesFrom.  This is
particularly useful for duplicating functions:
previously this was done by explicitly copying
each attribute in turn at each place where a
new function was created out of an old one, with
the result that obscure attributes were regularly
forgotten (like the collector or the section).
Hopefully now everything is uniform and nothing
is forgotten.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51567 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-26 19:58:59 +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
Evan Cheng
a31593901d Eliminate x86.sse2.punpckh.qdq and x86.sse2.punpckl.qdq.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51533 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-24 02:56:30 +00:00
Evan Cheng
e716bb1c59 Eliminate x86.sse2.movs.d, x86.sse2.shuf.pd, x86.sse2.unpckh.pd, and x86.sse2.unpckl.pd intrinsics. These will be lowered into shuffles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51531 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-24 02:14:05 +00:00
Evan Cheng
3cc8f9bfef Remove x86.sse2.loadh.pd and x86.sse2.loadl.pd. These will be lowered into load and shuffle instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51521 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-24 00:07:06 +00:00
Dan Gohman
2d0a77a1a4 It turns out there are only 3 non-first-class type kinds left now, so
it's simpler for isFirstClassType to use a negative test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51511 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 22:47:52 +00:00
Dan Gohman
02dea8b39f Tidy up BasicBlock::getFirstNonPHI, and change a bunch of places to
use it instead of duplicating its functionality.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51499 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 21:05:58 +00:00
Dan Gohman
ee335e35ac Add #includes to make some dependencies explicit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51496 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 20:40:06 +00:00
Dan Gohman
e4977cf750 Make structs and arrays first-class types, and add assembly
and bitcode support for the extractvalue and insertvalue
instructions and constant expressions.

Note that this does not yet include CodeGen support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51468 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 01:55:30 +00:00
Dan Gohman
e4569943d9 Add more IR support for the new extractvalue and insertvalue
instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51461 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 00:36:11 +00:00
Gabor Greif
b074f80d8e Suppress warnings about missing placement delete. This should now be std-conformant even if compiled with exceptions on.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51429 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 13:16:42 +00:00
Dan Gohman
ddc4ee82b5 Add a Type::isSingleValueType method. This will be used by code
that currently uses Type::isFirstClassType and depends on it
returning false for struct or array types.

This commit doesn't change the behavior of Type::isFirstClassType.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51396 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21 23:35:53 +00:00
Bill Wendling
40db5d4539 Follow-up to the reverting of r51218. This puts the checks out-of-line. Because
they aren't in the header file, systems with a <string> header file that isn't
64-bit clean shouldn't warn if #including Path.h and specifying
-Wshorten-64-to-32.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51393 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21 21:20:07 +00:00
Gabor Greif
0263140c9e update a comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51390 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21 18:57:33 +00:00
Nate Begeman
f049e07eb8 Fix a couple issues with the JIT and multiple modules:
1. The "JITState" object creates a PassManager with the ModuleProvider that the
   jit is created with.  If the ModuleProvider is removed and deleted, the
   PassManager is invalid.

2. The Global maps in the JIT were not invalidated with a ModuleProvider was 
   removed.  This could lead to a case where the Module would be freed, and a 
   new Module with Globals at the same addresses could return invalid results.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51384 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21 16:34:48 +00:00
Bill Wendling
55384a853c Reverting r51218 because of breakage on PPC32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51358 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 23:54:27 +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
Steve Naroff
0008f654bf Silence a warning about "*/" outside a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51287 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 00:46:15 +00:00
Dale Johannesen
c215b3ef5d Handle quoted names when constructing $stub's,
$non_lazy_ptr's and $lazy_ptr's.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51277 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-19 21:38:18 +00:00
Chris Lattner
f7e1913118 add a helper method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51274 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-19 21:17:01 +00:00
Bill Wendling
13d57320bd Remove warnings about unused parameters and shadowed variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51266 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-19 20:15:12 +00:00
Gordon Henriksen
83eaae19ad Remove a duplicative binding. Patch by Mahadevan R.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51238 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-19 05:47:10 +00:00
Chris Lattner
68d2d2f823 add missing #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51227 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-18 14:24:58 +00:00
Bill Wendling
fbaa37937f On Darwin, the string header file isn't 64-bit clean. The use of
"-Wshorten-64-to-32 -Werror" will cause a failure when compiling this complex
program:

#include <string>

class Path {
  mutable std::string path;
public:
  bool operator == (const Path &that) {
    return path == that.path;
  }
};

Using strcmp gets us past this annoying error.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51218 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-17 09:10:40 +00:00
Nick Lewycky
fc1efbbfbc Move isTrueWhenEqual to ICmpInst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51215 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-17 07:33:39 +00:00
Dale Johannesen
c9b0aa788f Add CommonLinkage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51208 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-16 22:42:11 +00:00
Eric Christopher
0bf7b414ae Add functions to enable adding a single attribute to a function and
its associated call site.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51204 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-16 20:39:43 +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
e2d896fab3 Update comments based on Duncan's feedback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51170 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-15 23:35:32 +00:00
Evan Cheng
0ef8de30fa Fix typos and comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51165 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-15 22:13:02 +00:00
Dan Gohman
041e2eb517 IR support for extractvalue and insertvalue instructions. Also, begin
moving toward making structs and arrays first-class types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51157 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-15 19:50:34 +00:00
Evan Cheng
f0df03134e Make use of vector load and store operations to implement memcpy, memmove, and memset. Currently only X86 target is taking advantage of these.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51140 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-15 08:39:06 +00:00
Nate Begeman
ff155f03bd Move the operator new and operator delete out of line. This fixes an issue with
operator new() referring to the static initTags function, which has to be in the 
same linkage unit as any file including User.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51136 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-15 01:23:11 +00:00
Nate Begeman
0342049cd8 Add support to IR builder for new vicmp, vfcmp routines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51127 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-14 20:29:46 +00:00
Nate Begeman
31cd33a743 Don't generate unused variables in a no-assert build
Add some checks to the new vicmp,vfcmp instructions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51125 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-14 20:28:31 +00:00
Dale Johannesen
aafce77b17 Add CommonLinkage; currently tentative definitions
are represented as "weak", but there are subtle differences
in some cases on Darwin, so we need both.  The intent
is that "common" will behave identically to "weak" unless
somebody changes their target to do something else.
No functional change as yet.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51118 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-14 20:12:51 +00:00
Devang Patel
ef3682a4fb Simplify internalize pass. Add test case.
Patch by Matthijs Kooijman!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51114 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-14 20:01:01 +00:00
Roman Levenstein
6422e8aa1c Do not generate by TableGen the hard-coded standard, target-independent part of
DAG instruction selectors. Introudce a dedicated header file for this part:
include/llvm/CodeGen/DAGISelHeader.h

TableGen now only generates the include preprocessor directive to include this
new header.

This is a preparation for supporting multiple implementations of instruction
selectors in the future.

Reviewed and approved by Evan and Dan.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51102 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-14 10:17:11 +00:00
Dan Gohman
816cdf6bb2 Commit the header I accidentally left out of 51083.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51093 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-14 04:39:40 +00:00
Dan Gohman
1d5562f72e Move RemoveFromVector out of the global namespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51090 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-14 01:02:49 +00:00
Dan Gohman
9c78a39907 Whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51089 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-14 00:43:10 +00:00
Dan Gohman
5d9bac6d8d Make getNumContainedManagers and getNumContainedPasses const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51087 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-14 00:40:34 +00:00
Dan Gohman
79fc2020ce Make PassInfo noncopyable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51085 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-14 00:39:39 +00:00
Dan Gohman
45b3197090 Split the loop unroll mechanism logic out into a utility function.
Patch by Matthijs Kooijman!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51083 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-14 00:24:14 +00:00
Gabor Greif
94fb68ba21 Merge of r51073-51074 from use-diet branch.
Do not rely on std::swap<Use>, provide a (faster) member function instead.
This change is primarily necessitated by MSVC++'s incompatibility with
declaring std::swap<Use> to be a friend of Use.

Also contains some minor tweaks to Use inline functions,
to undo pointless changes that sneaked in with the last merge.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51078 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13 22:51:52 +00:00
Eric Christopher
e3fc3858a2 Make this function public.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51077 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13 22:51:04 +00:00
Anton Korobeynikov
e269f434b1 Add thin layer over StringMap to form StringSet. By Mikhail Glushenkov.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51048 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13 15:03:16 +00:00
Evan Cheng
77f0b7a50a Instead of a vector load, shuffle and then extract an element. Load the element from address with an offset.
pshufd $1, (%rdi), %xmm0
        movd %xmm0, %eax
=>
        movl 4(%rdi), %eax


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51026 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13 08:35:03 +00:00
Gabor Greif
d6a2218586 Derive GetResultInst from UnaryInstruction, this simplifies code and removes a FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51023 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13 07:09:08 +00:00
Dan Gohman
6ddba2b933 Change class' public PassInfo variables to by initialized with the
address of the PassInfo directly instead of calling getPassInfo.
This eliminates a bunch of dynamic initializations of static data.

Also, fold RegisterPassBase into PassInfo, make a bunch of its
data members const, and rearrange some code to initialize data
members in constructors instead of using setter member functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51022 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13 02:05:11 +00:00
Evan Cheng
9bfa03c6fd Xform bitconvert(build_pair(load a, load b)) to a single load if the load locations are at the right offset from each other.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51008 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-12 23:04:07 +00:00
Bill Wendling
9f8fea3531 Constify the machine instruction passed into the
"is{Trivially,Really}ReMaterializable" methods.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51001 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-12 20:54:26 +00:00
Evan Cheng
f86f211ec2 Forgot this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50993 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-12 20:08:05 +00:00
Nate Begeman
b43e9c1965 Add support for vicmp/vfcmp codegen, more legalize support coming.
This is necessary to unbreak the build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50988 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-12 19:40:03 +00:00
Nate Begeman
ac80ade158 Add two new instructions to the llvm IR, vicmp and vfcmp. see updated LangRef
for details.  CodeGen support coming in a follow up patch


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50985 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-12 19:01:56 +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
Nick Lewycky
fff116fd58 Make constructors target-specific. This fixes problems where the path would
include backslashes on Windows. This should fix llvm-ld problems on win32.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50960 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-11 17:37:40 +00:00
Bill Wendling
c2e735359f Remove warnings when using -Wshorten-64-to-32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50952 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-10 19:59:59 +00:00
Bill Wendling
1b2f72912f Prevent -W64-to-32-shortened warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50947 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-10 11:26:52 +00:00
Bill Wendling
d2a5a2ae2e Prevent warnings from the -Wshorten-64-to-32 flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50946 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-10 10:58:07 +00:00
Gabor Greif
469a582830 remove commented-out code, it is subsumed by DECLARE_TRANSPARENT_OPERAND_ACCESSORS
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50944 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-10 09:36:58 +00:00
Gabor Greif
efe65369a7 merge of use-diet branch to trunk
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50943 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-10 08:32:32 +00:00
Evan Cheng
c6c6a3e2b3 Make OpActionsCapacity multiple of 4.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50917 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-09 21:50:23 +00:00
Chris Lattner
4ca7913072 add support for pattern matching 'neg'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50883 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-09 05:20:27 +00:00
Chris Lattner
d96288a2ff add a new Instruction::mayReadFromMemory predicate, make
Instruction::mayWriteToMemory stronger for invokes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50858 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-08 17:16:51 +00:00
Anton Korobeynikov
0b12ecf6ff Turn StripPointerCast() into a method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50836 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-07 22:54:15 +00:00
Ted Kremenek
1fd2e6d84e Make the interface of CStrInCStrNoCase be the same as strcasestr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50828 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-07 20:04:18 +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
Ted Kremenek
fdedd5397d Fix some serious logical errors in CStrInCStrNoCase pointed out by Bill.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50826 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-07 19:22:36 +00:00
Duncan Sands
671fa97a4b Output correct exception handling and frame info
on x86-64 linux.  This causes no regressions on
32 bit linux and 32 bit ppc.  More tests pass
on 64 bit ppc with no regressions.  I didn't
turn on eh on 64 bit linux because the intrinsics
needed to compile the eh runtime aren't done
yet.  But if you turn it on and link with the
mainline runtime then eh seems to work fine
on x86-64 linux with this patch.  Thanks to
Dale for testing.  The main point of the patch
is that if you output that some object is
encoded using 4 bytes you had better not output
8 bytes for it: the patch makes everything
consistent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50825 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-07 19:11:09 +00:00
Ted Kremenek
fbd15899b3 Guard for empty strings in CStrInCStrNoCase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50823 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-07 18:49:31 +00:00
Ted Kremenek
6925f5074f Added CStrInCStrNoCase, a portable implementation of strcasestr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50821 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-07 18:35:46 +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
094aa6ce47 Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50805 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-07 06:39:04 +00:00
Bill Wendling
69cedcbcec Make the use of the "noinline" attribute conditional on using GCC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50789 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-07 00:00:34 +00:00
Bill Wendling
ef02b815cb Workaround for a compiler bug (see <rdar://problem/5852746>). Once that bug is
fixed, revert this patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50782 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 23:30:02 +00:00
Anton Korobeynikov
b04adddd50 Make StripPointerCast a common function (should we mak it method of Value instead?)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50775 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 22:52:30 +00:00
Gordon Henriksen
919852b0e6 Improve documentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50768 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 19:17:01 +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
Dan Gohman
703bfe6909 Fix a broken doxygen comment, and reword it for clarity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50687 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 00:20:10 +00:00
Bill Wendling
521e245288 Using "unsigned" was masking the "size_t" version of this method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50668 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-05 20:51:58 +00:00
Devang Patel
be5918c079 Remove unused function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50664 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-05 19:44:16 +00:00
Mon P Wang
63307c335a Added addition atomic instrinsics and, or, xor, min, and max.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50663 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-05 19:05:59 +00:00
Evan Cheng
34cd4a484e Fix more -Wshorten-64-to-32 warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50659 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-05 18:30:58 +00:00
Evan Cheng
d69bb1abef Fix 80 column violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50655 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-05 17:41:03 +00:00
Dan Gohman
a779a9899a Add AsmPrinter support for emitting a directive to declare that
the code being generated does not require an executable stack.

Also, add target-specific code to make use of this on Linux
on x86. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50634 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-05 00:28:39 +00:00
Owen Anderson
46bb007014 Fix PR1098 by correcting the postdominators analysis.
Patch by Florian Brandner.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50628 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-04 21:07:35 +00:00
Chris Lattner
84cb71bbc5 remove obsolete method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50622 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-04 18:14:55 +00:00
Gordon Henriksen
16c1f44d91 Use (void) instead of () in C code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50620 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-04 12:55:34 +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
Ted Kremenek
7a07428ad1 Implement operator-> for ImmutableMap iterators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50603 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-03 01:05:46 +00:00
Evan Cheng
22b942aa4d Add separate intrinsics for MMX / SSE shifts with i32 integer operands. This allow us to simplify the horribly complicated matching code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50601 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-03 00:52:09 +00:00
Evan Cheng
48e8c80e17 Suppress -Wshorten-64-to-32 warnings for 64-bit hosts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50590 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-02 21:15:08 +00:00
Ted Kremenek
5713604f8e Initialize a local variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50527 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01 17:08:00 +00:00
Chris Lattner
fd1cbbe9cf Delete the IPO simplify-libcalls and completely reimplement it as
a FunctionPass.  This makes it simpler, fixes dozens of bugs, adds
a couple of minor features, and shrinks is considerably: from
2214 to 1437 lines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50520 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01 06:25:24 +00:00
Chris Lattner
70100131d1 Add CreateCall3/CreateCall4 at Eric's request.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50515 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01 05:23:45 +00:00
Chris Lattner
4b9f046869 Add a spiffy little "CreateCall2" method, which can be used to make
a function call that takes two Value*'s as arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50514 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01 05:11:00 +00:00
Arnold Schwaighofer
30e62c098b Tail call optimization improvements:
Move platform independent code (lowering of possibly overwritten
arguments, check for tail call optimization eligibility) from
target X86ISelectionLowering.cpp to TargetLowering.h and
SelectionDAGISel.cpp.

Initial PowerPC tail call implementation:

Support ppc32 implemented and tested (passes my tests and
test-suite llvm-test).  
Support ppc64 implemented and half tested (passes my tests).
On ppc tail call optimization is performed if 
  caller and callee are fastcc
  call is a tail call (in tail call position, call followed by ret)
  no variable argument lists or byval arguments
  option -tailcallopt is enabled
Supported:
 * non pic tail calls on linux/darwin
 * module-local tail calls on linux(PIC/GOT)/darwin(PIC)
 * inter-module tail calls on darwin(PIC)
If constraints are not met a normal call will be emitted.

A test checking the argument lowering behaviour on x86-64 was added.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50477 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30 09:16:33 +00:00
Chris Lattner
deae48ee99 add missing #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50468 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30 04:56:14 +00:00
Chris Lattner
12e6d20059 add a method for comparing to see if a value has a specified name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50465 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30 03:55:40 +00:00
Owen Anderson
0396cd33ca Rename DeadLoopElimination to LoopDeletion, part 2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50437 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 20:06:54 +00:00
Roman Levenstein
a0201d5204 Use std::set instead of std::priority_queue for the RegReductionPriorityQueue.
This removes the existing bottleneck related to the removal of elements from 
the middle of the queue.

Also fixes a subtle bug in ScheduleDAGRRList::CapturePred:
It was updating the state of the SUnit before removing it. As a result, the
comparison operators were working incorrectly and this SUnit could not be removed 
from the queue properly.

Reviewed by Evan and Dan. Approved by Dan.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50412 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 09:07:59 +00:00
Owen Anderson
0ff7708a5b Add dead loop elimination, which removes dead loops for which we can compute
the trip count.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50382 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 00:38:34 +00:00
Anton Korobeynikov
1fcfc3b6b2 Correct parameter attributes encoding for C bindings.
Patch by Anders Johnsen!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50375 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-28 21:48:04 +00:00
Dale Johannesen
beb5be0332 Don't try to convert PPC long double.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50369 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-28 19:46:58 +00:00
Ted Kremenek
9d695d5f7d Add more alignment enums.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50363 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-28 17:58:20 +00:00
Gordon Henriksen
e2435da8ab Expose parameter attributes via C bindings.
Patch by Anders Johnsen!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50360 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-28 17:37:06 +00:00
Dan Gohman
1f13c686df Fix the SVOffset values for loads and stores produced by
memcpy/memset expansion. It was a bug for the SVOffset value
to be used in the actual address calculations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50359 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-28 17:15:20 +00:00
Mikhail Glushenkov
beb4d8293d Add support for response files to the CommandLine library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50355 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-28 16:44:25 +00:00
Chris Lattner
b606dba13b Remove the SmallVector ctor that converts from a SmallVectorImpl. This
conversion open the door for many nasty implicit conversion issues, and
can be easily solved by initializing with (V.begin(), V.end()) when 
needed.

This patch includes many small cleanups for sdisel also.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50340 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-28 06:44:42 +00:00
Chris Lattner
e49e52d856 restore the copy ctor in SmallVector. This fixes serious
errors I introduced in my last patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50338 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-28 06:32:08 +00:00
Chris Lattner
5da0b73aa1 generalize SmallVector copy ctor, there is no requirement for
the initialization vector to have the same fixed size, just the
same element type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50334 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-28 06:01:06 +00:00
Chris Lattner
5a09690446 Implement a signficant optimization for inline asm:
When choosing between constraints with multiple options,
like "ir", test to see if we can use the 'i' constraint and
go with that if possible.  This produces more optimal ASM in
all cases (sparing a register and an instruction to load it),
and fixes inline asm like this:

void test () {
  asm volatile (" %c0 %1 " : : "imr" (42), "imr"(14));
}

Previously we would dump "42" into a memory location (which
is ok for the 'm' constraint) which would cause a problem
because the 'c' modifier is not valid on memory operands.

Isn't it great how inline asm turns 'missed optimization'
into 'compile failed'??

Incidentally, this was the todo in 
PowerPC/2007-04-24-InlineAsm-I-Modifier.ll

Please do NOT pull this into Tak.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50315 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-27 00:37:18 +00:00
Chris Lattner
4376fea663 Move a bunch of inline asm code out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50313 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-27 00:09:47 +00:00
Chris Lattner
5e764233f3 A few inline asm cleanups:
- Make targetlowering.h fit in 80 cols.
  - Make LowerAsmOperandForConstraint const.
  - Make lowerXConstraint -> LowerXConstraint
  - Make LowerXConstraint return a const char* instead of taking a string byref.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50312 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-26 23:02:14 +00:00
Nick Lewycky
280a6e607d Remove 'unwinds to' support from mainline. This patch undoes r47802 r47989
r48047 r48084 r48085 r48086 r48088 r48096 r48099 r48109 and r48123.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50265 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 16:53:59 +00:00
Gordon Henriksen
877ee973e2 PR2245: Misleading parameter name in llvm-c/Core.h:LLVMConstArray
Applying fix by Frits van Bommel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50250 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 03:21:19 +00:00
Ted Kremenek
13f7a40508 Implement != for DenseSet iterators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50236 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-24 23:49:45 +00:00
Ted Kremenek
ea33c8fed6 Added iterator support for DenseSet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50235 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-24 23:48:12 +00:00
Evan Cheng
a971dbdde2 - Check if a register is livein before removing it. It may have already been removed.
- Do not iterate over SmallPtrSet, the order of iteration is not deterministic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50209 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-24 09:06:33 +00:00
Anton Korobeynikov
769b481e9f Add facility for pre-RA passes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50165 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-23 18:22:28 +00:00
Anton Korobeynikov
45709ae09b Make stack alignment options global for all targets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50157 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-23 18:18:10 +00:00
Dan Gohman
55888274f2 Fix some whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50151 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-23 17:50:15 +00:00
Chris Lattner
d52b62ae05 Enforce that multiple return values have to have at least one result.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50137 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-23 05:36:34 +00:00
Nick Lewycky
75712b8b3f Whoops! Undo r50087, unbreak the build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50088 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-22 05:20:06 +00:00
Nick Lewycky
59091c4630 Reverse r47989. Part of removing 'unwinds to' support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50087 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-22 05:16:51 +00:00
Chris Lattner
54b9c3ba2a Move SplitBlockPredecessors out of loopsimplify into BasicBlockUtils.h
as a global helper function.  At the same type, switch it from taking
a vector of predecessors to an arbitrary sequential input.  This allows
us to switch LoopSimplify to use a SmallVector for various temporary
vectors that it passed into SplitBlockPredecessors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50020 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-21 01:28:02 +00:00
Chris Lattner
7ae40e7d8a add a handy helper method to instruction, useful for determining
whether it is used outside of some block.  This can be used to see
if there are any non-local references, for example.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50004 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-20 22:11:30 +00:00
Chris Lattner
8383a7b7a6 Add a new Jump Threading pass, which will handle cases
such as those in PR2235.  Right now the pass is not very
effective. :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50000 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-20 20:35:01 +00:00
Dale Johannesen
9dd2ce46c5 Check we aren't trying to convert PPC long double.
This fixes the testsuite failure on ppcf128-4.ll.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49994 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-20 18:23:46 +00:00
Nicolas Geoffray
5913e6c5db Cosmetic changes, as suggested by Evan. No functionality changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49993 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-20 17:44:19 +00:00
Chris Lattner
bcd203cf86 Allow argpromote to promote struct arguments with a specified number
of elements.  Patch by Matthijs Kooijman!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49962 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-19 19:50:01 +00:00
Nicolas Geoffray
dc17ab2bf0 Enable jitting with a known memory size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49924 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-18 20:59:31 +00:00
Dan Gohman
35b31bea0d Remove the implicit conversion from SDOperandPtr to SDOperand*; this
may fix a build error on Visual Studio.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49876 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-17 23:02:12 +00:00
Argyrios Kyrtzidis
0861d1fa5c Bring in uint32_t, uint64_t, and int64_t types for MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49854 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-17 13:56:31 +00:00
Roman Levenstein
02819257a6 Minor clean-up based on Dan's comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49844 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-17 09:29:48 +00:00
Scott Michel
4bf393a13e Workaround for PR2207, in which pred_iterator assert gets triggered due to a
wee problem in Xcode 2.[45]/gcc 4.0.1.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49831 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 23:46:39 +00:00
Dan Gohman
7e4d5b6002 Fix a copy+paste error in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49820 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 21:57:29 +00:00
Nicolas Geoffray
51cc3c13ea Correlate stubs with functions in JIT: when emitting a stub, the JIT tells the memory manager which function
the stub will resolve.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49814 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 20:46:05 +00:00
Eric Christopher
e20bbc8101 Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49813 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 20:45:31 +00:00
Nicolas Geoffray
52e724ad7e Infrastructure for getting the machine code size of a function and an instruction. X86, PowerPC and ARM are implemented
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49809 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 20:10:13 +00:00
Bill Wendling
a5261923b4 Add "empty()" method to sys::Path and remove unnecessary whitespace.
Patch by Mikhail Glushenkov!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49803 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 18:27:02 +00:00
Roman Levenstein
9cac5259fe Ongoing work on improving the instruction selection infrastructure:
Rename SDOperandImpl back to SDOperand.
Introduce the SDUse class that represents a use of the SDNode referred by
an SDOperand. Now it is more similar to Use/Value classes.

Patch is approved by Dan Gohman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49795 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 16:15:27 +00:00
Gabor Greif
917365bef1 merge of r49785 (from branches/ggreif/use-diet): pass V to dyn_cast by const reference, this avoids copy-constructing and destructing all the time. especially important if these constructors are not accessible
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49787 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 11:43:47 +00:00
Evan Cheng
0d4bdde327 Rewrite LiveVariable liveness computation. The new implementation is much simplified. It eliminated the nasty recursive routines and removed the partial def / use bookkeeping. There is also potential for performance improvement by replacing the conservative handling of partial physical register definitions. The code is currently disabled until live interval analysis is taught of the name scheme.
This patch also fixed a couple of nasty corner cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49784 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 09:46:40 +00:00
Owen Anderson
1f23e16319 Major repairs to the post-dominators implementation. Patch from Florian Brandner!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49768 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 04:21:16 +00:00
Chris Lattner
036a94ed61 fix off by one error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49766 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 04:10:37 +00:00
Chris Lattner
c0814dc606 give smallstring some methods to do 'itoa'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49765 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 04:05:02 +00:00
Dale Johannesen
94bef327aa Make 64-to-32 bit truncations explicit (prevent warnings).
All values here fit in 32 bits.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49736 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-15 18:44:59 +00:00
Nicolas Geoffray
6ccbbd8990 Change Divided flag to Split, as suggested by Evan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49715 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-15 08:08:50 +00:00
Evan Cheng
8102703d70 Sort sub-registers and super-registers lists according to super-sub register relations. e.g. X86::RAX sub-register list is EAX, AX, AL, AH (order of last two are not guaranteed).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49714 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-15 07:56:03 +00:00
Dan Gohman
80792f3dde Treat EntryToken nodes as "passive" so that they aren't added to the
ScheduleDAG; they don't correspond to any actual instructions so they
don't need to be scheduled.

This fixes a bug where the EntryToken was being scheduled multiple
times in some cases, though it ended up not causing any trouble because 
EntryToken doesn't expand into anything. With this fixed the schedulers
reliably schedule the expected number of units, so we can check this
with an assertion.

This requires a tweak to test/CodeGen/X86/loop-hoist.ll because it
ends up getting scheduled differently in a trivial way, though it was
enough to fool the prcontext+grep that the test does.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49701 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-15 01:22:18 +00:00
Dan Gohman
89bf0a6b05 In -view-sunit-dags, display "special" chain dependencies as cyan
instead of blue to distinguish them from regular dependencies.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49696 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-14 23:15:07 +00:00
Dan Gohman
235fc57ef2 Teach AliasSetTracker about VAArgInst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49674 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-14 18:34:50 +00:00
Dan Gohman
29e4bdbf27 Fix const-correctness issues with the SrcValue handling in the
memory intrinsic expansion code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49666 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-14 17:55:48 +00:00
Dale Johannesen
3541af73b6 Reverse sense of unwind-tables option. This means
stack tracebacks on Darwin x86-64 won't work by default;
nevertheless, everybody but me thinks this is a good idea.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49663 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-14 17:54:17 +00:00
Dan Gohman
ec1f1a8bd2 Clean up some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49661 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-14 17:45:20 +00:00
Chris Lattner
75caee2419 add a new CallGraphNode::removeCallEdgeFor method, tidy some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49617 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-13 19:41:25 +00:00
Chris Lattner
f99b286154 Add support for equality comparison of CallSite's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49616 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-13 19:40:26 +00:00
Nicolas Geoffray
c0cb28fd3a Add a divided flag for the first piece of an argument divided into mulitple parts. Fixes PR1643
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49611 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-13 13:40:22 +00:00
Duncan Sands
89f6d88db3 Merge LLVMBuilder and FoldingBuilder, calling
the result IRBuilder.  Patch by Dominic Hamon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49604 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-13 06:22:09 +00:00
Dan Gohman
707e018423 Drop ISD::MEMSET, ISD::MEMMOVE, and ISD::MEMCPY, which are not Legal
on any current target and aren't optimized in DAGCombiner. Instead
of using intermediate nodes, expand the operations, choosing between
simple loads/stores, target-specific code, and library calls,
immediately.

Previously, the code to emit optimized code for these operations
was only used at initial SelectionDAG construction time; now it is
used at all times. This fixes some cases where rep;movs was being
used for small copies where simple loads/stores would be better.

This also cleans up code that checks for alignments less than 4;
let the targets make that decision instead of doing it in
target-independent code. This allows x86 to use rep;movs in
low-alignment cases.

Also, this fixes a bug that resulted in the use of rep;stos for
memsets of 0 with non-constant memory size when the alignment was
at least 4. It's better to use the library in this case, which
can be significantly faster when the size is large.

This also preserves more SourceValue information when memory
intrinsics are lowered into simple loads/stores.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49572 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-12 04:36:06 +00:00
Evan Cheng
4cce6b4c78 Use of implicit_def is not part of live interval. Create empty intervals for the uses when the live interval is being spilled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49542 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 17:53:36 +00:00
Chris Lattner
30ac7df857 improvements for IntrusiveRefCntPtr, patch by Mikhail Glushenkov
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49538 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 16:42:06 +00:00
Evan Cheng
5d3600f576 Allow registers defined by implicit_def to be clobbered.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49512 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 23:47:53 +00:00
Dan Gohman
b1e07ec6a4 Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49502 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 22:27:06 +00:00
Dan Gohman
7d8143f0ef Make isVectorClearMaskLegal's operand list const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49446 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 20:09:42 +00:00
Dan Gohman
920c6828ee Fix some minor errors in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49445 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 20:08:06 +00:00
Dan Gohman
cedbacffd6 Add const qualifiers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49443 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 18:31:41 +00:00
Dan Gohman
c76230b485 Update comments to use 2.0 syntax type names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49442 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 18:24:25 +00:00
Chris Lattner
d6d48c4e5b ConstantFP::get should be static.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49434 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 17:16:28 +00:00
Owen Anderson
a723d1e48f Factor a bunch of functionality related to memcpy and memset transforms out of
GVN and into its own pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49419 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 08:23:16 +00:00
Evan Cheng
a541931ddb Unbreak teh build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49417 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 07:06:01 +00:00
Chris Lattner
4592230265 add a version of ConstantFP::get that doesn't take a redundant Type* value,
start migrating code over to use it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49413 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 00:45:01 +00:00
Chris Lattner
def286408f make ConstantFP::isExactlyValue work for long double as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49410 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 00:03:58 +00:00
Devang Patel
cba931f601 Add CreateGetResult()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49398 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 20:41:22 +00:00
Devang Patel
7518583044 Add multiple value return instruction constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49374 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 07:30:13 +00:00
Duncan Sands
92432a8db1 Convenience method for setting the nounwind
attribute for a function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49373 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 07:23:58 +00:00
Dale Johannesen
4e1b79459f Implement new llc flag -disable-required-unwind-tables.
Corresponds to -fno-unwind-tables (usually default in gcc).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49361 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 00:10:24 +00:00
Ted Kremenek
9b01cc0ede Make getDirnameSep a static method (not part of Path's interface).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49354 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 22:01:32 +00:00
Ted Kremenek
cf55c8e221 Added method Path::getDirname().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49352 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 21:53:57 +00:00
Sam Bishop
a0562001d0 Added support for Create() calls that take an argument besides the
deserializer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49350 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 21:36:46 +00:00
Dan Gohman
36b5c1338a Rename MemOperand to MachineMemOperand. This was suggested by
review feedback from Chris quite a while ago. No functionality
change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49348 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 19:35:22 +00:00
Owen Anderson
412821284f Add operator= implementations to SparseBitVector, allowing it to be used in GVN. This results
in both time and memory savings for GVN.  For example, one testcase went from 10.5s to 6s with
this patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49345 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 17:38:23 +00:00
Roman Levenstein
dc1adac582 Re-commit of the r48822, where the infinite looping problem discovered
by Dan Gohman is fixed.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49330 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 10:06:32 +00:00
Owen Anderson
e5ffa900f8 Make GVN more memory efficient, particularly on code that contains a large number of
allocations, which GVN can't optimize anyways.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49329 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 09:59:07 +00:00
Gabor Greif
051a950000 API changes for class Use size reduction, wave 1.
Specifically, introduction of XXX::Create methods
for Users that have a potentially variable number of
Uses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49277 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 20:25:17 +00:00
Evan Cheng
c5ea2010c0 Forgot this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49247 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-05 02:17:58 +00:00
Duncan Sands
b51a0d87ac If a value is cast to its own type, then the cast
is not needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49210 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-04 08:28:13 +00:00
Chris Lattner
f4cc3096fd Make ExecutionEngine::updateGlobalMapping return the old mapping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49206 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-04 04:47:41 +00:00
Ted Kremenek
a150ffeada Add member template version of SerializeTrait<T>::Create that also accepts
an optional argument for us by T's Create method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49169 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03 16:44:37 +00:00
Evan Cheng
f30a49d9e0 Special handling of zero-sized live intervals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49167 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03 16:40:27 +00:00
Evan Cheng
419852ca8a - Treat a live range defined by an implicit_def as a zero-sized one.
- Eliminate an implicit_def when it's being spilled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49166 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03 16:39:43 +00:00
Evan Cheng
8a50f1fcf0 Start of a series of patches related to implicit_def.
There is no point in creating a long live range defined by an implicit_def. Scheduler now duplicates implicit_def instruction for each of its uses. Therefore, if an implicit_def node has multiple uses, it will become a number of very short live ranges, rather than a long one. This will make coalescer's job easier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49164 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03 16:36:07 +00:00
Evan Cheng
6397c64441 Backing out 48222 temporarily.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49124 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03 03:13:16 +00:00
David Greene
a022e3fc2f Iterators folloring a SmallVector erased element are invalidated so
don't access cached iterators from after the erased element.

Re-apply 49056 with SmallVector support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49106 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 18:24:46 +00:00
Evan Cheng
ea1d9cdc4e Now that I am told MachineRegisterInfo also tracks physical register uses / defs, I can do away with the horribleness I introduced a while back. It's impossible to detect if there is any use of a physical register below an instruction (and before any def of the register) with some cheap book keeping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49105 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 18:04:08 +00:00
Evan Cheng
1088317675 Remove #include<map> from LiveVariables.h. Not referenced.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49099 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 17:23:50 +00:00
Torok Edwin
56c2f99f00 Add new file Support/DataFlow.h.
It allows Use-Def and Def-Use relations to be treated as graphs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49088 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 14:57:52 +00:00
Anton Korobeynikov
67073f1cbd Add new CC lowering rule: provide a list of registers, which can be 'shadowed',
when some another register is used for argument passing.
Currently is used on Win64.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49079 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 05:23:57 +00:00
Dale Johannesen
1532f3ddd7 Recommitting EH patch; this should answer most of the
review feedback.
-enable-eh is still accepted but doesn't do anything.
EH intrinsics use Dwarf EH if the target supports that,
and are handled by LowerInvoke otherwise.
The separation of the EH table and frame move data is,
I think, logically figured out, but either one still
causes full EH info to be generated (not sure how to
split the metadata correctly).
MachineModuleInfo::needsFrameInfo is no longer used and
is removed.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49064 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 00:25:04 +00:00
Chris Lattner
038112a4e0 Change the MemoryBuffer::getFile* methods to take just a pointer to the
start of a filename, not a filename+length.  All clients can produce a
null terminated name, and the system api's require null terminated 
strings anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49041 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 18:04:03 +00:00
Chris Lattner
98b7e612b2 MappedFile is dead, remove it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49035 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 06:20:44 +00:00
Chris Lattner
799ed1053b Stub out some sys::Path::MapInFilePages/UnMapFilePages methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49030 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 06:00:12 +00:00
Chris Lattner
7f6b447904 change the archive stuff to use MemoryBuffer instead of mappedfile.
MemoryBuffer is higher level and more closely matches the model
needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49029 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 04:26:46 +00:00
Chris Lattner
685412e92f prune unneeded #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49028 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 04:00:45 +00:00
Chris Lattner
2fcebc5e63 rewrite SourceFile to be in terms of MemoryBuffer, not MappedFile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49027 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 03:59:34 +00:00
Chris Lattner
23ffec8258 Make MappedFile::map return a const correct pointer, don't leak address space on Unix platforms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49026 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 03:49:38 +00:00
Chris Lattner
37db5d67f9 Remove the MappedFile::charBase member, rename base -> getBase() and
make getBase() return a const-correct pointer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49025 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 03:40:53 +00:00
Chris Lattner
cc56e64a59 add an accessor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49023 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 03:20:31 +00:00
Chris Lattner
bdbd2d710c Remove MappedFile support for mapping files for write and exec
and shared.  This complicates the design, is not used, and probably
doesn't even work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49022 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 03:10:22 +00:00
Chris Lattner
558755ce1a remove extraneous #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49021 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 03:01:15 +00:00
Chris Lattner
1213d67265 update comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49010 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 00:54:39 +00:00
Chris Lattner
540630f637 cleanup the MappedFile API and comments. This removes and updates
tons of out of date comments (really nothing throws here!) and fixes
some other fairly glaring issues: "size" used to return the size of 
the file *and* change it, depending on how you called it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49009 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 00:53:25 +00:00
Chris Lattner
328c84aa99 remove DEFINING_FILE_FOR for MappedFile.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49008 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 00:35:55 +00:00
Evan Cheng
ca1267c02b Move reMaterialize() from TargetRegisterInfo to TargetInstrInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48995 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-31 20:40:39 +00:00
Torok Edwin
f4290266e9 test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48984 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-31 17:09:58 +00:00
Erick Tryzelaar
d6d018589c Expose Function::viewCFG and Function::viewCFGOnly to bindings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48982 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-31 16:22:09 +00:00
Chris Lattner
d27c991ceb Fix "Control reaches the end of non-void function" warnings,
patch by David Chisnall.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48963 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-30 18:22:13 +00:00
Evan Cheng
9180c8e3cf Cosmetic change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48935 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-29 01:04:05 +00:00
Duncan Sands
e10efce225 Rename getAnyLoad to getLoad is suggested by Evan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48914 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-28 09:45:24 +00:00
Duncan Sands
14ea39cf3c Implement LegalizeTypes support for softfloat LOAD.
In order to handle indexed nodes I had to introduce
a new constructor, and since I was there I factorized
the code in the various load constructors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48894 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 20:23:40 +00:00
Dan Gohman
86e1ebf9bb Avoid creating chain dependencies from CopyToReg nodes to load and store
nodes. This doesn't currently have much impact the generated code, but it
does produce simpler-looking SelectionDAGs, and consequently
simpler-looking ScheduleDAGs, because there are fewer spurious
dependencies.

In particular, CopyValueToVirtualRegister now uses the entry node as the
input chain dependency for new CopyToReg nodes instead of calling getRoot
and depending on the most recent memory reference.

Also, rename UnorderedChains to PendingExports and pull it up from being
a local variable in SelectionDAGISel::BuildSelectionDAG to being a
member variable of SelectionDAGISel, so that it doesn't have to be
passed around to all the places that need it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48893 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 19:56:19 +00:00