Commit Graph

4784 Commits

Author SHA1 Message Date
Duncan Sands 573b3f89e4 Remove any 'nest' parameter attributes if the function
is not passed as an argument to a trampoline intrinsic.

llvm-svn: 47220
2008-02-16 20:56:04 +00:00
Andrew Lenharth 9b254eed32 llvm.memory.barrier, and impl for x86 and alpha
llvm-svn: 47204
2008-02-16 01:24:58 +00:00
Chris Lattner 8f51fa82c0 upgrade this test, which wasn't testing the right thing since llvm-upgrade came around.
llvm-svn: 47194
2008-02-15 23:58:25 +00:00
Chris Lattner e1f41fc68e rename llx -> ll
llvm-svn: 47192
2008-02-15 23:51:48 +00:00
Evan Cheng 6edbbe0c25 This test is not interesting.
llvm-svn: 47189
2008-02-15 23:06:21 +00:00
Dale Johannesen d2fd6b84c7 Modify test to expect improved code.
llvm-svn: 47182
2008-02-15 22:05:15 +00:00
Duncan Sands a69c2f86b4 Fix this test on linux, which returns S242
using sret.

llvm-svn: 47173
2008-02-15 19:42:13 +00:00
Devang Patel a42c3147cc Fix PR2028
llvm-svn: 47150
2008-02-15 01:24:49 +00:00
Devang Patel 2e622e4c2b If loop header is also loop exiting block then OrigPN is incoming value for B loop header.
Fixes PR 2030.

llvm-svn: 47141
2008-02-14 23:18:47 +00:00
Chris Lattner 70e294660a Fix PR2029
llvm-svn: 47129
2008-02-14 19:18:13 +00:00
Chris Lattner 558a3ba17f Fix a miscompilation from Dan's recent apintification.
llvm-svn: 47128
2008-02-14 18:48:56 +00:00
Tanya Lattner 5429dbf6c7 Remove llvm-upgrade
llvm-svn: 47119
2008-02-14 07:57:12 +00:00
Nick Lewycky 9592bb0390 Testcase for PR2032.
llvm-svn: 47113
2008-02-14 07:15:11 +00:00
Tanya Lattner f865dcd009 Remove llvm-upgrade.
llvm-svn: 47110
2008-02-14 06:56:27 +00:00
Chris Lattner 3bd37f549a This readme entry is done, testcase here: CodeGen/X86/zero-remat.ll
llvm-svn: 47106
2008-02-14 05:39:46 +00:00
Evan Cheng a4621f04bb Fix test.
llvm-svn: 47102
2008-02-14 01:32:53 +00:00
Devang Patel 0ecb76d820 A loop latch phi node may have uses inside loop, not just in loop header.
llvm-svn: 47093
2008-02-13 22:23:07 +00:00
Devang Patel 22c3caab6e While moving exit condition, do not drop loop latch on the floor.
llvm-svn: 47089
2008-02-13 22:06:36 +00:00
Devang Patel c281d8031b Keep track of exit value operand number when operands are swapped.
llvm-svn: 47082
2008-02-13 19:48:48 +00:00
Dale Johannesen 2aea794226 New test, see comments.
llvm-svn: 47078
2008-02-13 18:36:48 +00:00
Duncan Sands f8d29f228d Teach LegalizeTypes how to expand and promote CTLZ,
CTTZ and CTPOP.  The expansion code differs from
that in LegalizeDAG in that it chooses to take the
CTLZ/CTTZ count from the Hi/Lo part depending on
whether the Hi/Lo value is zero, not on whether
CTLZ/CTTZ of Hi/Lo returned 32 (or whatever the
width of the type is) for it.  I made this change
because the optimizers may well know that Hi/Lo
is zero and exploit it.  The promotion code for
CTTZ also differs from that in LegalizeDAG: it
uses an "or" to get the right result when the
original value is zero, rather than using a compare
and select.  This also means the value doesn't
need to be zero extended.

