oota-llvm.git
16 years agoA problem that's exposed when machine LICM is enabled. Consider this code:
Bill Wendling [Mon, 26 May 2008 05:18:34 +0000 (05:18 +0000)]
A problem that's exposed when machine LICM is enabled. Consider this code:

LBB1_3:   # bb
...
        xorl    %ebp, %ebp
        subl    (%ebx), %ebp
...
        incl    %ecx
        cmpl    %edi, %ecx
        jl      LBB1_3  # bb

Whe using machine LICM, LLVM converts it into:

        xorl %esi, %esi
LBB1_3: # bb
...
        movl    %esi, %ebp
        subl    (%ebx), %ebp
...
        incl    %ecx
        cmpl    %edi, %ecx
        jl      LBB1_3  # bb

Two address conversion inserts the copy instruction. However, it's cheaper to
rematerialize it, and remat helps reduce register pressure.

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

16 years agoUse {} instead of "" in RUN lines.
Nick Lewycky [Mon, 26 May 2008 01:27:08 +0000 (01:27 +0000)]
Use {} instead of "" in RUN lines.

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

16 years agoDon't treat values as signed when looking at loop steppings in HowForToNonZero.
Nick Lewycky [Sun, 25 May 2008 23:43:32 +0000 (23:43 +0000)]
Don't treat values as signed when looking at loop steppings in HowForToNonZero.

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

16 years ago"ret (constexpr)" can't be folded into a Constant. Add a method to
Nick Lewycky [Sun, 25 May 2008 20:56:15 +0000 (20:56 +0000)]
"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

16 years agoCreate archives with the same permissions are ar.
Owen Anderson [Sat, 24 May 2008 05:42:29 +0000 (05:42 +0000)]
Create archives with the same permissions are ar.

Patch by Mikael Lepistö.

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

16 years agoFix win32 when no bison is around, PR2331, patch by 'hume'.
Chris Lattner [Sat, 24 May 2008 05:11:48 +0000 (05:11 +0000)]
Fix win32 when no bison is around, PR2331, patch by 'hume'.

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

16 years agoAdd FreeBSD/PPC support, patch by Marcel Moolenaar!
Chris Lattner [Sat, 24 May 2008 04:58:48 +0000 (04:58 +0000)]
Add FreeBSD/PPC support, patch by Marcel Moolenaar!

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

