oota-llvm.git
16 years agoNew test for misaligned Altivec laod/store.
Dale Johannesen [Wed, 27 Feb 2008 23:14:50 +0000 (23:14 +0000)]
New test for misaligned Altivec laod/store.

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

16 years agoAssert on invalid PHINode::addIncoming() arguments. Patch by Erick Tryzelaar!
Anton Korobeynikov [Wed, 27 Feb 2008 22:37:28 +0000 (22:37 +0000)]
Assert on invalid PHINode::addIncoming() arguments. Patch by Erick Tryzelaar!

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

16 years agoHandle load/store of misaligned vectors that are the
Dale Johannesen [Wed, 27 Feb 2008 22:36:00 +0000 (22:36 +0000)]
Handle load/store of misaligned vectors that are the
same size as an int type by doing a bitconvert of
load/store of the int type (same algorithm as floating point).
This makes them work for ppc Altivec.  There was some
code that purported to handle loads of (some) vectors
by splitting them into two smaller vectors, but getExtLoad
rejects subvector loads, so this could never have worked;
the patch removes it.

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

16 years agofixes from review of first commit
Nick Kledzik [Wed, 27 Feb 2008 22:25:36 +0000 (22:25 +0000)]
fixes from review of first commit

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

16 years agouse PROJ_SRC_DIR so this builds with Apple style builds
Nick Kledzik [Wed, 27 Feb 2008 22:23:46 +0000 (22:23 +0000)]
use PROJ_SRC_DIR so this builds with Apple style builds

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

16 years agoDon't hard-code the mask size to be 32, which is incorrect on ppc64
Dan Gohman [Wed, 27 Feb 2008 21:12:32 +0000 (21:12 +0000)]
Don't hard-code the mask size to be 32, which is incorrect on ppc64
and was causing aborts with the new APInt changes. This may also be
fixing an obscure ppc64 bug.

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

16 years agoThis is done.
Evan Cheng [Wed, 27 Feb 2008 20:26:32 +0000 (20:26 +0000)]
This is done.

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

16 years agoFix a bug in dead spill slot elimination.
Evan Cheng [Wed, 27 Feb 2008 19:57:11 +0000 (19:57 +0000)]
Fix a bug in dead spill slot elimination.

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

16 years agoRemove the `else', at Evan's insistence.
Dan Gohman [Wed, 27 Feb 2008 19:44:57 +0000 (19:44 +0000)]
Remove the `else', at Evan's insistence.

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

16 years agoAdd -analyze support to postdomtree.
Dan Gohman [Wed, 27 Feb 2008 18:38:29 +0000 (18:38 +0000)]
Add -analyze support to postdomtree.

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

16 years agoactually run llc, thanks Dan :)
Chris Lattner [Wed, 27 Feb 2008 17:46:54 +0000 (17:46 +0000)]
actually run llc, thanks Dan :)

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

16 years agoAdd a FIXME about the VECTOR_SHUFFLE evil hack.
Duncan Sands [Wed, 27 Feb 2008 17:39:13 +0000 (17:39 +0000)]
Add a FIXME about the VECTOR_SHUFFLE evil hack.

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

16 years agoEmit an error when a library is not found. It is the GNU ld behavior and it is expect...
Lauro Ramos Venancio [Wed, 27 Feb 2008 17:20:32 +0000 (17:20 +0000)]
Emit an error when a library is not found. It is the GNU ld behavior and it is expected by the configure scripts.

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

