Commit Graph

26814 Commits

Author SHA1 Message Date
Andrew Lenharth
16113431e8 Comments on JumpTableness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30615 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-26 20:02:30 +00:00
Jim Laskey
bb1518585b Load chain check is not needed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30613 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-26 17:44:58 +00:00
Jim Laskey
79597d2af6 Chain can be any operand
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30611 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-26 09:32:41 +00:00
Jim Laskey
3dd1170616 Wrong size for load
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30610 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-26 08:14:06 +00:00
Jim Laskey
172585b3aa Can't move a load node if it's chain is not used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30609 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-26 07:37:42 +00:00
Chris Lattner
e87e1154a1 Various random and minor code cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30608 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-26 03:57:53 +00:00
Chris Lattner
6961329c47 test that the no_dead_strip directive is emitted on darwin-x86
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30607 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-26 03:44:20 +00:00
Chris Lattner
681764b20c print the preds of each MBB
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30606 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-26 03:41:59 +00:00
Chris Lattner
a53115b4c2 Compile:
int x __attribute__((used));

to:

        .data
.comm _x,4              ; 'x'
        .no_dead_strip  _x

on both x86 and ppc darwin targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30605 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-26 03:39:53 +00:00
Chris Lattner
cb05af852f Add support for targets that want to do something with the llvm.used list,
because they have an aggressive linker that does dead code stripping.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30604 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-26 03:38:18 +00:00
Chris Lattner
384299ef45 order this properly to avoid warnings in TargetAsmInfo.cpp. Add a comment
in a format that matches every other ivars in this class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30603 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-25 22:38:36 +00:00
Jim Laskey
14fbcbfa2b Accidental enable of bad code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30601 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-25 21:11:32 +00:00
Jim Laskey
288af5e740 Fix chain dropping in load and drop unused stores in ret blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30600 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-25 19:32:58 +00:00
John Criswell
a47c2e4927 Regression test for PR#922.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30599 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-25 19:12:01 +00:00
Chris Lattner
fb981f3fee more notes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30598 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-25 17:12:14 +00:00
Jim Laskey
279f053eae Core antialiasing for load and store.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30597 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-25 16:29:54 +00:00
Andrew Lenharth
758f89c690 Fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30596 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-25 14:04:53 +00:00
Andrew Lenharth
0607a2f554 Fix jump tables to match gcc (and the ABI and whatnot)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30594 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-24 19:46:56 +00:00
Andrew Lenharth
beec30eaf3 Add support for other relocation bases to jump tables, as well as custom asm directives
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30593 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-24 19:45:58 +00:00
Andrew Lenharth
b08659d2e5 basic jump table test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30592 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-24 19:42:02 +00:00
Andrew Lenharth
d044d6ee2c jump table note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30591 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-24 13:13:10 +00:00
Evan Cheng
2ae5b87996 PIC jump table entries are always 32-bit. This fixes PIC jump table support on X86-64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30590 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-24 05:22:38 +00:00
Nick Lewycky
b156afb791 Enable 'predsimplify' optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30589 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-24 00:08:16 +00:00
Nick Lewycky
8f389d8cd4 Style changes only. Remove dead code, fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30588 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-23 15:13:08 +00:00
Chris Lattner
120fce5540 Be far more careful when splitting a loop header, either to form a preheader
or when splitting loops with a common header into multiple loops.  In particular
the old code would always insert the preheader before the old loop header.  This
is disasterous in cases where the loop hasn't been rotated.  For example, it can
produce code like:

        .. outside the loop...
        jmp LBB1_2      #bb13.outer
LBB1_1: #bb1
        movsd 8(%esp,%esi,8), %xmm1
        mulsd (%edi), %xmm1
        addsd %xmm0, %xmm1
        addl $24, %edi
        incl %esi
        jmp LBB1_3      #bb13
LBB1_2: #bb13.outer
        leal (%edx,%eax,8), %edi
        pxor %xmm1, %xmm1
        xorl %esi, %esi
LBB1_3: #bb13
        movapd %xmm1, %xmm0
        cmpl $4, %esi
        jl LBB1_1       #bb1

Note that the loop body is actually LBB1_1 + LBB1_3, which means that the
loop now contains an uncond branch WITHIN it to jump around the inserted
loop header (LBB1_2).  Doh.

This patch changes the preheader insertion code to insert it in the right
spot, producing this code:

        ... outside the loop, fall into the header ...
LBB1_1: #bb13.outer
        leal (%edx,%eax,8), %esi
        pxor %xmm0, %xmm0
        xorl %edi, %edi
        jmp LBB1_3      #bb13
