oota-llvm.git
16 years agoCorrectly construct live intervals for the copies we inserted into the predecessors...
Owen Anderson [Wed, 4 Jun 2008 17:55:58 +0000 (17:55 +0000)]
Correctly construct live intervals for the copies we inserted into the predecessors of a block containing a PHI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51950 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRevert this.
Evan Cheng [Wed, 4 Jun 2008 17:21:44 +0000 (17:21 +0000)]
Revert this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51949 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoReplace two manual loops with calls to CallSite::hasArguments (no functional changes).
Matthijs Kooijman [Wed, 4 Jun 2008 16:57:50 +0000 (16:57 +0000)]
Replace two manual loops with calls to CallSite::hasArguments (no functional changes).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51947 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd CallSite::hasArgument to allow for seeing if a call passes a certain value as...
Matthijs Kooijman [Wed, 4 Jun 2008 16:31:12 +0000 (16:31 +0000)]
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

16 years agoAdd a Name parameter to two of the init methods of GetElementPointer to make the...
Matthijs Kooijman [Wed, 4 Jun 2008 16:14:12 +0000 (16:14 +0000)]
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

16 years agoFix example to be valid LLVM assembly.
Matthijs Kooijman [Wed, 4 Jun 2008 15:46:35 +0000 (15:46 +0000)]
Fix example to be valid LLVM assembly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51942 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoImplement the two constructors in InsertValueInst and ExtractValueInst.
Matthijs Kooijman [Wed, 4 Jun 2008 14:40:55 +0000 (14:40 +0000)]
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

16 years agoAdd a stack slot coloring pass. Not yet enabled.
Evan Cheng [Wed, 4 Jun 2008 09:18:41 +0000 (09:18 +0000)]
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

16 years agoLowerSubregs should not clobber any analysis.
Evan Cheng [Wed, 4 Jun 2008 09:17:16 +0000 (09:17 +0000)]
LowerSubregs should not clobber any analysis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51933 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMove #include to right place.
Evan Cheng [Wed, 4 Jun 2008 09:16:33 +0000 (09:16 +0000)]
Move #include to right place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51932 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRegister if-converter pass for -debug-pass.
Evan Cheng [Wed, 4 Jun 2008 09:15:51 +0000 (09:15 +0000)]
Register if-converter pass for -debug-pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51931 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMore pass manager debugging outputs.
Evan Cheng [Wed, 4 Jun 2008 09:13:31 +0000 (09:13 +0000)]
More pass manager debugging outputs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51930 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoChange packed struct layout so that field sizes
Duncan Sands [Wed, 4 Jun 2008 08:21:45 +0000 (08:21 +0000)]
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

16 years agoAdd #includes required by GCC 4.3, thanks for Zhongxing Xu
Chris Lattner [Wed, 4 Jun 2008 04:46:14 +0000 (04:46 +0000)]
Add #includes required by GCC 4.3, thanks for Zhongxing Xu
for reporting this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51926 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoSome Mips minor fixes
Bruno Cardoso Lopes [Wed, 4 Jun 2008 01:45:25 +0000 (01:45 +0000)]
Some Mips minor fixes
Added support for mips little endian arch => mipsel

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51923 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoWe need to subtract one from this index because live ranges are open at the end.
Owen Anderson [Wed, 4 Jun 2008 00:38:56 +0000 (00:38 +0000)]
We need to subtract one from this index because live ranges are open at the end.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51922 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix spellnig error
Scott Michel [Tue, 3 Jun 2008 19:13:20 +0000 (19:13 +0000)]
Fix spellnig error

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51917 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTestcase for LoopIndexSplit and DomFrontier.
Owen Anderson [Tue, 3 Jun 2008 18:32:27 +0000 (18:32 +0000)]
Testcase for LoopIndexSplit and DomFrontier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51916 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoLoopIndexSplit can sometimes result in cases where a block in its own domfrontier.
Owen Anderson [Tue, 3 Jun 2008 18:29:48 +0000 (18:29 +0000)]
LoopIndexSplit can sometimes result in cases where a block in its own domfrontier.
Don't crash when we encounter one of these.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51915 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoExpand documentation of StringConstantPrefix.
Dale Johannesen [Tue, 3 Jun 2008 18:15:03 +0000 (18:15 +0000)]
Expand documentation of StringConstantPrefix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51911 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoPrevent a crash in debug dumps.
Dale Johannesen [Tue, 3 Jun 2008 18:14:29 +0000 (18:14 +0000)]
Prevent a crash in debug dumps.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51910 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd StringConstantPrefix to control what the
Dale Johannesen [Tue, 3 Jun 2008 18:09:06 +0000 (18:09 +0000)]
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