16 years agoFix a serious brain-o. Obviously no-one reviewed my patch :(
Chris Lattner [Sat, 24 May 2008 04:06:28 +0000 (04:06 +0000)]
Fix a serious brain-o.  Obviously no-one reviewed my patch :(

This fixes PR2359

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

16 years agoFix PR2358 by resolving calls with undef arguments to overdefined.
Chris Lattner [Sat, 24 May 2008 03:59:33 +0000 (03:59 +0000)]
Fix PR2358 by resolving calls with undef arguments to overdefined.

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

16 years agoEliminate x86.sse2.punpckh.qdq and x86.sse2.punpckl.qdq.
Evan Cheng [Sat, 24 May 2008 02:56:30 +0000 (02:56 +0000)]
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

16 years agoEliminate x86.sse2.movs.d, x86.sse2.shuf.pd, x86.sse2.unpckh.pd, and x86.sse2.unpckl...
Evan Cheng [Sat, 24 May 2008 02:14:05 +0000 (02:14 +0000)]
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

16 years agoTweak how ConstantFP80Ty constants are output
Duncan Sands [Sat, 24 May 2008 01:00:52 +0000 (01:00 +0000)]
Tweak how ConstantFP80Ty constants are output
so that gcc doesn't warn about them.

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

16 years agoPut initialized const weak objects into correct
Dale Johannesen [Sat, 24 May 2008 00:10:20 +0000 (00:10 +0000)]
Put initialized const weak objects into correct
sections on ppc32 darwin.  g++.dg/abi/key2.C

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

16 years agoThis is done.
Evan Cheng [Sat, 24 May 2008 00:10:13 +0000 (00:10 +0000)]
This is done.

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

16 years agoNew loadl_pd and loadh_pd tests.
Evan Cheng [Sat, 24 May 2008 00:10:02 +0000 (00:10 +0000)]
New loadl_pd and loadh_pd tests.

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

16 years agoAutoupgrade x86.sse2.loadh.pd and x86.sse2.loadl.pd.
Evan Cheng [Sat, 24 May 2008 00:08:39 +0000 (00:08 +0000)]
Autoupgrade x86.sse2.loadh.pd and x86.sse2.loadl.pd.

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

16 years agoRemove x86.sse2.loadh.pd and x86.sse2.loadl.pd. These will be lowered into load and...
Evan Cheng [Sat, 24 May 2008 00:07:29 +0000 (00:07 +0000)]
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@51522 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove x86.sse2.loadh.pd and x86.sse2.loadl.pd. These will be lowered into load and...
Evan Cheng [Sat, 24 May 2008 00:07:06 +0000 (00:07 +0000)]
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

16 years agoDocument common linkage.
Dale Johannesen [Fri, 23 May 2008 23:13:41 +0000 (23:13 +0000)]
Document common linkage.

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

16 years agoRevert 51440 as it breaks a bunch of PIC tests.
Evan Cheng [Fri, 23 May 2008 23:00:04 +0000 (23:00 +0000)]
Revert 51440 as it breaks a bunch of PIC tests.

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

16 years agolabel is a first-class type.
Dan Gohman [Fri, 23 May 2008 22:50:26 +0000 (22:50 +0000)]
label is a first-class type.

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

16 years agoIt turns out there are only 3 non-first-class type kinds left now, so
Dan Gohman [Fri, 23 May 2008 22:47:52 +0000 (22:47 +0000)]
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

16 years agoRemove a bogus svn:mime-type property.
Dan Gohman [Fri, 23 May 2008 22:27:01 +0000 (22:27 +0000)]
Remove a bogus svn:mime-type property.

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

16 years agoUpdate the description of first-class types to reflect that
Dan Gohman [Fri, 23 May 2008 21:53:15 +0000 (21:53 +0000)]
Update the description of first-class types to reflect that
structs and arrays are now first-class. And fix a sentance
fragment in the insertvalue description. Thanks to Chris
for pointing these out!

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

16 years agoDon't silently truncate array extents to 32 bits.
Dan Gohman [Fri, 23 May 2008 21:40:55 +0000 (21:40 +0000)]
Don't silently truncate array extents to 32 bits.

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

16 years agoAdd a missed CommonLinkage check.
Dale Johannesen [Fri, 23 May 2008 21:33:27 +0000 (21:33 +0000)]
Add a missed CommonLinkage check.

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

16 years agoUse movlps / movhps to modify low / high half of 16-byet memory location.
Evan Cheng [Fri, 23 May 2008 21:23:16 +0000 (21:23 +0000)]
Use movlps / movhps to modify low / high half of 16-byet memory location.

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

16 years agoRemove lingering references to .llx and .tr in the tests.
Dan Gohman [Fri, 23 May 2008 21:15:35 +0000 (21:15 +0000)]
Remove lingering references to .llx and .tr in the tests.

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

16 years agoTidy up BasicBlock::getFirstNonPHI, and change a bunch of places to
Dan Gohman [Fri, 23 May 2008 21:05:58 +0000 (21:05 +0000)]
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

16 years agoAdd #includes to make some dependencies explicit.
Dan Gohman [Fri, 23 May 2008 20:40:06 +0000 (20:40 +0000)]
Add #includes to make some dependencies explicit.

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

16 years agoIssue errors in several situations instead of aborting.
Dan Gohman [Fri, 23 May 2008 18:23:11 +0000 (18:23 +0000)]
Issue errors in several situations instead of aborting.

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

16 years agoElaborate on the entry on integer vector multiplication by constants.
Dan Gohman [Fri, 23 May 2008 18:05:39 +0000 (18:05 +0000)]
Elaborate on the entry on integer vector multiplication by constants.

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

16 years agoFix a duplicated pattern.
Evan Cheng [Fri, 23 May 2008 18:00:18 +0000 (18:00 +0000)]
Fix a duplicated pattern.

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

16 years agoUse PMULDQ for v2i64 multiplies when SSE4.1 is available. And add
Dan Gohman [Fri, 23 May 2008 17:49:40 +0000 (17:49 +0000)]
Use PMULDQ for v2i64 multiplies when SSE4.1 is available. And add
load-folding table entries for PMULDQ and PMULLD.

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

16 years agoNew entry.
Evan Cheng [Fri, 23 May 2008 17:28:11 +0000 (17:28 +0000)]
New entry.

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

16 years agoRewrite a loop to avoid using iterators pointing to
Dale Johannesen [Fri, 23 May 2008 17:19:02 +0000 (17:19 +0000)]
Rewrite a loop to avoid using iterators pointing to
elements that have been erased.  Based on a patch
by Nicolas Capens.

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

16 years agoFix the spelling of the va_arg keyword.
Dan Gohman [Fri, 23 May 2008 17:11:55 +0000 (17:11 +0000)]
Fix the spelling of the va_arg keyword.

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

16 years agoFix another isFirstClassType that now needs to be isSingleValueType.
Dan Gohman [Fri, 23 May 2008 16:57:00 +0000 (16:57 +0000)]
Fix another isFirstClassType that now needs to be isSingleValueType.
This fixes recent CBE regressions.

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

16 years agoReplace some weird usage of UserOp1 introduced in r49492 by a plain if.
Matthijs Kooijman [Fri, 23 May 2008 16:17:48 +0000 (16:17 +0000)]
Replace some weird usage of UserOp1 introduced in r49492 by a plain if.

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

16 years agoRestructure the testing documentation.
Matthijs Kooijman [Fri, 23 May 2008 11:45:18 +0000 (11:45 +0000)]
Restructure the testing documentation.

I've tried to make the distinction between the DejaGNU tests and the test-suite
more clear, added a small section about generating output from the test-suite,
removed some duplication and fixed some wordings. Most of the changes are text
movements, however.

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

16 years agoRestucture a part of the SimplifyCFG pass and include a testcase.
Matthijs Kooijman [Fri, 23 May 2008 09:09:41 +0000 (09:09 +0000)]
Restucture a part of the SimplifyCFG pass and include a testcase.

The SimplifyCFG pass looks at basic blocks that contain only phi nodes,
followed by an unconditional branch. In a lot of cases, such a block (BB) can
be merged into their successor (Succ).

This merging is performed by TryToSimplifyUncondBranchFromEmptyBlock. It does
this by taking all phi nodes in the succesor block Succ and expanding them to
include the predecessors of BB. Furthermore, any phi nodes in BB are moved to
Succ and expanded to include the predecessors of Succ as well.

Before attempting this merge, CanPropagatePredecessorsForPHIs checks to see if
all phi nodes can be properly merged. All functional changes are made to
this function, only comments were updated in
TryToSimplifyUncondBranchFromEmptyBlock.

In the original code, CanPropagatePredecessorsForPHIs looks quite convoluted
and more like stack of checks added to handle different kinds of situations
than a comprehensive check. In particular the first check in the function did
some value checking for the case that BB and Succ have a common predecessor,
while the last check in the function simply rejected all cases where BB and
Succ have a common predecessor. The first check was still useful in the case
that BB did not contain any phi nodes at all, though, so it was not completely
useless.

Now, CanPropagatePredecessorsForPHIs is restructured to to look a lot more
similar to the code that actually performs the merge. Both functions now look
at the same phi nodes in about the same order.  Any conflicts (phi nodes with
different values for the same source) that could arise from merging or moving
phi nodes are detected. If no conflicts are found, the merge can happen.

Apart from only restructuring the checks, two main changes in functionality
happened.

Firstly, the old code rejected blocks with common predecessors in most cases.
The new code performs some extra checks so common predecessors can be handled
in a lot of cases. Wherever common predecessors still pose problems, the
blocks are left untouched.

Secondly, the old code rejected the merge when values (phi nodes) from BB were
used in any other place than Succ. However, it does not seem that there is any
situation that would require this check. Even more, this can be proven.

Consider that BB is a block containing of a single phi node "%a" and a branch
to Succ. Now, since the definition of %a will dominate all of its uses, BB
will dominate all blocks that use %a. Furthermore, since the branch from BB to
Succ is unconditional, Succ will also dominate all uses of %a.

Now, assume that one predecessor of Succ is not dominated by BB (and thus not
dominated by Succ). Since at least one use of %a (but in reality all of them)
is reachable from Succ, you could end up at a use of %a without passing
through it's definition in BB (by coming from X through Succ). This is a
contradiction, meaning that our original assumption is wrong. Thus, all
predecessors of Succ must also be dominated by BB (and thus also by Succ).

This means that moving the phi node %a from BB to Succ does not pose any
problems when the two blocks are merged, and any use checks are not needed.

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

16 years agoIndent fix.
Matthijs Kooijman [Fri, 23 May 2008 07:57:02 +0000 (07:57 +0000)]
Indent fix.

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

16 years agoConstant integer vectors may also be negated.
Nick Lewycky [Fri, 23 May 2008 04:54:45 +0000 (04:54 +0000)]
Constant integer vectors may also be negated.

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

16 years agoTypo.
Nick Lewycky [Fri, 23 May 2008 04:39:38 +0000 (04:39 +0000)]
Typo.

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

16 years agoRevert X + X --> X * 2 optz'n which pessimizes heavily on x86.
Nick Lewycky [Fri, 23 May 2008 04:34:58 +0000 (04:34 +0000)]
Revert X + X --> X * 2 optz'n which pessimizes heavily on x86.

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

16 years agowe compile multiply-by-constant into horrible code. Doesn't sse4 have some
Chris Lattner [Fri, 23 May 2008 04:29:53 +0000 (04:29 +0000)]
we compile multiply-by-constant into horrible code. Doesn't sse4 have some
instruction for doing this?

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

16 years agoImplement X + X for vectors.
Nick Lewycky [Fri, 23 May 2008 04:14:51 +0000 (04:14 +0000)]
Implement X + X for vectors.

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

16 years agoFix a recently added optimization to not crash on vectors.
Nick Lewycky [Fri, 23 May 2008 03:26:47 +0000 (03:26 +0000)]
Fix a recently added optimization to not crash on vectors.

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

16 years agoGeneralize the new code in instcombine's ComputeNumSignBits for handling
Dan Gohman [Fri, 23 May 2008 02:28:01 +0000 (02:28 +0000)]
Generalize the new code in instcombine's ComputeNumSignBits for handling
and/or to handle more cases (such as this add-sitofp.ll testcase), and
port it to selectiondag's ComputeNumSignBits.

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

16 years agoMake structs and arrays first-class types, and add assembly
Dan Gohman [Fri, 23 May 2008 01:55:30 +0000 (01:55 +0000)]
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

16 years agoUse isSingleValueType instead of isFirstClassType to
Dan Gohman [Fri, 23 May 2008 01:52:21 +0000 (01:52 +0000)]
Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.

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

16 years agoRemove warnings about comparison between signed and unsigned expressions.
Bill Wendling [Fri, 23 May 2008 01:29:08 +0000 (01:29 +0000)]
Remove warnings about comparison between signed and unsigned expressions.

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

16 years agoAllow for switch with no cases. Was causing fault
Dale Johannesen [Fri, 23 May 2008 01:01:31 +0000 (01:01 +0000)]
Allow for switch with no cases.  Was causing fault
in gcc.dg/pr27531-1.c.

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

16 years agoBug: rcpps can only folds a load if the address is 16-byte aligned. Fixed many 'ps...
Evan Cheng [Fri, 23 May 2008 00:37:07 +0000 (00:37 +0000)]
Bug: rcpps can only folds a load if the address is 16-byte aligned. Fixed many 'ps' load folding patterns in X86InstrSSE.td which are missing the proper alignment checks.
Also fixed some 80 col. violations.

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

16 years agoAdd more IR support for the new extractvalue and insertvalue
Dan Gohman [Fri, 23 May 2008 00:36:11 +0000 (00:36 +0000)]
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

16 years agoUse isSingleValueType instead of isFirstClassType to
Dan Gohman [Fri, 23 May 2008 00:34:04 +0000 (00:34 +0000)]
Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.

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

16 years agoUse isSingleValueType instead of isFirstClassType to
Dan Gohman [Fri, 23 May 2008 00:17:26 +0000 (00:17 +0000)]
Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.

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

16 years agoPut const weak stuff in appropriate section on Darwin.
Dale Johannesen [Fri, 23 May 2008 00:16:59 +0000 (00:16 +0000)]
Put const weak stuff in appropriate section on Darwin.
g++.dg/abi/key2.C

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

16 years agoMake LTO expect common and weak to be represented differently.
Dale Johannesen [Fri, 23 May 2008 00:15:10 +0000 (00:15 +0000)]
Make LTO expect common and weak to be represented differently.
Reading .bc files from before that change will no longer work.

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

16 years agoUse isSingleValueType instead of isFirstClassType to
Dan Gohman [Fri, 23 May 2008 00:12:03 +0000 (00:12 +0000)]
Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.

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

16 years agoX86CodeEmitter should not set PIC style to None at initialization time. This will...
Evan Cheng [Thu, 22 May 2008 23:55:24 +0000 (23:55 +0000)]
X86CodeEmitter should not set PIC style to None at initialization time. This will break codegen if relocation model is changed to PIC_ later.

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

16 years agoUse isSingleValueType instead of isFirstClassType to
Dan Gohman [Thu, 22 May 2008 23:43:22 +0000 (23:43 +0000)]
Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.

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

16 years agoAdd a polygen grammar definition for LLVM assembly language.
Dan Gohman [Thu, 22 May 2008 22:45:03 +0000 (22:45 +0000)]
Add a polygen grammar definition for LLVM assembly language.

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

16 years agoRecognize the "default" keyword, which is documented in LangRef.html
Dan Gohman [Thu, 22 May 2008 22:30:09 +0000 (22:30 +0000)]
Recognize the "default" keyword, which is documented in LangRef.html
and supported in the grammar, in the lexer.

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

16 years agoAdd a couple of test cases.
Evan Cheng [Thu, 22 May 2008 21:19:19 +0000 (21:19 +0000)]
Add a couple of test cases.

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

16 years agoWhen rewriting defs and uses after spilling, don't set the weight of a
David Greene [Thu, 22 May 2008 21:16:33 +0000 (21:16 +0000)]
When rewriting defs and uses after spilling, don't set the weight of a
live interval to infinity if the instruction being rewritten is an
original remat def instruction.  We were only checking against the clone
of the remat def which doesn't actually appear in the IR at all.

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

16 years agoDon't attempt to update SpillSlotToUsesMap for stack slots that aren't
David Greene [Thu, 22 May 2008 21:12:21 +0000 (21:12 +0000)]
Don't attempt to update SpillSlotToUsesMap for stack slots that aren't
generated by the spiller.

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

16 years agotransform more loops to iterator form, detabify
Gabor Greif [Thu, 22 May 2008 19:24:54 +0000 (19:24 +0000)]
transform more loops to iterator form, detabify

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

16 years agoAdd missing patterns.
Evan Cheng [Thu, 22 May 2008 18:56:56 +0000 (18:56 +0000)]
Add missing patterns.

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

16 years agoSuppress warnings about missing placement delete. This should now be std-conformant...
Gabor Greif [Thu, 22 May 2008 13:16:42 +0000 (13:16 +0000)]
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

16 years agoRewrite operand loops to use iterators. This shrinks .o file (at gcc4.0.1 -O3 x86...
Gabor Greif [Thu, 22 May 2008 06:43:33 +0000 (06:43 +0000)]
Rewrite operand loops to use iterators. This shrinks .o file (at gcc4.0.1 -O3 x86) substantially (>500 bytes). Reason still unknown.

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

16 years agofix an off-by-one error in my previous patch, don't treat the callee as a incoming...
Chris Lattner [Thu, 22 May 2008 06:29:38 +0000 (06:29 +0000)]
fix an off-by-one error in my previous patch, don't treat the callee as a incoming arg.

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

16 years agoAdd support for multiple-return values in inline asm. This should
Chris Lattner [Thu, 22 May 2008 06:19:37 +0000 (06:19 +0000)]
Add support for multiple-return values in inline asm.  This should
get inline asm working as well as it did previously with the CBE
with the new MRV support for inline asm.

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

16 years agoFix PR2267, by allowing indirect outputs to be intermixed
Chris Lattner [Thu, 22 May 2008 04:46:38 +0000 (04:46 +0000)]
Fix PR2267, by allowing indirect outputs to be intermixed
with normal outputs.  Testcase here:
test/CodeGen/X86/asm-indirect-mem.ll

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

16 years agotestcase for PR2267
Chris Lattner [Thu, 22 May 2008 04:45:22 +0000 (04:45 +0000)]
testcase for PR2267

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

16 years agoFree and vaarg are not really volatile.
Chris Lattner [Thu, 22 May 2008 03:23:06 +0000 (03:23 +0000)]
Free and vaarg are not really volatile.

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

16 years agorewrite the validity checking for memory promotion to be simpler,
Chris Lattner [Thu, 22 May 2008 03:22:42 +0000 (03:22 +0000)]
rewrite the validity checking for memory promotion to be simpler,
more aggressive, and more correct.  Verify that we only attempt to
promote loads and stores.

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

16 years agominor edits
Chris Lattner [Thu, 22 May 2008 03:06:14 +0000 (03:06 +0000)]
minor edits

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

16 years agoUse 'continue' to reduce nesting in this loop. No functionality change.
Chris Lattner [Thu, 22 May 2008 00:53:38 +0000 (00:53 +0000)]
Use 'continue' to reduce nesting in this loop.  No functionality change.

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

16 years agoAdd a Type::isSingleValueType method. This will be used by code
Dan Gohman [Wed, 21 May 2008 23:35:53 +0000 (23:35 +0000)]
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

16 years agoFix PR2343. An *interesting* coalescer bug.
Evan Cheng [Wed, 21 May 2008 22:34:12 +0000 (22:34 +0000)]
Fix PR2343. An *interesting* coalescer bug.

BB1:
  vr1025 = copy vr1024
  ..
BB2:
  vr1024 = op
         = op vr1025
  <loop eventually branch back to BB1>

Even though vr1025 is copied from vr1024, it's not safe to coalesced them since live range of vr1025 intersects the def of vr1024. This happens when vr1025 is assigned the value of the previous iteration of vr1024 in the loop.

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

16 years agoFollow-up to the reverting of r51218. This puts the checks out-of-line. Because
Bill Wendling [Wed, 21 May 2008 21:20:07 +0000 (21:20 +0000)]
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

16 years agoupdate a comment
Gabor Greif [Wed, 21 May 2008 18:57:33 +0000 (18:57 +0000)]
update a comment

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

16 years agoadapt to new API
Gabor Greif [Wed, 21 May 2008 18:30:15 +0000 (18:30 +0000)]
adapt to new API

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

16 years agoRename -no-lazy to -disable-lazy-compilation.
Evan Cheng [Wed, 21 May 2008 18:20:21 +0000 (18:20 +0000)]
Rename -no-lazy to -disable-lazy-compilation.

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

16 years agoFix a couple issues with the JIT and multiple modules:
Nate Begeman [Wed, 21 May 2008 16:34:48 +0000 (16:34 +0000)]
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

16 years agoresurrect lost tests by renaming them to not end with .tr
Gabor Greif [Wed, 21 May 2008 14:48:24 +0000 (14:48 +0000)]
resurrect lost tests by renaming them to not end with .tr

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

16 years agosuppress gcc3.4.6's <no value returned> warnings
Gabor Greif [Wed, 21 May 2008 14:07:30 +0000 (14:07 +0000)]
suppress gcc3.4.6's <no value returned> warnings

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

16 years agoWhen LSR is replacing an instruction, call
Dan Gohman [Wed, 21 May 2008 00:54:12 +0000 (00:54 +0000)]
When LSR is replacing an instruction, call
ScalarEvolution::deleteValueFromRecords on it before doing the
replaceAllUsesWith, because ScalarEvolution looks at the instruction's
users to find SCEV references to the instruction's SCEV object in its
internal maps.

Move all of LSR's loop-related state clearing after processing the loop
and before cleaning up dead PHI nodes. This eliminates all of LSR's SCEV
references just before the calls to ScalarEvolution::deleteValueFromRecords
so that when ScalarEvolution drops its own SCEV references, the reference
counts will reach zero and the SCEVs will be deleted immediately.

These changes fix some compiler aborts involving ScalarEvolution holding
onto and reusing SCEV objects for instructions that have been deleted.
No regression test unfortunately; because the symptoms were due to
dangling pointers, reduced testcases ended up being fairly arbitrary.

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

16 years agoReverting r51218 because of breakage on PPC32.
Bill Wendling [Tue, 20 May 2008 23:54:27 +0000 (23:54 +0000)]
Reverting r51218 because of breakage on PPC32.

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

16 years agoEliminate questionable syntax for stdin redirection. This probably also speeds things...
Gabor Greif [Tue, 20 May 2008 22:07:21 +0000 (22:07 +0000)]
Eliminate questionable syntax for stdin redirection. This probably also speeds things up a bit.

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

16 years agoFix PR2346 by marking vaarg as volatile so that licm doesn't try to
Chris Lattner [Tue, 20 May 2008 22:05:28 +0000 (22:05 +0000)]
Fix PR2346 by marking vaarg as volatile so that licm doesn't try to
hoist them.

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

16 years agoOops, commit the version of this test that actually works.
Dan Gohman [Tue, 20 May 2008 21:19:36 +0000 (21:19 +0000)]
Oops, commit the version of this test that actually works.

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

16 years agoPort SelectionDAG's ComputeNumSignBits-using code to instcombine,
Dan Gohman [Tue, 20 May 2008 21:01:12 +0000 (21:01 +0000)]
Port SelectionDAG's ComputeNumSignBits-using code to instcombine,
now that instcombine also has ComputeNumSignBits.

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

16 years agosabre brings to my attention that the 'tr' suffix is also obsolete
Gabor Greif [Tue, 20 May 2008 21:00:03 +0000 (21:00 +0000)]
sabre brings to my attention that the 'tr' suffix is also obsolete

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

16 years agoPort the fix for the select operator from instcombine's
Dan Gohman [Tue, 20 May 2008 20:59:51 +0000 (20:59 +0000)]
Port the fix for the select operator from instcombine's
ComputeNumSignBits to SelectionDAG's ComputeNumSignBits.

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

16 years agoCode simplification.
Dan Gohman [Tue, 20 May 2008 20:56:33 +0000 (20:56 +0000)]
Code simplification.

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

16 years agoClarify that and/or/xor/sdiv etc all allow vectors.
Chris Lattner [Tue, 20 May 2008 20:48:21 +0000 (20:48 +0000)]
Clarify that and/or/xor/sdiv etc all allow vectors.

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

16 years agoClarify copyright transfer when you don't own the copyright of
Chris Lattner [Tue, 20 May 2008 20:06:53 +0000 (20:06 +0000)]
Clarify copyright transfer when you don't own the copyright of
the contributed code.

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

16 years agoRename the last test with .llx extension to .ll, resolve duplicate test by renaming...
Gabor Greif [Tue, 20 May 2008 19:52:04 +0000 (19:52 +0000)]
Rename the last test with .llx extension to .ll, resolve duplicate test by renaming to isnan2. Now that no test has llx ending there is no need to search for them from dg.exp too.

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