16 years agoLegalizeTypes support for EXTRACT_VECTOR_ELT. The
Duncan Sands [Wed, 27 Feb 2008 13:34:40 +0000 (13:34 +0000)]
LegalizeTypes support for EXTRACT_VECTOR_ELT.  The
approach taken is different to that in LegalizeDAG
when it is a question of expanding or promoting the
result type: for example, if extracting an i64 from
a <2 x i64>, when i64 needs expanding, it bitcasts
the vector to <4 x i32>, extracts the appropriate
two i32's, and uses those for the Lo and Hi parts.
Likewise, when extracting an i16 from a <4 x i16>,
and i16 needs promoting, it bitcasts the vector to
<2 x i32>, extracts the appropriate i32, twiddles
the bits if necessary, and uses that as the promoted
value.  This puts more pressure on bitcast legalization,
and I've added the appropriate cases.  They needed to
be added anyway since users can generate such bitcasts
too if they want to.  Also, when considering various
cases (Legal, Promote, Expand, Scalarize, Split) it is
a pain that expand can correspond to Expand, Scalarize
or Split, so I've changed the LegalizeTypes enum so it
lists those different cases - now Expand only means
splitting a scalar in two.
The code produced is the same as by LegalizeDAG for
all relevant testcases, except for
2007-10-31-extractelement-i64.ll, where the code seems
to have improved (see below; can an expert please tell
me if it is better or not).
Before < vs after >.

<       subl    $92, %esp
<       movaps  %xmm0, 64(%esp)
<       movaps  %xmm0, (%esp)
<       movl    4(%esp), %eax
<       movl    %eax, 28(%esp)
<       movl    (%esp), %eax
<       movl    %eax, 24(%esp)
<       movq    24(%esp), %mm0
<       movq    %mm0, 56(%esp)
---
>       subl    $44, %esp
>       movaps  %xmm0, 16(%esp)
>       pshufd  $1, %xmm0, %xmm1
>       movd    %xmm1, 4(%esp)
>       movd    %xmm0, (%esp)
>       movq    (%esp), %mm0
>       movq    %mm0, 8(%esp)

<       subl    $92, %esp
<       movaps  %xmm0, 64(%esp)
<       movaps  %xmm0, (%esp)
<       movl    12(%esp), %eax
<       movl    %eax, 28(%esp)
<       movl    8(%esp), %eax
<       movl    %eax, 24(%esp)
<       movq    24(%esp), %mm0
<       movq    %mm0, 56(%esp)
---
>       subl    $44, %esp
>       movaps  %xmm0, 16(%esp)
>       pshufd  $3, %xmm0, %xmm1
>       movd    %xmm1, 4(%esp)
>       movhlps %xmm0, %xmm0
>       movd    %xmm0, (%esp)
>       movq    (%esp), %mm0
>       movq    %mm0, 8(%esp)

<       subl    $92, %esp
<       movaps  %xmm0, 64(%esp)
---
>       subl    $44, %esp

<       movl    16(%esp), %eax
<       movl    %eax, 48(%esp)
<       movl    20(%esp), %eax
<       movl    %eax, 52(%esp)
<       movaps  %xmm0, (%esp)
<       movl    4(%esp), %eax
<       movl    %eax, 60(%esp)
<       movl    (%esp), %eax
<       movl    %eax, 56(%esp)
---
>       pshufd  $1, %xmm0, %xmm1
>       movd    %xmm1, 4(%esp)
>       movd    %xmm0, (%esp)
>       movd    %xmm1, 12(%esp)
>       movd    %xmm0, 8(%esp)

<       subl    $92, %esp
<       movaps  %xmm0, 64(%esp)
---
>       subl    $44, %esp

<       movl    24(%esp), %eax
<       movl    %eax, 48(%esp)
<       movl    28(%esp), %eax
<       movl    %eax, 52(%esp)
<       movaps  %xmm0, (%esp)
<       movl    12(%esp), %eax
<       movl    %eax, 60(%esp)
<       movl    8(%esp), %eax
<       movl    %eax, 56(%esp)
---
>       pshufd  $3, %xmm0, %xmm1
>       movd    %xmm1, 4(%esp)
>       movhlps %xmm0, %xmm0
>       movd    %xmm0, (%esp)
>       movd    %xmm1, 12(%esp)
>       movd    %xmm0, 8(%esp)

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

16 years agoRemove inappropriate whitespace, change CVS to SVN where it makes sense.
Gabor Greif [Wed, 27 Feb 2008 13:34:15 +0000 (13:34 +0000)]
Remove inappropriate whitespace, change CVS to SVN where it makes sense.

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