16 years agoFind a better place to output hex constants corresponding to integers.
Scott Michel [Tue, 3 Jun 2008 15:39:51 +0000 (15:39 +0000)]
Find a better place to output hex constants corresponding to integers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51904 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFixed bug in bad behavior in calculateFrameObjectOffsets,
Bruno Cardoso Lopes [Tue, 3 Jun 2008 08:46:59 +0000 (08:46 +0000)]
Fixed bug in bad behavior in calculateFrameObjectOffsets,
the solution commited is different from the previous patch to
avoid int and unsigned comparison

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51899 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDo not run loop-aligner at -fast (e.g. -O0).
Evan Cheng [Tue, 3 Jun 2008 06:56:08 +0000 (06:56 +0000)]
Do not run loop-aligner at -fast (e.g. -O0).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51898 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRevert this patch
Scott Michel [Tue, 3 Jun 2008 06:18:19 +0000 (06:18 +0000)]
Revert this patch

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51897 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agonounwindify.
Dan Gohman [Tue, 3 Jun 2008 01:21:11 +0000 (01:21 +0000)]
nounwindify.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51893 91177308-0d34-0410-b5e6-96231b3b80d8

16 years ago"Unable to schedule <A> required by <B>" is more helpful then
Devang Patel [Tue, 3 Jun 2008 01:20:02 +0000 (01:20 +0000)]
"Unable to schedule <A> required by <B>" is more helpful then
"Unable to handle Pass that requires lower level Analysis pass"

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51892 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd debugging aid.
Devang Patel [Tue, 3 Jun 2008 01:02:16 +0000 (01:02 +0000)]
Add debugging aid.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51891 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix whitespace in whitespace-significant pseudocode in a comment.
Dan Gohman [Tue, 3 Jun 2008 00:57:21 +0000 (00:57 +0000)]
Fix whitespace in whitespace-significant pseudocode in a comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51890 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoConstant folding for insertvalue and extractvalue.
Dan Gohman [Tue, 3 Jun 2008 00:15:20 +0000 (00:15 +0000)]
Constant folding for insertvalue and extractvalue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51889 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUpdate dom tree. Fix PR 2372.
Devang Patel [Mon, 2 Jun 2008 22:52:56 +0000 (22:52 +0000)]
Update dom tree. Fix PR 2372.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51887 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFold adds and subtracts of zero immediately, instead of waiting
Dan Gohman [Mon, 2 Jun 2008 22:27:05 +0000 (22:27 +0000)]
Fold adds and subtracts of zero immediately, instead of waiting
for dagcombine to do this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51886 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMinor cosmetic patch so that the hex equivalent of a decimal
Scott Michel [Mon, 2 Jun 2008 22:19:12 +0000 (22:19 +0000)]
Minor cosmetic patch so that the hex equivalent of a decimal
constant shows up in the assembly language output. Helps with
debugging without a HP calculator having to be handy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51885 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd necessary 64-bit support so that gcc frontend compiles (mostly). Current
Scott Michel [Mon, 2 Jun 2008 22:18:03 +0000 (22:18 +0000)]
Add necessary 64-bit support so that gcc frontend compiles (mostly). Current
issue is operand promotion for setcc/select... but looks like the fundamental
stuff is implemented for CellSPU.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51884 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoImplement CBE support for first-class structs and array values,
Dan Gohman [Mon, 2 Jun 2008 21:30:49 +0000 (21:30 +0000)]
Implement CBE support for first-class structs and array values,
and insertvalue and extractvalue instructions.

First-class array values are not trivial because C doesn't
support them. The approach I took here is to wrap all arrays
in structs. Feedback is welcome.

