Commit Graph

15418 Commits

Author SHA1 Message Date
Chris Lattner
f308ea01d5 add a note about a general improvement to the code generator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30642 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 06:01:17 +00:00
Chris Lattner
f6e70fa0d3 remove reference to dead method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30641 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 00:38:19 +00:00
Chris Lattner
8a94bf142a Use the new ManagedStatic class to explicitly manage static variables, eliminating static ctors/dtors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30639 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 00:35:06 +00:00
Chris Lattner
771cbf30bc new helper class to provide more explicit management of static ctor/dtors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30638 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 00:31:55 +00:00
Chris Lattner
8af24b86a8 re-re-revert this, back to the right revision. It currently breaks bisort/mst
in olden among others.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30637 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 00:11:54 +00:00
Evan Cheng
c2b4ec37de PEI now place callee save spills closest to the address pointed to by the
incoming stack. This allows X86 backend to use push / pop in epilogue /
prologue.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30636 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 00:10:27 +00:00
Chris Lattner
31cefb9943 re-revert this patch, bisort and mst are still broken in Olden.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30634 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 00:04:21 +00:00
Bill Wendling
4da1abb311 Reapplying this patch. With the newest commits, the error in Olden/bisort
has disappeared.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30633 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-27 22:37:35 +00:00
Chris Lattner
f38f543e01 silence warnings in release build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30631 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-27 18:29:38 +00:00
Devang Patel
79db5b7370 Fix DFS walk.
Fix http://llvm.org/bugs/show_bug.cgi?id=923


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30630 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-27 17:18:05 +00:00
Chris Lattner
6c88e9b458 Temporarily revert this. This breaks Olden/bisort on PPC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30628 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-27 16:59:16 +00:00
Bill Wendling
c36f2a4cea PR878: Instead of calculating the vreg to PHI use count everytime we get
a function, do it up front in linear time (going through all of the
instructions once). We create a map out of them. Then it's no problem to
use the information in it during elimination...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30624 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-27 09:04:15 +00:00
Chris Lattner
7514437133 set DEBUG_TYPE right
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30623 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-27 04:58:23 +00:00
Chris Lattner
5468966614 Use abstract private/comment directives, to increase portability to ppc/linux
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30621 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-27 02:55:21 +00:00
Chris Lattner
bae02cfd46 Add support for ${:private} which prints "L" on darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30620 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-27 00:06:07 +00:00
Chris Lattner
3ce9b67e0c Add support for ${:comment}, which expands to the current target's comment
character, and ${:uid} which expands to a unique ID for the MachineInstr.
More can be added if/when they are needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30619 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-26 23:59:50 +00:00
Evan Cheng
692d4e0823 Rename function. It's determining which callee-save registers to save.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30616 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-26 22:29:31 +00:00
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
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
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
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
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
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
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
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
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
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
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
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
Chris Lattner
9ba46c13bf Fix Transforms/IndVarsSimplify/2006-09-20-LFTR-Crash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30555 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-21 05:12:20 +00:00
Nick Lewycky
70084fd53a Fix compile error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30553 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-21 02:08:31 +00:00
Nick Lewycky
009aa1d485 Don't rewrite ConstantExpr::get.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30552 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-21 01:05:35 +00:00
Nick Lewycky
af2f1fe94e Once we're down to "setcc type constant1, constant2", at least come up
with the right answer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30550 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 23:02:24 +00:00
Anton Korobeynikov
f824868ed9 Adding codegeneration for StdCall & FastCall calling conventions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30549 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 22:03:51 +00:00
Andrew Lenharth
c459bbf0fd Account for pseudo-ops correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30548 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 20:08:52 +00:00
Chris Lattner
4da1c82f72 The DarwinAsmPrinter need not check for isDarwin. createPPCAsmPrinterPass
should create the right asmprinter subclass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30542 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 17:12:19 +00:00
Chris Lattner
dadceedbdb Wrap some darwin'isms with isDarwin checks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30541 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 17:07:15 +00:00
Nick Lewycky
406fc0cb49 Use a total ordering to compare instructions.
Fixes infinite loop in resolve().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30540 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 17:04:01 +00:00
Andrew Lenharth
4563326472 simplify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30535 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 15:37:57 +00:00
Andrew Lenharth
6b634037b3 catch constants more often
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30534 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 15:05:49 +00:00
Andrew Lenharth
886f98e6f9 clarify with test case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30531 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 14:48:00 +00:00
Andrew Lenharth
0b78f3e4b4 Add Note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30530 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 14:40:01 +00:00
Chris Lattner
f142713a30 item done
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30518 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 06:41:56 +00:00
Chris Lattner
e3152e54b5 Compile:
int test3(int a, int b) { return (a < 0) ? a : 0; }