16 years agoLegalizeTypes support for legalizing the mask
Duncan Sands [Wed, 27 Feb 2008 13:03:44 +0000 (13:03 +0000)]
LegalizeTypes support for legalizing the mask
operand of a VECTOR_SHUFFLE.  The mask is a
vector of constant integers.  The code in
LegalizeDAG doesn't bother to legalize the
mask, since it's basically just storage for
a bunch of constants, however LegalizeTypes
is more picky.  The problem is that there may
not exist any legal vector-of-integers type
with a legal element type, so it is impossible
to create a legal mask!  Unless of course you
cheat by creating a BUILD_VECTOR where the
operands have a different type to the element
type of the vector being built...  This is
pretty ugly but works - all relevant tests in
the testsuite pass, and produce the same
assembler with and without LegalizeTypes.

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

16 years agoLegalizeTypes support for INSERT_VECTOR_ELT.
Duncan Sands [Wed, 27 Feb 2008 10:18:23 +0000 (10:18 +0000)]
LegalizeTypes support for INSERT_VECTOR_ELT.

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

16 years agoDon't track max alignment during stack object allocations since they can be deleted...
Evan Cheng [Wed, 27 Feb 2008 10:04:56 +0000 (10:04 +0000)]
Don't track max alignment during stack object allocations since they can be deleted later. Let PEI compute it.

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

16 years agoSupport for legalizing MEMBARRIER.
Duncan Sands [Wed, 27 Feb 2008 08:53:44 +0000 (08:53 +0000)]
Support for legalizing MEMBARRIER.

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

16 years agoFinal de-tabification.
Bill Wendling [Wed, 27 Feb 2008 06:33:05 +0000 (06:33 +0000)]
Final de-tabification.

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

16 years agoAdd path separator support, patch by Sam Bishop.
Chris Lattner [Wed, 27 Feb 2008 06:17:10 +0000 (06:17 +0000)]
Add path separator support, patch by Sam Bishop.

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

16 years agoMake X86TargetLowering::LowerSINT_TO_FP return without creating a dead
Chris Lattner [Wed, 27 Feb 2008 05:57:41 +0000 (05:57 +0000)]
Make X86TargetLowering::LowerSINT_TO_FP return without creating a dead
stack slot and store if the  SINT_TO_FP is actually legal.  This allows
us to compile:

double a(double b) {return (unsigned)b;}

to:

_a:
cvttsd2siq %xmm0, %rax
movl %eax, %eax
cvtsi2sdq %rax, %xmm0
ret

instead of:

_a:
subq $8, %rsp
cvttsd2siq %xmm0, %rax
movl %eax, %eax
cvtsi2sdq %rax, %xmm0
addq $8, %rsp
ret

crazy.

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

16 years agothis code is correct but strange looking ;-)
Chris Lattner [Wed, 27 Feb 2008 05:48:44 +0000 (05:48 +0000)]
this code is correct but strange looking ;-)

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

16 years agoCompile x86-64-and-mask.ll into:
Chris Lattner [Wed, 27 Feb 2008 05:47:54 +0000 (05:47 +0000)]
Compile x86-64-and-mask.ll into:

_test:
movl %edi, %eax
ret

instead of:

_test:
        movl    $4294967295, %ecx
        movq    %rdi, %rax
        andq    %rcx, %rax
        ret

It would be great to write this as a Pat pattern that used subregs
instead of a 'pseudo' instruction, but I don't know how to do that
in td files.

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

16 years agoSpiller now remove unused spill slots.
Evan Cheng [Wed, 27 Feb 2008 03:04:06 +0000 (03:04 +0000)]
Spiller now remove unused spill slots.

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

16 years agoTeach Legalize how to expand an EXTRACT_ELEMENT.
Dan Gohman [Wed, 27 Feb 2008 01:52:30 +0000 (01:52 +0000)]
Teach Legalize how to expand an EXTRACT_ELEMENT.

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