LBB1_2: #bb1
        movsd 8(%esp,%edi,8), %xmm0
        mulsd (%esi), %xmm0
        addsd %xmm1, %xmm0
        addl $24, %esi
        incl %edi
LBB1_3: #bb13
        movapd %xmm0, %xmm1
        cmpl $4, %edi
        jl LBB1_2       #bb1

Totally crazy, no branch in the loop! :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30587 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-23 08:19:21 +00:00
Chris Lattner
c3984578be Teach UpdateDomInfoForRevectoredPreds to handle revectored preds that are not
reachable, making it general purpose enough for use by InsertPreheaderForLoop.
Eliminate custom dominfo updating code in InsertPreheaderForLoop, using
UpdateDomInfoForRevectoredPreds instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30586 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-23 07:40:52 +00:00
Chris Lattner
e87a4b6cb0 remove misleading comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30585 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-23 06:09:45 +00:00
Chris Lattner
a71965b1ad add method, correct comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30584 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-23 04:03:45 +00:00
Evan Cheng
f10c17f986 Delete dead code; fix 80 col violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30583 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-22 21:43:59 +00:00
Rafael Espindola
75645496fa add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30581 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-22 11:36:17 +00:00
Bill Wendling
17cdf7b0f4 Use "%llvmgxx" instead of "llvm-g++".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30580 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-22 07:09:01 +00:00
Nate Begeman
62929eb3d6 Testcase for better rotate left and mask support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30579 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-22 05:49:57 +00:00
Bill Wendling
f30e0eed4c Regression testcase for PR855.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30578 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-22 05:34:25 +00:00
Nate Begeman
f42f133938 Fold AND and ROTL more often
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30577 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-22 05:01:56 +00:00
Devang Patel
b71f6728eb remove extra white spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30576 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-22 01:07:57 +00:00
Devang Patel
8d3ab25335 Use iterative algorith to assign DFS number. This reduces
call stack depth.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30575 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-22 01:05:33 +00:00
Chris Lattner
ce6e84ca6c don't allow 'imm' or specific imms, like '1' on the LHS of a binop.
This shrinks X86GenDAGISel by ~330 lines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30574 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-21 20:46:13 +00:00
Evan Cheng
2adffa1f66 Make it work for DAG combine of multi-value nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30573 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-21 19:04:05 +00:00
Chris Lattner
649069728f Fit to 80 columns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30572 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-21 18:28:27 +00:00
Jim Laskey
516b0eacff core corrections
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30570 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-21 17:35:47 +00:00
Devang Patel
c7cfbc58ad Use abstract class to facilitate dlopen() interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30569 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-21 17:22:55 +00:00
Jim Laskey
d1aed7aaf7 Basic "in frame" alias analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30568 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-21 16:28:59 +00:00
Rafael Espindola
ebdabda708 more condition codes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30567 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-21 13:06:26 +00:00
Rafael Espindola
7246d33e2a if a constant can't be an immediate, add it to the constant pool
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30566 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-21 11:29:52 +00:00
Chris Lattner
0e4b922680 fold (aext (and (trunc x), cst)) -> (and x, cst).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30561 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-21 06:40:43 +00:00
Chris Lattner
bf3708794f Check the right value type. This fixes 186.crafty on x86
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30560 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-21 06:17:39 +00:00
Chris Lattner
b13f83eb23 implemented
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30559 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-21 06:14:54 +00:00
Chris Lattner
111c228241 Compile:
int %test(ulong *%tmp) {
        %tmp = load ulong* %tmp         ; <ulong> [#uses=1]
        %tmp.mask = shr ulong %tmp, ubyte 50            ; <ulong> [#uses=1]
        %tmp.mask = cast ulong %tmp.mask to ubyte
        %tmp2 = and ubyte %tmp.mask, 3          ; <ubyte> [#uses=1]
        %tmp2 = cast ubyte %tmp2 to int         ; <int> [#uses=1]
        ret int %tmp2
}

to:

_test:
        movl 4(%esp), %eax
        movl 4(%eax), %eax
        shrl $18, %eax
        andl $3, %eax
        ret

instead of:

_test:
        movl 4(%esp), %eax
        movl 4(%eax), %eax
        shrl $18, %eax
        # TRUNCATE movb %al, %al
        andb $3, %al
        movzbl %al, %eax
        ret


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30558 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-21 06:14:31 +00:00
Chris Lattner
6007b84a5b Generalize (zext (truncate x)) and (sext (truncate x)) folding to work when
the src/dst are not the same size.  This catches things like "truncate
32-bit X to 8 bits, then zext to 16", which happens a bit on X86.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30557 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-21 06:00:20 +00:00
Chris Lattner
60e32b0776 Fit in 80-cols
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30556 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-21 05:46:00 +00:00