to:

_test3:
        srawi r2, r3, 31
        and r3, r2, r3
        blr

instead of:

_test3:
        cmpwi cr0, r3, 1
        li r2, 0
        blt cr0, LBB2_2 ;entry
LBB2_1: ;entry
        mr r3, r2
LBB2_2: ;entry
        blr


This implements: PowerPC/select_lt0.ll:seli32_a_a


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30517 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 06:41:35 +00:00
Chris Lattner
7e932de7f5 add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30515 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 06:32:10 +00:00
Chris Lattner
84750587bf Fold the full generality of (any_extend (truncate x))
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30514 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 06:29:17 +00:00
Chris Lattner
5f42a240ba Two things:
1. teach SimplifySetCC that '(srl (ctlz x), 5) == 0' is really x != 0.
2. Teach visitSELECT_CC to use SimplifySetCC instead of calling it and
   ignoring the result.  This allows us to compile:

bool %test(ulong %x) {
  %tmp = setlt ulong %x, 4294967296
  ret bool %tmp
}

to:

_test:
        cntlzw r2, r3
        cmplwi cr0, r3, 1
        srwi r2, r2, 5
        li r3, 0
        beq cr0, LBB1_2 ;
LBB1_1: ;
        mr r3, r2
LBB1_2: ;
        blr

instead of:

_test:
        addi r2, r3, -1
        cntlzw r2, r2
        cntlzw r3, r3
        srwi r2, r2, 5
        cmplwi cr0, r2, 0
        srwi r2, r3, 5
        li r3, 0
        bne cr0, LBB1_2 ;
LBB1_1: ;
        mr r3, r2
LBB1_2: ;
        blr

This isn't wonderful, but it's an improvement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30513 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 06:19:26 +00:00
Chris Lattner
ac924c8248 This is already done
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30512 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 04:59:33 +00:00
Chris Lattner
b8456460cb We went through all that trouble to compute whether it was safe to transform
this comparison, but never checked it.  Whoops, no wonder we miscompiled
177.mesa!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30511 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 04:44:59 +00:00
Chris Lattner
711762497c Improve PPC64 equality comparisons like PPC32 comparisons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30510 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 04:33:27 +00:00
Chris Lattner
3836dbd3bd Two improvements:
1. Codegen this comparison:
     if (X == 0x8000)

as:

        cmplwi cr0, r3, 32768
        bne cr0, LBB1_2 ;cond_next

instead of:

        lis r2, 0
        ori r2, r2, 32768
        cmpw cr0, r3, r2
        bne cr0, LBB1_2 ;cond_next


2. Codegen this comparison:
      if (X == 0x12345678)

as:

        xoris r2, r3, 4660
        cmplwi cr0, r2, 22136
        bne cr0, LBB1_2 ;cond_next

instead of:

        lis r2, 4660
        ori r2, r2, 22136
        cmpw cr0, r3, r2
        bne cr0, LBB1_2 ;cond_next


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30509 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 04:25:47 +00:00
Chris Lattner
cc96ac3a7d Add a note that we should match rlwnm better
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30508 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 03:59:25 +00:00
Chris Lattner
3fe6c1d389 Legalize is no longer limited to cleverness with just constant shift amounts.
Allow it to be clever when possible and fall back to the gross code when needed.

This allows us to compile:

long long foo1(long long X, int C) {
  return X << (C|32);
}
long long foo2(long long X, int C) {
  return X << (C&~32);
}