16 years agoConvert the last remaining users of the non-APInt form of
Dan Gohman [Wed, 27 Feb 2008 01:23:58 +0000 (01:23 +0000)]
Convert the last remaining users of the non-APInt form of
ComputeMaskedBits to use the APInt form, and remove the
non-APInt form.

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

16 years agoAdd comment.
Devang Patel [Wed, 27 Feb 2008 01:20:54 +0000 (01:20 +0000)]
Add comment.

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

16 years agoadd a note
Chris Lattner [Wed, 27 Feb 2008 01:17:20 +0000 (01:17 +0000)]
add a note

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

16 years agoConvert SimplifyDemandedMask and ShrinkDemandedConstant to use APInt.
Dan Gohman [Wed, 27 Feb 2008 00:25:32 +0000 (00:25 +0000)]
Convert SimplifyDemandedMask and ShrinkDemandedConstant to use APInt.
Change several cases in SimplifyDemandedMask that don't ever do any
simplifying to reuse the logic in ComputeMaskedBits instead of
duplicating it.

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

16 years agoUpgrade testcase.
Bill Wendling [Tue, 26 Feb 2008 23:22:40 +0000 (23:22 +0000)]
Upgrade testcase.

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

16 years agoregenerate.
Devang Patel [Tue, 26 Feb 2008 23:19:08 +0000 (23:19 +0000)]
regenerate.

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

16 years agoAdd assert.
Devang Patel [Tue, 26 Feb 2008 23:17:50 +0000 (23:17 +0000)]
Add assert.

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

16 years agoAdd PR number to testcase.
Owen Anderson [Tue, 26 Feb 2008 23:16:11 +0000 (23:16 +0000)]
Add PR number to testcase.

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

16 years agoFix an issue where GVN had the sizes of the two memcpy's reverse, resulting
Owen Anderson [Tue, 26 Feb 2008 23:06:17 +0000 (23:06 +0000)]
Fix an issue where GVN had the sizes of the two memcpy's reverse, resulting
in an invalid transformation.

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

16 years agoAdd assert to check return type.
Devang Patel [Tue, 26 Feb 2008 22:55:21 +0000 (22:55 +0000)]
Add assert to check return type.

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

16 years agoRefactor according to Evan's and Anton's suggestions.
Arnold Schwaighofer [Tue, 26 Feb 2008 22:21:54 +0000 (22:21 +0000)]
Refactor according to Evan's and Anton's suggestions.

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

16 years agoregenerate
Devang Patel [Tue, 26 Feb 2008 22:17:48 +0000 (22:17 +0000)]
regenerate

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

16 years agoRemove unncessary ReturnInst constructors.
Devang Patel [Tue, 26 Feb 2008 22:12:58 +0000 (22:12 +0000)]
Remove unncessary ReturnInst constructors.

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

16 years agoUse a smallvector for inactiveCounts and initialize it lazily
Chris Lattner [Tue, 26 Feb 2008 22:08:41 +0000 (22:08 +0000)]
Use a smallvector for inactiveCounts and initialize it lazily
instead of init'ing it maximally to zeros on entry.  getFreePhysReg
is pretty hot and only a few elements are typically used.  This speeds
up linscan by 5% on 176.gcc.

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

16 years agoRename PrintableName to Name.
Bill Wendling [Tue, 26 Feb 2008 21:47:57 +0000 (21:47 +0000)]
Rename PrintableName to Name.

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

16 years agoUpdate per review. Patch by Mikhail Glushenkov!
Anton Korobeynikov [Tue, 26 Feb 2008 21:44:24 +0000 (21:44 +0000)]
Update per review. Patch by Mikhail Glushenkov!

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

16 years agoChange "Name" to "AsmName" in the target register info. Gee, a refactoring tool
Bill Wendling [Tue, 26 Feb 2008 21:11:01 +0000 (21:11 +0000)]
Change "Name" to "AsmName" in the target register info. Gee, a refactoring tool
would have been a Godsend here!

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