The 2007-01-15-NamedArrayType.ll test needed to be modified
because it has a "not grep" for a string that now exists,
because array types now have associated struct types, and
those struct types have names.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51881 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUpdate the polygen grammer for the new insertvalue and extractvalue syntax.
Dan Gohman [Mon, 2 Jun 2008 19:47:09 +0000 (19:47 +0000)]
Update the polygen grammer for the new insertvalue and extractvalue syntax.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51879 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove unneeded code I added.
Chris Lattner [Mon, 2 Jun 2008 18:39:07 +0000 (18:39 +0000)]
Remove unneeded code I added.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51878 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix the position of MemOperands in nodes that use variadic_ops
Dan Gohman [Mon, 2 Jun 2008 17:40:38 +0000 (17:40 +0000)]
Fix the position of MemOperands in nodes that use variadic_ops
in DAGISelEmitter output. This bug was recently uncovered by the
addition of patterns for CALL32m and CALL64m, which are nodes
that now have both MemOperands and variadic_ops.

This bug was especially visible with PIC in various configurations,
because the new patterns are matching the indirect call code used
in many PIC configurations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51877 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoCorrectly handle removed instructions at the beginning of MBBs when renumbering.
Owen Anderson [Mon, 2 Jun 2008 17:36:36 +0000 (17:36 +0000)]
Correctly handle removed instructions at the beginning of MBBs when renumbering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51876 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFixes PR2395. Looking for a constant in a GEP tail (when the first GEP
Wojciech Matyjewicz [Mon, 2 Jun 2008 17:26:12 +0000 (17:26 +0000)]
Fixes PR2395. Looking for a constant in a GEP tail (when the first GEP
is longer than the second one) should stop after finding one. Added break
instruction guarantees it. It also changes difference between offsets to
absolute value of this difference in the condition.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51875 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoupdate vc configure project for renaming of
Steve Naroff [Mon, 2 Jun 2008 16:37:36 +0000 (16:37 +0000)]
update vc configure project for renaming of
hash_map/hash_set/iterator to have a .h suffix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51867 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't use the GOT for symbols that are not externally visible.
Rafael Espindola [Mon, 2 Jun 2008 07:52:43 +0000 (07:52 +0000)]
Don't use the GOT for symbols that are not externally visible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51865 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agomove CannotBeNegativeZero to ValueTracking. Simplify some signbit comparisons.
Chris Lattner [Mon, 2 Jun 2008 01:29:46 +0000 (01:29 +0000)]
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

16 years agomove ComputeMaskedBits, MaskedValueIsZero, and ComputeNumSignBits
Chris Lattner [Mon, 2 Jun 2008 01:18:21 +0000 (01:18 +0000)]
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

16 years agoFix two issues that Eli Friedman pointed out, where would misoptimized code like:
Owen Anderson [Sun, 1 Jun 2008 22:26:26 +0000 (22:26 +0000)]
Fix two issues that Eli Friedman pointed out, where would misoptimized code like:

char a[200];
init(a, a+200);

OR

int a[200];
char* b = (char*)a;
char* c = (char*)a;
foo(b, c);

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51850 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTest for PR2401
Owen Anderson [Sun, 1 Jun 2008 21:55:55 +0000 (21:55 +0000)]
Test for PR2401

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51849 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't remove the memcpy when call slot substitution fails.
Owen Anderson [Sun, 1 Jun 2008 21:52:16 +0000 (21:52 +0000)]
Don't remove the memcpy when call slot substitution fails.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51848 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemember to update the reverse non-local cache when cleaning up dirty entries. This...
Owen Anderson [Sun, 1 Jun 2008 21:03:52 +0000 (21:03 +0000)]
Remember to update the reverse non-local cache when cleaning up dirty entries.  This fixes PR2397.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51846 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMake ping more aggressive in finding nonlocal caching errors.
Owen Anderson [Sun, 1 Jun 2008 20:51:41 +0000 (20:51 +0000)]
Make ping more aggressive in finding nonlocal caching errors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51845 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoPrune empty dirs
Anton Korobeynikov [Sun, 1 Jun 2008 20:11:03 +0000 (20:11 +0000)]
Prune empty dirs

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51844 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoadd a predicate.
Chris Lattner [Sun, 1 Jun 2008 18:09:04 +0000 (18:09 +0000)]
add a predicate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51842 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoInitialize members properly during construction
Anton Korobeynikov [Sun, 1 Jun 2008 16:22:49 +0000 (16:22 +0000)]
Initialize members properly during construction

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51841 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoWhen simplifying a call to a bitcast function, tighten up
Duncan Sands [Sun, 1 Jun 2008 07:38:42 +0000 (07:38 +0000)]
When simplifying a call to a bitcast function, tighten up
the conditions for performing the transform when only the
function declaration is available: no longer allow turning
i32 into i64 for example.  Only allow changing between
pointer types, and between pointer types and integers of
the same size.  For return values ptr -> intptr was already
allowed; I added ptr -> ptr and intptr -> ptr while there.
As shown by a recent objc testcase, changing the way
parameters/return values are passed can be fatal when calling
code written in assembler that directly manipulates call
arguments and return values unless the transform has no
impact on the way they are passed at the codegen level.
While it is possible to imagine an ABI that treats integers
of pointer size differently to pointers, I don't think LLVM
supports any so the transform should now be safe while still
being useful.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51834 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFixed flag issue that was generating infinite loop while in list scheduling.
Bruno Cardoso Lopes [Sun, 1 Jun 2008 03:49:39 +0000 (03:49 +0000)]
Fixed flag issue that was generating infinite loop while in list scheduling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51833 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd a standard for control-flow unreachable assertions in functions that return
Nick Lewycky [Sat, 31 May 2008 23:54:55 +0000 (23:54 +0000)]
Add a standard for control-flow unreachable assertions in functions that return
values, so as to avoid warnings on some platforms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51831 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoupdates to some svn:ignore properties
Gabor Greif [Sat, 31 May 2008 22:59:42 +0000 (22:59 +0000)]
updates to some svn:ignore properties

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51829 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoupdate this patch to handle an extraneous &1. This should be pulled
Chris Lattner [Sat, 31 May 2008 19:50:53 +0000 (19:50 +0000)]
update this patch to handle an extraneous &1.  This should be pulled
into the 2.3 release branch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51824 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAsmWriter support for insertvalue/extractvalue. These instructions can
Dan Gohman [Sat, 31 May 2008 19:12:39 +0000 (19:12 +0000)]
AsmWriter support for insertvalue/extractvalue. These instructions can
now round-trip through assembly and bitcode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51823 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoImproved bitcode support for insertvalue/extractvalue.
Dan Gohman [Sat, 31 May 2008 19:11:15 +0000 (19:11 +0000)]
Improved bitcode support for insertvalue/extractvalue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51822 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix a copy+paste error in a comment.
Dan Gohman [Sat, 31 May 2008 19:09:47 +0000 (19:09 +0000)]
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

16 years agoFix some bugs with the handling of indices in insertvalue/extractvalue.
Dan Gohman [Sat, 31 May 2008 19:09:08 +0000 (19:09 +0000)]
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

16 years agoPeer through sext/zext when looking for not(cmp).
Nick Lewycky [Sat, 31 May 2008 19:01:33 +0000 (19:01 +0000)]
Peer through sext/zext when looking for not(cmp).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51819 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoYay us! Every one of these examples turns into icmp/zext/ret.
Nick Lewycky [Sat, 31 May 2008 18:20:26 +0000 (18:20 +0000)]
Yay us! Every one of these examples turns into icmp/zext/ret.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51818 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd more i1 optimizations. add, sub, mul, s/udiv on i1 are now simplified away.
Nick Lewycky [Sat, 31 May 2008 17:59:52 +0000 (17:59 +0000)]
Add more i1 optimizations. add, sub, mul, s/udiv on i1 are now simplified away.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51817 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdding i1 is always Xor.
Nick Lewycky [Sat, 31 May 2008 17:10:28 +0000 (17:10 +0000)]
Adding i1 is always Xor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51816 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoCallback was not executed on OS X when it was a function.
Mikhail Glushenkov [Sat, 31 May 2008 13:43:21 +0000 (13:43 +0000)]
Callback was not executed on OS X when it was a function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51814 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix the CBE's handling of instructions whose result is an i1. Previously,
Chris Lattner [Sat, 31 May 2008 09:23:55 +0000 (09:23 +0000)]
Fix the CBE's handling of instructions whose result is an i1.  Previously,
we did not truncate the value down to i1 with (x&1).  This caused a problem
when the computation of x was nontrivial, for example, "add i1 1, 1" would
return 2 instead of 0.

This makes the testcase compile into:

...
  llvm_cbe_t = (((llvm_cbe_r == 0u) + (llvm_cbe_r == 0u))&1);
  llvm_cbe_u = (((unsigned int )(bool )llvm_cbe_t));
...

instead of:

...
  llvm_cbe_t = ((llvm_cbe_r == 0u) + (llvm_cbe_r == 0u));
  llvm_cbe_u = (((unsigned int )(bool )llvm_cbe_t));
...

This fixes a miscompilation of mediabench/adpcm/rawdaudio/rawdaudio and
403.gcc with the CBE, regressions from LLVM 2.2. Tanya, please pull
this into the release branch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51813 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFactor several methods, including getInversePredicate and
Dan Gohman [Sat, 31 May 2008 02:47:54 +0000 (02:47 +0000)]
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

16 years agoTeach the DAGISelEmitter to not compute the variable_ops operand
Dan Gohman [Sat, 31 May 2008 02:11:25 +0000 (02:11 +0000)]
Teach the DAGISelEmitter to not compute the variable_ops operand
index for the input pattern in terms of the output pattern. Instead
keep track of how many fixed operands the input pattern actually
has, and have the input matching code pass the output-emitting
function that index value. This simplifies the code, disentangles
variables_ops from the support for predication operations, and
makes variable_ops more robust.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51808 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove an unused variable.
Dan Gohman [Sat, 31 May 2008 01:44:25 +0000 (01:44 +0000)]
Remove an unused variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51807 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoIR, bitcode reader, bitcode writer, and asmparser changes to
Dan Gohman [Sat, 31 May 2008 00:58:22 +0000 (00:58 +0000)]
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

16 years agoRevert 51775.
Evan Cheng [Fri, 30 May 2008 22:47:19 +0000 (22:47 +0000)]
Revert 51775.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51795 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd an isAggregateType predicate.
Dan Gohman [Fri, 30 May 2008 22:40:06 +0000 (22:40 +0000)]
Add an isAggregateType predicate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51794 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix indentation.
Evan Cheng [Fri, 30 May 2008 22:39:32 +0000 (22:39 +0000)]
Fix indentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51793 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix indentation.
Evan Cheng [Fri, 30 May 2008 22:39:18 +0000 (22:39 +0000)]
Fix indentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51792 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd an operator< for SmallVector.
Dan Gohman [Fri, 30 May 2008 22:37:47 +0000 (22:37 +0000)]
Add an operator< for SmallVector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51791 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoThe coalescer doesn't need LiveVariables now that we have register use iterators.
Owen Anderson [Fri, 30 May 2008 22:37:27 +0000 (22:37 +0000)]
The coalescer doesn't need LiveVariables now that we have register use iterators.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51790 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agorewrite operand loops to use iterators
Gabor Greif [Fri, 30 May 2008 21:24:22 +0000 (21:24 +0000)]
rewrite operand loops to use iterators

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51789 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMake all help strings start in upper case.
Mikhail Glushenkov [Fri, 30 May 2008 21:14:10 +0000 (21:14 +0000)]
Make all help strings start in upper case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51788 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoForgot to commit this file.
Owen Anderson [Fri, 30 May 2008 20:14:04 +0000 (20:14 +0000)]
Forgot to commit this file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51786 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix the -opt switch and add a test case for it.
Mikhail Glushenkov [Fri, 30 May 2008 19:56:27 +0000 (19:56 +0000)]
Fix the -opt switch and add a test case for it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51784 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix indentation.
Mikhail Glushenkov [Fri, 30 May 2008 18:53:09 +0000 (18:53 +0000)]
Fix indentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51782 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd a --dry-run option to llvmc2. Patch by Holger Schurig.
Mikhail Glushenkov [Fri, 30 May 2008 18:48:52 +0000 (18:48 +0000)]
Add a --dry-run option to llvmc2. Patch by Holger Schurig.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51781 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoPreserve the register coallescer, and update live intervals more correctly by trigger...
Owen Anderson [Fri, 30 May 2008 18:38:26 +0000 (18:38 +0000)]
Preserve the register coallescer, and update live intervals more correctly by triggering a renumbering after phi elimination.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51780 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoSince LCSSA switched over to DenseMap, we have to be more careful to avoid iterator...
Owen Anderson [Fri, 30 May 2008 17:31:01 +0000 (17:31 +0000)]
Since LCSSA switched over to DenseMap, we have to be more careful to avoid iterator invalidation.  Fixes PR2385.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51777 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoPatches for building llvm on Solaris x86. Contributed by Nathan Keynes.
Evan Cheng [Fri, 30 May 2008 17:16:20 +0000 (17:16 +0000)]
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

16 years agoGive a proper error message when a command line option is defined more than
Matthijs Kooijman [Fri, 30 May 2008 13:26:11 +0000 (13:26 +0000)]
Give a proper error message when a command line option is defined more than
once (ie, at two different places in the source, not two times on the
commandline).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51771 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse eraseFromParent() instead of doing that manually in two places.
Matthijs Kooijman [Fri, 30 May 2008 12:35:46 +0000 (12:35 +0000)]
Use eraseFromParent() instead of doing that manually in two places.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51770 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoLet Instruction::getOpcodeName() return something useful for the new
Matthijs Kooijman [Fri, 30 May 2008 10:31:54 +0000 (10:31 +0000)]
Let Instruction::getOpcodeName() return something useful for the new
insertvalue / extractvalue instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51766 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd the "AsCheapAsAMove" flag to some 64-bit xor instructions.
Bill Wendling [Fri, 30 May 2008 06:47:04 +0000 (06:47 +0000)]
Add the "AsCheapAsAMove" flag to some 64-bit xor instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51761 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd a --save-temps option.
Mikhail Glushenkov [Fri, 30 May 2008 06:29:17 +0000 (06:29 +0000)]
Add a --save-temps option.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51760 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd a check for side effect-free options (specified only in the OptionList).
Mikhail Glushenkov [Fri, 30 May 2008 06:28:37 +0000 (06:28 +0000)]
Add a check for side effect-free options (specified only in the OptionList).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51759 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDocumentation update.
Mikhail Glushenkov [Fri, 30 May 2008 06:28:00 +0000 (06:28 +0000)]
Documentation update.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51758 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRefactoring: remove code duplication introduced in the previous patch.
Mikhail Glushenkov [Fri, 30 May 2008 06:27:29 +0000 (06:27 +0000)]
Refactoring: remove code duplication introduced in the previous patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51757 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRefactoring: split CollectProperties into two separate function objects.
Mikhail Glushenkov [Fri, 30 May 2008 06:27:02 +0000 (06:27 +0000)]
Refactoring: split CollectProperties into two separate function objects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51756 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoShow argv[0] in error messages (like gcc).
Mikhail Glushenkov [Fri, 30 May 2008 06:26:35 +0000 (06:26 +0000)]
Show argv[0] in error messages (like gcc).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51755 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoNew feature: OptionList.
Mikhail Glushenkov [Fri, 30 May 2008 06:26:08 +0000 (06:26 +0000)]
New feature: OptionList.

It can be handy to have all information about options gathered in a single place
to provide an overview of all supported options. This patch allows the following:

def Options : OptionList<[
(switch_option "E", (help "Help string")),
(alias_option "quiet", "q")
...
]>;

Tool-specific option properties (like 'append_cmd') have (obviously) no meaning in
this context, so the only properties that are allowed are 'help' and 'required'.

See usage example in examples/Clang.td.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51754 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDocumentation update.
Mikhail Glushenkov [Fri, 30 May 2008 06:25:24 +0000 (06:25 +0000)]
Documentation update.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51753 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoA small optimization: use static char* array instead of StrVector.
Mikhail Glushenkov [Fri, 30 May 2008 06:24:49 +0000 (06:24 +0000)]
A small optimization: use static char* array instead of StrVector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51752 91177308-0d34-0410-b5e6-96231b3b80d8