to:
_foo1:
        rlwinm r2, r5, 0, 27, 31
        slw r3, r4, r2
        li r4, 0
        blr


        .globl  _foo2
        .align  4
_foo2:
        rlwinm r2, r5, 0, 27, 25
        subfic r5, r2, 32
        slw r3, r3, r2
        srw r5, r4, r5
        or r3, r3, r5
        slw r4, r4, r2
        blr

instead of:

_foo1:
        ori r2, r5, 32
        subfic r5, r2, 32
        addi r6, r2, -32
        srw r5, r4, r5
        slw r3, r3, r2
        slw r6, r4, r6
        or r3, r3, r5
        slw r4, r4, r2
        or r3, r3, r6
        blr


        .globl  _foo2
        .align  4
_foo2:
        rlwinm r2, r5, 0, 27, 25
        subfic r5, r2, 32
        addi r6, r2, -32
        srw r5, r4, r5
        slw r3, r3, r2
        slw r6, r4, r6
        or r3, r3, r5
        slw r4, r4, r2
        or r3, r3, r6
        blr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30507 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 03:47:40 +00:00
Chris Lattner
0ea26ca45b Expand 64-bit shifts more optimally if we know that the high bit of the
shift amount is one or zero.  For example, for:

long long foo1(long long X, int C) {
  return X << (C|32);
}

long long foo2(long long X, int C) {
  return X << (C&~32);
}

we get:

_foo1:
        movb $31, %cl
        movl 4(%esp), %edx
        andb 12(%esp), %cl
        shll %cl, %edx
        xorl %eax, %eax
        ret
_foo2:
        movb $223, %cl
        movl 4(%esp), %eax
        movl 8(%esp), %edx
        andb 12(%esp), %cl
        shldl %cl, %eax, %edx
        shll %cl, %eax
        ret

instead of:

_foo1:
        subl $4, %esp
        movl %ebx, (%esp)
        movb $32, %bl
        movl 8(%esp), %eax
        movl 12(%esp), %edx
        movb %bl, %cl
        orb 16(%esp), %cl
        shldl %cl, %eax, %edx
        shll %cl, %eax
        xorl %ecx, %ecx
        testb %bl, %bl
        cmovne %eax, %edx
        cmovne %ecx, %eax
        movl (%esp), %ebx
        addl $4, %esp
        ret
_foo2:
        subl $4, %esp
        movl %ebx, (%esp)
        movb $223, %cl
        movl 8(%esp), %eax
        movl 12(%esp), %edx
        andb 16(%esp), %cl
        shldl %cl, %eax, %edx
        shll %cl, %eax
        xorl %ecx, %ecx
        xorb %bl, %bl
        testb %bl, %bl
        cmovne %eax, %edx
        cmovne %ecx, %eax
        movl (%esp), %ebx
        addl $4, %esp
        ret


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30506 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 03:38:48 +00:00
Evan Cheng
571c15e38a Back out Chris' last set of changes. This breaks 177.mesa and povray somehow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30505 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 01:39:40 +00:00
Evan Cheng
7df4ad9a7f 80 col.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30504 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 01:10:02 +00:00
Andrew Lenharth
16d7955eb0 If we have an add, do it in the pointer realm, not the int realm. This is critical in the linux kernel for pointer analysis correctness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30496 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-19 18:24:51 +00:00
Chris Lattner
2b41b8e870 Fix UnitTests/2005-05-12-Int64ToFP.c with llc-beta. In particular, do not
allow it to go into an infinite loop, filling up the disk!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30494 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-19 18:02:01 +00:00
Rafael Espindola
4d4c021758 fix header
add comments
untabify


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30486 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-19 16:41:40 +00:00
Rafael Espindola
71f3b94fa8 Implement a MachineFunctionPass to fix the mul instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30485 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-19 15:49:25 +00:00
Chris Lattner
f529b08c0d item done
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30483 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-19 06:19:03 +00:00
Chris Lattner
733f576d29 implement select.ll:test19-22
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30482 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-19 06:18:21 +00:00
Chris Lattner
cf9d0acfef Fold the PPCISD shifts when presented with 0 inputs. This occurs for code
like:
long long test(long long X, int Y) {
  return 1ULL << Y;
}
long long test2(long long X, int Y) {
  return -1LL << Y;
}