16 years agoEnable -coalescer-commute-instrs by default.
Evan Cheng [Tue, 26 Feb 2008 20:40:22 +0000 (20:40 +0000)]
Enable -coalescer-commute-instrs by default.

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

16 years agoDo not treat Lexer.cpp as a generated file any more, let svn show it with a question...
Gabor Greif [Tue, 26 Feb 2008 20:36:35 +0000 (20:36 +0000)]
Do not treat Lexer.cpp as a generated file any more, let svn show it with a question mark if it is around.

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

16 years agofirst commit of new LTO system. It is not hooked up in the llvm/tools/Makefile,...
Nick Kledzik [Tue, 26 Feb 2008 20:26:43 +0000 (20:26 +0000)]
first commit of new LTO system.  It is not hooked up in the llvm/tools/Makefile, so no one will build it be default yet

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

16 years agoUse SmallVector while constructing ReturnInst.
Devang Patel [Tue, 26 Feb 2008 19:38:17 +0000 (19:38 +0000)]
Use SmallVector while constructing ReturnInst.

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

16 years agoAvoid const_casts
Devang Patel [Tue, 26 Feb 2008 19:15:26 +0000 (19:15 +0000)]
Avoid const_casts

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

16 years agofix http://llvm.org/bugs/show_bug.cgi?id=2097
Gabor Greif [Tue, 26 Feb 2008 19:13:21 +0000 (19:13 +0000)]
fix http://llvm.org/bugs/show_bug.cgi?id=2097

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

16 years agoRemove unnecessary getOperand/setOperand overriders.
Devang Patel [Tue, 26 Feb 2008 19:08:13 +0000 (19:08 +0000)]
Remove unnecessary getOperand/setOperand overriders.
Simplify getReturnValue()

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

16 years agoAvoid aborting on invalid shift counts.
Dan Gohman [Tue, 26 Feb 2008 18:50:50 +0000 (18:50 +0000)]
Avoid aborting on invalid shift counts.

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

16 years agoUnify to ReturnInst::init() member functions.
Devang Patel [Tue, 26 Feb 2008 18:49:29 +0000 (18:49 +0000)]
Unify to ReturnInst::init() member functions.

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

16 years agoFix for pr2093: direct operands aren't necessarily addresses, so don't
Eli Friedman [Tue, 26 Feb 2008 18:37:49 +0000 (18:37 +0000)]
Fix for pr2093: direct operands aren't necessarily addresses, so don't
try to simplify them.

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

16 years agofix this test so that the fn name doesn't match the regex
Chris Lattner [Tue, 26 Feb 2008 18:13:51 +0000 (18:13 +0000)]
fix this test so that the fn name doesn't match the regex

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

16 years agoOptimize most common case by using single RetVal in ReturnInst.
Devang Patel [Tue, 26 Feb 2008 17:56:20 +0000 (17:56 +0000)]
Optimize most common case by using single RetVal in ReturnInst.

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

16 years agoCorrect function comments.
Arnold Schwaighofer [Tue, 26 Feb 2008 17:50:59 +0000 (17:50 +0000)]
Correct function comments.

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

16 years agoFix PR2096, a regression introduced with my patch last night. This
Chris Lattner [Tue, 26 Feb 2008 17:09:59 +0000 (17:09 +0000)]
Fix PR2096, a regression introduced with my patch last night.  This
also fixes cfrac, flops, and 175.vpr

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

16 years agoReally feed llvm-as with the testcase, do not let it read from stdin. This fixes...
Gabor Greif [Tue, 26 Feb 2008 13:37:13 +0000 (13:37 +0000)]
Really feed llvm-as with the testcase, do not let it read from stdin. This fixes the hangs seen on solaris10.

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

16 years agounbreak check-one
Gabor Greif [Tue, 26 Feb 2008 13:27:49 +0000 (13:27 +0000)]
unbreak check-one
by supplying a dummy
"verbose" procedure

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