llvm-svn: 47075
2008-02-13 18:01:53 +00:00
Eli Friedman 460648abde Add a note pointing to PR1996.
llvm-svn: 47055
2008-02-13 07:56:04 +00:00
Chris Lattner a08af08a88 In SDISel, for targets that support FORMAL_ARGUMENTS nodes, lower this
node as soon as we create it in SDISel.  Previously we would lower it in
legalize.  The problem with this is that it only exposes the argument
loads implied by FORMAL_ARGUMENTs after legalize, so that only dag combine 2
can hack on them.  This causes us to miss some optimizations because 
datatype expansion also happens here.

Exposing the loads early allows us to do optimizations on them.  For example
we now compile arg-cast.ll to:

_foo:
	movl	$2147483647, %eax
	andl	8(%esp), %eax
	ret

where we previously produced:

_foo:
	subl	$12, %esp
	movsd	16(%esp), %xmm0
	movsd	%xmm0, (%esp)
	movl	$2147483647, %eax
	andl	4(%esp), %eax
	addl	$12, %esp
	ret

It might also make sense to do this for ISD::CALL nodes, which have implicit
stores on many targets.

llvm-svn: 47054
2008-02-13 07:39:09 +00:00
Eli Friedman 03ec63f29d Add test for PR1996. (This is my first time adding a test for a
transform, so please review.)

llvm-svn: 47050
2008-02-13 06:55:57 +00:00
Nate Begeman fe61967361 Add testcase for recent legalizer change
llvm-svn: 47049
2008-02-13 06:48:40 +00:00
Evan Cheng ea8530d82c New tests.
llvm-svn: 47047
2008-02-13 03:23:53 +00:00
Owen Anderson 00dba4f734 Re-apply the patch to improve the optimizations of memcpy's, with several
bugs fixed.  This now passes PPC bootstrap.

llvm-svn: 47026
2008-02-12 21:15:18 +00:00
Evan Cheng 724029151b Don't mask the isel bug.
llvm-svn: 47018
2008-02-12 19:11:29 +00:00
Evan Cheng 3069a26f63 This test assumes no SSE4.1.
llvm-svn: 47017
2008-02-12 19:11:08 +00:00
Wojciech Matyjewicz ddb265b905 Now that ScalarEvolution::print writes to the correct stream, there is
no need to redirect stderr into stdout.

llvm-svn: 47009
2008-02-12 15:12:40 +00:00
Wojciech Matyjewicz 995624f44d Change negative grep into positive one in my yesterday's testcase.
llvm-svn: 47008
2008-02-12 15:10:35 +00:00
Wojciech Matyjewicz 1d2c27b23e Fix PR2002. Suppose n is the initial value for the induction
variable (with step 1) and m is its final value. Then, the correct trip 
count is SMAX(m,n)-n. Previously, we used SMAX(0,m-n), but m-n may 
overflow and can't in general be interpreted as signed.

Patch by Nick Lewycky.

llvm-svn: 47007
2008-02-12 15:09:36 +00:00
Tanya Lattner 3716d023ab Test case for annotate builtin.
llvm-svn: 46999
2008-02-12 07:46:33 +00:00
Evan Cheng b21301fbe7 Fix some test cases.
llvm-svn: 46998
2008-02-12 07:22:46 +00:00
Wojciech Matyjewicz adae053b53 If the LHS of the comparison is a loop-invariant we also want to move it
to the RHS. This simple change allows to compute loop iteration count 
for loops with condition similar to the one in the testcase (which seems 
to be quite common).

llvm-svn: 46959
2008-02-11 18:37:34 +00:00
Wojciech Matyjewicz d2d9764cc8 Fix PR1798 - an error in the evaluation of SCEVAddRecExpr at an
arbitrary iteration.

The patch:
1) changes SCEVSDivExpr into SCEVUDivExpr,
2) replaces PartialFact() function with BinomialCoefficient(); the 
computations (essentially, the division) in BinomialCoefficient() are 
performed with the apprioprate bitwidth necessary to avoid overflow; 
unsigned division is used instead of the signed one.