which we used to compile to:

_test:
        li r2, 1
        subfic r3, r5, 32
        li r4, 0
        addi r6, r5, -32
        srw r3, r2, r3
        slw r4, r4, r5
        slw r6, r2, r6
        or r3, r4, r3
        slw r4, r2, r5
        or r3, r3, r6
        blr
_test2:
        li r2, -1
        subfic r3, r5, 32
        addi r6, r5, -32
        srw r3, r2, r3
        slw r4, r2, r5
        slw r2, r2, r6
        or r3, r4, r3
        or r3, r3, r2
        blr

Now we produce:

_test:
        li r2, 1
        addi r3, r5, -32
        subfic r4, r5, 32
        slw r3, r2, r3
        srw r4, r2, r4
        or r3, r4, r3
        slw r4, r2, r5
        blr
_test2:
        li r2, -1
        subfic r3, r5, 32
        addi r6, r5, -32
        srw r3, r2, r3
        slw r4, r2, r5
        slw r2, r2, r6
        or r3, r4, r3
        or r3, r3, r2
        blr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30479 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-19 05:22:59 +00:00
Chris Lattner
863ac769b8 Fold extract_element(cst) to cst
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30478 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-19 05:02:39 +00:00
Chris Lattner
5c6621c3bc Minor speedup for legalize by avoiding some malloc traffic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30477 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-19 04:51:23 +00:00
Evan Cheng
6b5578f052 Fix a typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30474 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-18 23:28:33 +00:00
Evan Cheng
52cc1ea2a1 Allow i32 UDIV, SDIV, UREM, SREM to be expanded into libcalls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30470 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-18 21:49:04 +00:00
Nick Lewycky
025f4c0fad Walk down the dominator tree instead of the control flow graph. That means
that we can't modify the CFG any more, at least not until it's possible
to update the dominator tree (PR217).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30469 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-18 21:09:35 +00:00
Andrew Lenharth
2ab804c607 A pass to remove the worst of the replay trap offenders, and as a bonus, align basic blocks when it is free to do so
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30467 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-18 19:44:29 +00:00
Chris Lattner
6d7ca92bbf Fix an infinite loop building the CFE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30465 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-18 18:27:05 +00:00
Andrew Lenharth
ea4f9d5801 Jump tables on Alpha
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30463 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-18 18:01:03 +00:00
Andrew Lenharth
303c6222a4 oops
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30462 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-18 18:00:18 +00:00
Andrew Lenharth
3fbd67898e absolute addresses must match pointer size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30461 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-18 17:59:35 +00:00
Jim Laskey
e85fb6719a Sort out mangled names for globals
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30460 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-18 14:47:26 +00:00
Chris Lattner
4af90abc13 Implement a trivial optzn: of vastart is never called in a function that takes
... args, remove the '...'.