16 years agoWhile hunting for two hanging tests,
Gabor Greif [Tue, 26 Feb 2008 12:08:55 +0000 (12:08 +0000)]
While hunting for two hanging tests,

(on solaris10, which are:
  CodeGen/PowerPC/frounds.ll
  Transforms/InstCombine/2008-02-23-MulSub.ll)

I needed a tool to figure out which one is the guilty.

To this end I have added a verbosity
option to the test/Makefile.

It can be invoked thus:

gmake check TESTSUITE=CodeGen/PowerPC VERBOSE="-v -v"

(The number of "-v"s specifies the verbosity level.
 Instead of "-v" other aliases can be specified,
 please consult the dejagnu docs for info.)

At level >= 2 following line is logged for each
test, before running it:

ABOUT TO RUN: <test>.ll

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

16 years agoFix a nasty bug in LegalizeTypes (spotted in
Duncan Sands [Tue, 26 Feb 2008 11:21:42 +0000 (11:21 +0000)]
Fix a nasty bug in LegalizeTypes (spotted in
CodeGen/PowerPC/illegal-element-type.ll): suppose
a node X is processed, and processing maps it to
a node Y.  Then X continues to exist in the DAG,
but with no users.  While processing some other
node, a new node may be created that happens to
be equal to X, and thus X will be reused rather
than a truly new node.  This can cause X to
"magically reappear", and since it is in the
Processed state in will not be reprocessed, so
at the end of type legalization the illegal node
X can still be present.  The solution is to replace
X with Y whenever X gets resurrected like this.

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

16 years agoDe-tabify
Bill Wendling [Tue, 26 Feb 2008 10:57:23 +0000 (10:57 +0000)]
De-tabify

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

16 years agoDe-tabify.
Bill Wendling [Tue, 26 Feb 2008 10:53:30 +0000 (10:53 +0000)]
De-tabify.

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

16 years agoDe-tabify.
Bill Wendling [Tue, 26 Feb 2008 10:51:52 +0000 (10:51 +0000)]
De-tabify.

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

16 years agoDetabify
Bill Wendling [Tue, 26 Feb 2008 10:49:39 +0000 (10:49 +0000)]
Detabify

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

16 years agoDetabify.
Bill Wendling [Tue, 26 Feb 2008 10:46:10 +0000 (10:46 +0000)]
Detabify.

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

16 years agoDe-tabify.
Bill Wendling [Tue, 26 Feb 2008 10:45:29 +0000 (10:45 +0000)]
De-tabify.

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

16 years agoAdd support for intermodule tail calls on x86/32bit with
Arnold Schwaighofer [Tue, 26 Feb 2008 10:21:54 +0000 (10:21 +0000)]
Add support for intermodule tail calls on x86/32bit with
GOT-style position independent code. Before only tail calls to
protected/hidden functions within the same module were optimized.
Now all function calls are tail call optimized.

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

16 years agoChange the lowering of arguments for tail call optimized
Arnold Schwaighofer [Tue, 26 Feb 2008 09:19:59 +0000 (09:19 +0000)]
Change the lowering of arguments for tail call optimized
calls. Before arguments that could overwrite each other were
explicitly lowered to a stack slot, not giving the register allocator
a chance to optimize. Now a sequence of copyto/copyfrom virtual
registers ensures that arguments are loaded in (virtual) registers
before they are lowered to the stack slot (and might overwrite each
other). Also parameter stack slots are marked mutable for
(potentially) tail calling functions.

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

16 years agoThis is possible:
Evan Cheng [Tue, 26 Feb 2008 08:03:41 +0000 (08:03 +0000)]
This is possible:
vr1 = extract_subreg vr2, 3
...
vr3 = extract_subreg vr1, 2
The end result is vr3 is equal to vr2 with subidx 2.

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

16 years agoFix isNegatibleForFree to not return true for ConstantFP nodes
Chris Lattner [Tue, 26 Feb 2008 07:04:54 +0000 (07:04 +0000)]
Fix isNegatibleForFree to not return true for ConstantFP nodes
after legalize.  Just because a constant is legal (e.g. 0.0 in SSE)
doesn't mean that its negated value is legal (-0.0).  We could make
this stronger by checking to see if the negated constant is actually
legal post negation, but it doesn't seem like a big deal.

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

16 years agoFix PR2076. CodeGenPrepare now sinks address computation for inline asm memory
Evan Cheng [Tue, 26 Feb 2008 02:42:37 +0000 (02:42 +0000)]
Fix PR2076. CodeGenPrepare now sinks address computation for inline asm memory
operands into inline asm block.

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

16 years agoRefactor inline asm constraint matching code out of SDIsel into TargetLowering.
Evan Cheng [Tue, 26 Feb 2008 02:33:44 +0000 (02:33 +0000)]
Refactor inline asm constraint matching code out of SDIsel into TargetLowering.

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

16 years agoRemove debugging help.
Devang Patel [Tue, 26 Feb 2008 01:42:38 +0000 (01:42 +0000)]
Remove debugging help.

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

16 years agotest svn commit capability
Nick Kledzik [Tue, 26 Feb 2008 01:36:52 +0000 (01:36 +0000)]
test svn commit capability

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

16 years agoUpdate bitcode reader and writer to handle multiple return values.
Devang Patel [Tue, 26 Feb 2008 01:29:32 +0000 (01:29 +0000)]
Update bitcode reader and writer to handle multiple return values.
Take 2.

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

16 years agoPass const vectors by reference.
Devang Patel [Tue, 26 Feb 2008 00:12:13 +0000 (00:12 +0000)]
Pass const vectors by reference.

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

16 years agoAdd missing include (for ptrdiff_t).
Eli Friedman [Mon, 25 Feb 2008 23:35:32 +0000 (23:35 +0000)]
Add missing include (for ptrdiff_t).

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

16 years agoRevert the assert for MUL_LOHI with an unused high result; Chris
Dan Gohman [Mon, 25 Feb 2008 22:43:48 +0000 (22:43 +0000)]
Revert the assert for MUL_LOHI with an unused high result; Chris
pointed out that this isn't correct at -O0.

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

16 years agowhen making bytecode modules, link as library
Andrew Lenharth [Mon, 25 Feb 2008 22:41:55 +0000 (22:41 +0000)]
when making bytecode modules, link as library

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

16 years agoRevise previous patch per review.
Dale Johannesen [Mon, 25 Feb 2008 22:29:22 +0000 (22:29 +0000)]
Revise previous patch per review.

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

16 years agoFactor the assert for indexed loads/stores out of LoadSDNode
Dan Gohman [Mon, 25 Feb 2008 22:16:29 +0000 (22:16 +0000)]
Factor the assert for indexed loads/stores out of LoadSDNode
and StoreSDNode into LSBaseSDNode.

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

16 years agoAdd an assert to verify that we don't see an
Dan Gohman [Mon, 25 Feb 2008 22:15:55 +0000 (22:15 +0000)]
Add an assert to verify that we don't see an
{S,U}MUL_LOHI with an unused high value.

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

16 years agoRemove the hack that turned an {S,U}MUL_LOHI with an unused high
Dan Gohman [Mon, 25 Feb 2008 21:57:04 +0000 (21:57 +0000)]
Remove the hack that turned an {S,U}MUL_LOHI with an unused high
result into a MUL late in the X86 codegen process. ISD::MUL is
once again Legal on X86, so this is no longer needed. And, the
hack was suboptimal; see PR1874 for details.

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

16 years agoMake some static variables const.
Dan Gohman [Mon, 25 Feb 2008 21:39:34 +0000 (21:39 +0000)]
Make some static variables const.

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

16 years agoadd an assertion to catch a null PATypeHolder, patch by Erick Tryzelaar
Chris Lattner [Mon, 25 Feb 2008 21:28:46 +0000 (21:28 +0000)]
add an assertion to catch a null PATypeHolder, patch by Erick Tryzelaar

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

16 years agoConvert MaskedValueIsZero and all its users to use APInt. Also add
Dan Gohman [Mon, 25 Feb 2008 21:11:39 +0000 (21:11 +0000)]
Convert MaskedValueIsZero and all its users to use APInt. Also add
a SignBitIsZero function to simplify a common use case.

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

16 years agoadd LSBaseSDNode::getOffset at Dan's request.
Chris Lattner [Mon, 25 Feb 2008 19:31:21 +0000 (19:31 +0000)]
add LSBaseSDNode::getOffset at Dan's request.

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

16 years agoAll remat'ed loads cannot be folded into two-address code. Not just argument loads...
Evan Cheng [Mon, 25 Feb 2008 19:24:01 +0000 (19:24 +0000)]
All remat'ed loads cannot be folded into two-address code. Not just argument loads. This change doesn't really have any impact on codegen.

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

16 years agoprune #includes, fit in 80 cols.
Chris Lattner [Mon, 25 Feb 2008 19:21:38 +0000 (19:21 +0000)]
prune #includes, fit in 80 cols.

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

16 years agomake this self contained.
Chris Lattner [Mon, 25 Feb 2008 19:20:57 +0000 (19:20 +0000)]
make this self contained.

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

16 years agoExpand removal of MMX memory copies to allow 1 level
Dale Johannesen [Mon, 25 Feb 2008 19:20:14 +0000 (19:20 +0000)]
Expand removal of MMX memory copies to allow 1 level
of TokenFactor underneath chain (seems to be enough)

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

16 years agoAdd a new method to SDNode/SDOperand named getValueSizeInBits
Dan Gohman [Mon, 25 Feb 2008 19:08:02 +0000 (19:08 +0000)]
Add a new method to SDNode/SDOperand named getValueSizeInBits
that combines getValueType and MVT::getSizeInBits, since this
occurrs frequently.

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

16 years agoIn debug builds check that the key property holds: all
Duncan Sands [Mon, 25 Feb 2008 16:21:21 +0000 (16:21 +0000)]
In debug builds check that the key property holds: all
result and operand types are legal.

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

16 years agoCorrectly determine whether a argument load can be folded into its uses.
Evan Cheng [Mon, 25 Feb 2008 08:50:41 +0000 (08:50 +0000)]
Correctly determine whether a argument load can be folded into its uses.

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

16 years agoFix an issue where GVN was performing the return slot optimization when it was
Owen Anderson [Mon, 25 Feb 2008 04:08:09 +0000 (04:08 +0000)]
Fix an issue where GVN was performing the return slot optimization when it was
not safe.  This is fixed by more aggressively checking that the return slot is
not used elsewhere in the function.

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

16 years agoTemporarily reverting 46959.
Evan Cheng [Mon, 25 Feb 2008 03:57:32 +0000 (03:57 +0000)]
Temporarily reverting 46959.

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

16 years agoFix an issue where GVN would try to use an instruction before its definition when...
Owen Anderson [Mon, 25 Feb 2008 00:40:41 +0000 (00:40 +0000)]
Fix an issue where GVN would try to use an instruction before its definition when performing return slot optimization.

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

16 years agoAdd support to LegalizeTypes for building legal vectors
Duncan Sands [Sun, 24 Feb 2008 07:36:03 +0000 (07:36 +0000)]
Add support to LegalizeTypes for building legal vectors
out of illegal elements (BUILD_VECTOR).  Uses and beefs
up BUILD_PAIR, though it didn't really have to.  Like
most of LegalizeTypes, does not support soft-float.
This cures all "make check" vector building failures.

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

16 years agoSome platforms use the same name for 32-bit and 64-bit registers (like
Bill Wendling [Sun, 24 Feb 2008 00:56:13 +0000 (00:56 +0000)]
Some platforms use the same name for 32-bit and 64-bit registers (like
%r3 on PPC) in their ASM files. However, it's hard for humans to read
during debugging. Adding a new field to the register data that lets you
specify a different name to be printed than the one that goes into the
ASM file -- %x3 instead of %r3, for instance.

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