Computations in BinomialCoefficient() require support from the code 
generator for APInts. Currently, we use a hack rounding up the 
neccessary bitwidth to the nearest power of 2. The hack is easy to turn 
off in future.

One remaining issue: we assume the divisor of the binomial coefficient 
formula can be computed accurately using 16 bits. It means we can handle 
AddRecs of length up to 9. In future, we should use APInts to evaluate 
the divisor.

Thanks to Nicholas for cooperation!

llvm-svn: 46955
2008-02-11 11:03:14 +00:00
Evan Cheng ad4d57a2f5 Determine whether a spill kills the register it's spilling before insertion rather than trying to undo the kill marker afterwards.
llvm-svn: 46953
2008-02-11 08:30:52 +00:00
Dan Gohman 3a4be0fdef Rename MRegisterInfo to TargetRegisterInfo.
llvm-svn: 46930
2008-02-10 18:45:23 +00:00
Dale Johannesen 43a2ed8611 Alignment of struct containing vectors depends on
whether SSE is present, on Darwin anyway.  Make it
explicit.

llvm-svn: 46909
2008-02-09 19:04:25 +00:00
Devang Patel 26f75e2576 Fix PR 1995.
llvm-svn: 46898
2008-02-08 22:49:13 +00:00
Evan Cheng 3b3286d4bc It's not always safe to fold movsd into xorpd, etc. Check the alignment of the load address first to make sure it's 16 byte aligned.
llvm-svn: 46893
2008-02-08 21:20:40 +00:00
Evan Cheng 8d59dd119b Added missing entries in X86 load / store folding tables.
llvm-svn: 46866
2008-02-08 00:12:56 +00:00
Evan Cheng a20a773654 Fix a x86-64 codegen deficiency. Allow gv + offset when using rip addressing mode.
Before:
_main:
        subq    $8, %rsp
        leaq    _X(%rip), %rax
        movsd   8(%rax), %xmm1
        movss   _X(%rip), %xmm0
        call    _t
        xorl    %ecx, %ecx
        movl    %ecx, %eax
        addq    $8, %rsp
        ret
Now:
_main:
        subq    $8, %rsp
        movsd   _X+8(%rip), %xmm1
        movss   _X(%rip), %xmm0
        call    _t
        xorl    %ecx, %ecx
        movl    %ecx, %eax
        addq    $8, %rsp
        ret

Notice there is another idiotic codegen issue that needs to be fixed asap:
xorl    %ecx, %ecx
movl    %ecx, %eax

llvm-svn: 46850
2008-02-07 08:53:49 +00:00
Evan Cheng 127b41500c It's PR1925, not PR1609.
llvm-svn: 46825
2008-02-06 22:07:17 +00:00
Bill Wendling c676a0329c Temporarily reverting:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20080128/057882.html

This is causing a miscompilation on PPC G5 and just now seeing it on iMac x86-64.

llvm-svn: 46822
2008-02-06 20:03:07 +00:00
Evan Cheng 1ec748c784 Fix a number of local register allocator issues: PR1609.
llvm-svn: 46821
2008-02-06 19:16:53 +00:00
Evan Cheng 87fbd66f9f Fix PR1975: dag isel emitter produces patterns that isel wrong flag result.
llvm-svn: 46776
2008-02-05 22:50:29 +00:00
Evan Cheng 8d78b0597b If a vr is already marked alive in a bb, then it has PHI uses that are visited earlier, then it is not killed in the def block (i.e. not dead).
llvm-svn: 46763
2008-02-05 20:04:18 +00:00
Chris Lattner 682a7dc653 Fix a bug compiling PR1978 (perhaps not the only one though) which
was incorrectly simplifying "x == (gep x, 1, i)" into false, even 
though i could be negative.  As it turns out, all the code to 
handle this already existed, we just need to disable the incorrect
optimization case and let the general case handle it.

llvm-svn: 46739
2008-02-05 04:45:32 +00:00
Evan Cheng baba47f1ea This should also work on x86 now.
llvm-svn: 46730
2008-02-05 00:25:31 +00:00