This is Transforms/DeadArgElim/dead_vaargs.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30459 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-18 07:02:31 +00:00
Chris Lattner
f73fb88688 add a note. Our 64-bit shifts are ~30% slower than gcc's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30457 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-18 05:36:54 +00:00
Chris Lattner
e695a3bd32 Implement InstCombine/cast.ll:test31. This speeds up 462.libquantum by 26%.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30456 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-18 05:27:43 +00:00
Chris Lattner
79bc332ddb add a helper method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30452 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-18 04:54:57 +00:00
Chris Lattner
b33a42a21f This is closer to what we really want.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30451 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-18 04:54:35 +00:00
Chris Lattner
b7363791ed Implement Transforms/InstCombine/shift-sra.ll:test0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30450 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-18 04:31:40 +00:00
Chris Lattner
65b72baa59 Rewrite shift/and/compare sequences to promote better licm of the RHS.
Use isLogicalShift/isArithmeticShift to simplify code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30448 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-18 04:22:48 +00:00
Anton Korobeynikov
bcb9770efe Added some eye-candy for Subtarget type checking
Added X86 StdCall & FastCall calling conventions. Codegen will follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30446 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-17 20:25:45 +00:00
Chris Lattner
2f463865c2 Add ShiftInst::isLogical/ArithmeticShift methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30445 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-17 19:29:56 +00:00
Chris Lattner
a5b07404f7 Add new SetCondInst::isRelational/isEquality methods. Rename
Instruction::isRelational to Instruction::isComparison.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30444 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-17 19:14:47 +00:00
Nick Lewycky
e81f725b3a Explain change with a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30443 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-17 17:51:00 +00:00
Nick Lewycky
38c7c42a32 Fix PR912. The input to erase() must not be a reference to the data
being erased.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30442 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-17 16:23:36 +00:00
Anton Korobeynikov
93c2b37340 Small fixes for supporting dll* linkage types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30441 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-17 13:06:18 +00:00
Chris Lattner
7ed96abc09 add a note noticed through source inspection
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30418 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-16 23:57:51 +00:00
Chris Lattner
8829dc88a8 Oh yeah, this is needed too
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30407 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-16 05:08:34 +00:00
Chris Lattner
88640b5ecd add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30406 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-16 03:30:19 +00:00
Chris Lattner
f6bd07c7fe Fix Transforms/InstCombine/2006-09-15-CastToBool.ll and PR913
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30405 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-16 03:14:10 +00:00
Chris Lattner
a89654b1a1 simplify control flow, no functionality change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30403 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-16 00:21:44 +00:00
Chris Lattner
7d7bffe157 Allow custom expand of mul
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30402 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-16 00:09:24 +00:00
Chris Lattner
cbce2f6c1b add a nate note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30399 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-15 20:31:36 +00:00
Chris Lattner
94876527af revert previous two patches. They cause miscompilation of MultiSource/Applications/Burg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30397 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-15 17:24:45 +00:00
Owen Anderson
46f022a7f1 Revert my previous work on ArgumentPromotion. Further investigation has revealed these
changes to be incorrect.  They just weren't showing up in any of our current testcases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30385 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-15 05:22:51 +00:00
Chris Lattner
c6336273d9 Unbreak the JIT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30384 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-15 04:56:11 +00:00
Chris Lattner
428b92eb83 Keep track of the start of MBB's in a separate map from instructions. This
is faster and is needed for future improvements.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30383 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-15 03:57:23 +00:00
Evan Cheng
c45a2c72cc Remove a unnecessary check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30382 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-14 23:55:02 +00:00
Devang Patel
697e590580 Undo previous check-in.
Reintroduce recursive assignDFSNumber().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30380 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-14 21:43:24 +00:00
Chris Lattner
1ec72738ac Fold (X & C1) | (Y & C2) -> (X|Y) & C3 when possible.
This implements CodeGen/X86/and-or-fold.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30379 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-14 21:11:37 +00:00
Chris Lattner
f0613e1e7c add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30377 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-14 20:56:30 +00:00
Chris Lattner
516b962b5a Split rotate matching code out to its own function. Make it stronger, by
matching things like ((x >> c1) & c2) | ((x << c3) & c4) to (rot x, c5) & c6


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30376 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-14 20:50:57 +00:00
Anton Korobeynikov
43e3aad6af Adding generated files for the last commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30375 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-14 18:25:26 +00:00
Anton Korobeynikov
b74ed07bfd Adding dllimport, dllexport and external weak linkage types.
DLL* linkages got full (I hope) codegeneration support in C & both x86
assembler backends.
External weak linkage added for future use, we don't provide any
codegeneration, etc. support for it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30374 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-14 18:23:27 +00:00
Evan Cheng
a17cf0a7e2 Use getOffset() instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30327 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-14 07:41:12 +00:00
Evan Cheng
d5a99d7810 Use MachineConstantPoolEntry getOffset() and getType() accessors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30326 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-14 07:35:00 +00:00
Chris Lattner
5f1d01393c Use new config.h macro
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30321 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-14 06:21:59 +00:00
Chris Lattner
26b6c0ba5d On Mac OS/X, make Process::PreventCoreFiles disable crash reporter for
the process in addition to disabling core file emission.  This speeds up
bugpoint on default-configured macs by several orders of magnitude.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30317 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-14 06:01:41 +00:00
Evan Cheng
9abd7c3867 A MachineConstantPool may have mixed Constant* and MachineConstantPoolValue* values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30316 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-14 05:50:57 +00:00
Devang Patel
57d12f962d Avoid recursion in assignDFSNumber(). Move def from ET-Forest.h
to Dominators.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30309 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-14 01:27:42 +00:00
Chris Lattner
08c33011d1 add note about switch lowering
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30308 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-13 23:37:16 +00:00
Chris Lattner
a4646b61e4 Second half of the fix for Transforms/Inline/inline_cleanup.ll
This folds unconditional branches that are often produced by code
specialization.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30307 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-13 21:27:00 +00:00
Nick Lewycky
668a1d0fd2 Add some more consistency checks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30305 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-13 19:32:53 +00:00
Nick Lewycky
977be254c6 Fix unionSets so that it can merge correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30304 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-13 19:24:01 +00:00
Chris Lattner
33bb3c8be3 Implement the first half of Transforms/Inline/inline_cleanup.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30303 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-13 19:23:57 +00:00
Evan Cheng
80543c8305 Skip over first operand when determining REX prefix for two-address code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30300 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-13 19:07:28 +00:00
Nick Lewycky
cf2112a0a0 Erase dead instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30298 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-13 18:55:37 +00:00
Chris Lattner
bfd68a7858 Turn X < 0 -> TEST X,X js
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30294 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-13 17:04:54 +00:00
Chris Lattner
7a6366de86 The sense of this branch was inverted :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30293 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-13 16:56:12 +00:00
Chris Lattner
8a650095fc Fix a ton of jit failures
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30292 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-13 16:21:10 +00:00
Rafael Espindola
3ad5e5cf99 add shifts to addressing mode 1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30291 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-13 12:09:43 +00:00
Chris Lattner
c970f062e0 If LSR went through a lot of trouble to put constants (e.g. the addr of a global
in a specific BB, don't undo this!).  This allows us to compile
CodeGen/X86/loop-hoist.ll into:

_foo:
        xorl %eax, %eax
***     movl L_Arr$non_lazy_ptr, %ecx
        movl 4(%esp), %edx
LBB1_1: #cond_true
        movl %eax, (%ecx,%eax,4)
        incl %eax
        cmpl %edx, %eax
        jne LBB1_1      #cond_true
LBB1_2: #return
        ret

instead of:

_foo:
        xorl %eax, %eax
        movl 4(%esp), %ecx
LBB1_1: #cond_true
***     movl L_Arr$non_lazy_ptr, %edx
        movl %eax, (%edx,%eax,4)
        incl %eax
        cmpl %ecx, %eax
        jne LBB1_1      #cond_true
LBB1_2: #return
        ret

This was noticed in 464.h264ref.  This doesn't usually affect PPC,
but strikes X86 all the time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30290 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-13 06:02:42 +00:00
Chris Lattner
0f27fc34f7 Fix a regression in the 32-bit port from the 64-bit port landing.
We now compile CodeGen/X86/lea-2.ll into:

_test:
        movl 4(%esp), %eax
        movl 8(%esp), %ecx
        leal -5(%ecx,%eax,4), %eax
        ret

instead of:

_test:
        movl 4(%esp), %eax
        leal (,%eax,4), %eax
        addl 8(%esp), %eax
        addl $4294967291, %eax
        ret


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30288 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-13 04:45:25 +00:00
Chris Lattner
d1468d3332 new note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30286 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-13 04:19:50 +00:00
Chris Lattner
95af34e33f new note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30285 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-13 03:54:54 +00:00
Chris Lattner
79980b07da Compile X << 1 (where X is a long-long) to:
addl %ecx, %ecx
        adcl %eax, %eax

instead of:

        movl %ecx, %edx
        addl %edx, %edx
        shrl $31, %ecx
        addl %eax, %eax
        orl %ecx, %eax

and to:

        addc r5, r5, r5
        adde r4, r4, r4

instead of:

        slwi r2,r9,1
        srwi r0,r11,31
        slwi r3,r11,1
        or r2,r0,r2

on PPC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30284 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-13 03:50:39 +00:00
Chris Lattner
f95705163f Compile X > -1 -> text X,X; js dest
This implements CodeGen/X86/jump_sign.ll.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30283 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-13 03:22:10 +00:00
Devang Patel
56eac5f6f7 Initialize DontInternalize.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30281 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-13 01:02:26 +00:00
Evan Cheng
c356a572e3 Reflects MachineConstantPoolEntry changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30279 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-12 21:04:05 +00:00
Evan Cheng
d6594ae54c Added support for machine specific constantpool values. These are useful for
representing expressions that can only be resolved at link time, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30278 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-12 21:00:35 +00:00
Evan Cheng
cd5731d98b Reflect MachineConstantPoolEntry changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30277 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-12 20:59:59 +00:00
Chris Lattner
92f7365740 An sinkable instruction may exist with uses, if those uses are in dead blocks.
Handle this.  This fixes PR908 and Transforms/LICM/2006-09-12-DeadUserOfSunkInstr.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30275 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-12 19:17:09 +00:00
Chris Lattner
adaa38f13d add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30271 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-12 06:36:01 +00:00
Chris Lattner
0bfd7fde43 Testcase noticed from PR906
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30269 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-11 23:00:56 +00:00
Chris Lattner
2a33a3f08d add compilable testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30268 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-11 22:57:51 +00:00
Chris Lattner
63d3220dae Fix PR905 and InstCombine/2006-09-11-EmptyStructCrash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30266 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-11 21:43:16 +00:00
Rafael Espindola
817e7fdb8b implement SRL and MUL
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30262 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-11 19:24:19 +00:00
Rafael Espindola
1b3956b516 add the correct fallback for ARMDAGToDAGISel::SelectAddrMode1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30261 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-11 19:23:32 +00:00
Rafael Espindola
7cca7c5317 partial implementation of the ARM Addressing Mode 1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30252 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-11 17:25:40 +00:00
Nick Lewycky
3fc68ccd83 Skip the linear search if the answer is already known.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30251 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-11 17:23:34 +00:00
Rafael Espindola
ff59d22232 call AsmPrinter::doInitialization in ARMAsmPrinter::doInitialization
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30246 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-11 12:49:38 +00:00
Evan Cheng
f47d167c3b Updates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30245 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-11 05:35:17 +00:00
Evan Cheng
0f4aa6ee20 Update README file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30244 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-11 05:25:15 +00:00
Evan Cheng
734503be59 X86ISD::CMP now produces a chain as well as a flag. Make that the chain
operand of a conditional branch to allow load folding into CMP / TEST
instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30241 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-11 02:19:56 +00:00
Nate Begeman
019f851ab2 Behold, more work on relocations. Things are looking pretty good now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30240 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-10 23:03:44 +00:00
Anton Korobeynikov
f369dd26fb Removed unnecessary Mangler creation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30239 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-10 21:17:03 +00:00
Chris Lattner
dfa1af0513 Allow tail duplication in more cases, relaxing the previous restriction a
bit.  This fixes Regression/Transforms/TailDup/MergeTest.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30237 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-10 18:17:58 +00:00
Chris Lattner
c66764c007 This code was trying too hard. By eliminating redundant edges in the CFG
due to switch cases going to the same place, it make #pred != #phi entries,
breaking live interval analysis.

This fixes 458.sjeng on x86 with llc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30236 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-10 06:36:57 +00:00
Nick Lewycky
dc08cd56c4 Replace EquivalenceClasses with a custom-built data structure. Many common
operations (like findProperties) should be faster, at the expense of
unionSets being slower in cases that are rare in practise.

Don't erase a dead Instruction. This fixes a memory corruption issue.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30235 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-10 02:27:07 +00:00
Chris Lattner
2a86f3b744 Implement Transforms/InstCombine/hoist_instr.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30234 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-09 22:02:56 +00:00
Chris Lattner
7b166d9969 Make inlining costs more accurate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30231 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-09 20:40:44 +00:00
Chris Lattner
8e49e08f4b Turn div X, (Cond ? Y : 0) -> div X, Y
This implements select.ll::test18.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30230 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-09 20:26:32 +00:00
Chris Lattner
1e14289ef9 Add cbe support for powi
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30226 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-09 06:17:12 +00:00
Chris Lattner
6ddf8ed6fe Implement the fpowi now by lowering to a libcall
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30225 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-09 06:03:30 +00:00
Chris Lattner
f3f333dbd6 Allow targets to custom lower expanded BIT_CONVERT's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30217 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-09 00:20:27 +00:00
Nate Begeman
94be248dbb First pass at supporting relocations. Relocations are written correctly to
the file now, however the relocated address is currently wrong.  Fixing
that will require some deep pondering.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30207 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-08 22:42:09 +00:00
Evan Cheng
6f34b43292 Fixed a FuseTwoAddrInst() bug: consider GlobalAddress and JumpTableIndex
in addition to immediate operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30205 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-08 21:08:13 +00:00
Chris Lattner
0c5b8dac79 Non-allocatable physregs can be killed and dead, but don't treat them as
safe for later allocation.  This fixes McCat/18-imp with llc-beta.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30204 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-08 20:21:31 +00:00
Chris Lattner
cc406328bf This fixes Benchmarks/Prolangs-C/unix-smail
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30198 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-08 19:11:11 +00:00
Chris Lattner
45d5788123 Fix a bunch of llc-beta failures on x86 yesterday. Don't allow selection
of unallocatable registers, just because an alias is allocatable.  We were
picking registers like SIL just because ESI was being used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30197 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-08 19:03:30 +00:00
Rafael Espindola
0a200600e7 implement shl and sra
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30191 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-08 17:36:23 +00:00
Chris Lattner
40f4ba5e71 Use __USER_LABEL_PREFIX__ to get the prefix added by the current host.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30190 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-08 17:03:56 +00:00
Rafael Espindola
4e30764d55 add the eor (xor) instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30189 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-08 16:59:47 +00:00
Jim Laskey
f45c25f720 Missing tab
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30188 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-08 13:06:56 +00:00
Rafael Espindola
5c2aa0a4d8 implement unconditional branches
fix select.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30186 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-08 12:47:03 +00:00
Evan Cheng
36978b9c61 Remove TEST64mr. It's same as TEST64rm since and is commutative.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30178 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-08 06:56:55 +00:00
Evan Cheng
25ab690a43 Committing X86-64 support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30177 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-08 06:48:29 +00:00
Nate Begeman
6fe6084ebf We actually do support object file writing, so don't return true (error)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30173 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-08 03:42:15 +00:00
Evan Cheng
8cf723d8eb - Identify a vector_shuffle that can be turned into an undef, e.g.
shuffle V1, <undef>, <undef, undef, 4, 5>
- Fix some suspicious logic into LowerVectorShuffle that cause less than
  optimal code by failing to identify MOVL (move to lowest element of a
  vector).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30171 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-08 01:50:06 +00:00
Jim Laskey
fde1b3bb2f 1. Remove condition on delete.
2. Protect and outline createTargetAsmInfo.

3. Misc. kruft.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30169 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-07 23:39:26 +00:00
Devang Patel
f93f68347f Untabify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30168 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-07 23:29:19 +00:00
Devang Patel
c8719e9353 Use iterative do-while loop instead of recursive DFSPass calls to
reduce amount of stack space used at runtime.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30167 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-07 23:22:37 +00:00
Chris Lattner
2dd538c2d2 add a new value for the command line optn
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30165 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-07 22:32:28 +00:00
Chris Lattner
cdb341dcfa Fix a cross-build issue. The asmsyntax shouldn't be affected by the build
host, it should be affected by the target.  Allow the command line option to
override in either case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30164 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-07 22:29:41 +00:00