oota-llvm.git
18 years agoBasic "in frame" alias analysis.
Jim Laskey [Thu, 21 Sep 2006 16:28:59 +0000 (16:28 +0000)]
Basic "in frame" alias analysis.

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

18 years agomore condition codes
Rafael Espindola [Thu, 21 Sep 2006 13:06:26 +0000 (13:06 +0000)]
more condition codes

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

18 years agoif a constant can't be an immediate, add it to the constant pool
Rafael Espindola [Thu, 21 Sep 2006 11:29:52 +0000 (11:29 +0000)]
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

18 years agofold (aext (and (trunc x), cst)) -> (and x, cst).
Chris Lattner [Thu, 21 Sep 2006 06:40:43 +0000 (06:40 +0000)]
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

18 years agoCheck the right value type. This fixes 186.crafty on x86
Chris Lattner [Thu, 21 Sep 2006 06:17:39 +0000 (06:17 +0000)]
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

18 years agoimplemented
Chris Lattner [Thu, 21 Sep 2006 06:14:54 +0000 (06:14 +0000)]
implemented

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

18 years agoCompile:
Chris Lattner [Thu, 21 Sep 2006 06:14:31 +0000 (06:14 +0000)]
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

18 years agoGeneralize (zext (truncate x)) and (sext (truncate x)) folding to work when
Chris Lattner [Thu, 21 Sep 2006 06:00:20 +0000 (06:00 +0000)]
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

18 years agoFit in 80-cols
Chris Lattner [Thu, 21 Sep 2006 05:46:00 +0000 (05:46 +0000)]
Fit in 80-cols

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

18 years agoFix Transforms/IndVarsSimplify/2006-09-20-LFTR-Crash.ll
Chris Lattner [Thu, 21 Sep 2006 05:12:20 +0000 (05:12 +0000)]
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

18 years agonew testcase
Chris Lattner [Thu, 21 Sep 2006 05:11:01 +0000 (05:11 +0000)]
new testcase

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

18 years agoFix compile error.
Nick Lewycky [Thu, 21 Sep 2006 02:08:31 +0000 (02:08 +0000)]
Fix compile error.

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

18 years agoDon't rewrite ConstantExpr::get.
Nick Lewycky [Thu, 21 Sep 2006 01:05:35 +0000 (01:05 +0000)]
Don't rewrite ConstantExpr::get.

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

18 years agoOnce we're down to "setcc type constant1, constant2", at least come up
Nick Lewycky [Wed, 20 Sep 2006 23:02:24 +0000 (23:02 +0000)]
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

18 years agoAdding codegeneration for StdCall & FastCall calling conventions
Anton Korobeynikov [Wed, 20 Sep 2006 22:03:51 +0000 (22:03 +0000)]
Adding codegeneration for StdCall & FastCall calling conventions

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

18 years agoAccount for pseudo-ops correctly
Andrew Lenharth [Wed, 20 Sep 2006 20:08:52 +0000 (20:08 +0000)]
Account for pseudo-ops correctly

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

18 years agoThe DarwinAsmPrinter need not check for isDarwin. createPPCAsmPrinterPass
Chris Lattner [Wed, 20 Sep 2006 17:12:19 +0000 (17:12 +0000)]
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

18 years agoWrap some darwin'isms with isDarwin checks.
Chris Lattner [Wed, 20 Sep 2006 17:07:15 +0000 (17:07 +0000)]
Wrap some darwin'isms with isDarwin checks.

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

18 years agoUse a total ordering to compare instructions.
Nick Lewycky [Wed, 20 Sep 2006 17:04:01 +0000 (17:04 +0000)]
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

18 years agosimplify
Andrew Lenharth [Wed, 20 Sep 2006 15:37:57 +0000 (15:37 +0000)]
simplify

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

18 years agocatch constants more often
Andrew Lenharth [Wed, 20 Sep 2006 15:05:49 +0000 (15:05 +0000)]
catch constants more often

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

18 years agocatch another constant
Andrew Lenharth [Wed, 20 Sep 2006 15:04:55 +0000 (15:04 +0000)]
catch another constant

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

18 years agoclarify with test case
Andrew Lenharth [Wed, 20 Sep 2006 14:48:00 +0000 (14:48 +0000)]
clarify with test case

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

18 years agoAdd Note
Andrew Lenharth [Wed, 20 Sep 2006 14:40:01 +0000 (14:40 +0000)]
Add Note

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

18 years agoTrim the home directory from the dejagnu test
Jim Laskey [Wed, 20 Sep 2006 09:20:22 +0000 (09:20 +0000)]
Trim the home directory from the dejagnu test

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

18 years agoitem done
Chris Lattner [Wed, 20 Sep 2006 06:41:56 +0000 (06:41 +0000)]
item done

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

18 years agoCompile:
Chris Lattner [Wed, 20 Sep 2006 06:41:35 +0000 (06:41 +0000)]
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

18 years agonew testcase
Chris Lattner [Wed, 20 Sep 2006 06:40:37 +0000 (06:40 +0000)]
new testcase

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

18 years agoadd a note
Chris Lattner [Wed, 20 Sep 2006 06:32:10 +0000 (06:32 +0000)]
add a note

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

18 years agoFold the full generality of (any_extend (truncate x))
Chris Lattner [Wed, 20 Sep 2006 06:29:17 +0000 (06:29 +0000)]
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

18 years agoTwo things:
Chris Lattner [Wed, 20 Sep 2006 06:19:26 +0000 (06:19 +0000)]
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

18 years agoThis is already done
Chris Lattner [Wed, 20 Sep 2006 04:59:33 +0000 (04:59 +0000)]
This is already done

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

18 years agoWe went through all that trouble to compute whether it was safe to transform
Chris Lattner [Wed, 20 Sep 2006 04:44:59 +0000 (04:44 +0000)]
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

18 years agoImprove PPC64 equality comparisons like PPC32 comparisons.
Chris Lattner [Wed, 20 Sep 2006 04:33:27 +0000 (04:33 +0000)]
Improve PPC64 equality comparisons like PPC32 comparisons.

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

18 years agoTwo improvements:
Chris Lattner [Wed, 20 Sep 2006 04:25:47 +0000 (04:25 +0000)]
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

18 years agoAdd a note that we should match rlwnm better
Chris Lattner [Wed, 20 Sep 2006 03:59:25 +0000 (03:59 +0000)]
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

18 years agoLegalize is no longer limited to cleverness with just constant shift amounts.
Chris Lattner [Wed, 20 Sep 2006 03:47:40 +0000 (03:47 +0000)]
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

18 years agoExpand 64-bit shifts more optimally if we know that the high bit of the
Chris Lattner [Wed, 20 Sep 2006 03:38:48 +0000 (03:38 +0000)]
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

18 years agoBack out Chris' last set of changes. This breaks 177.mesa and povray somehow.
Evan Cheng [Wed, 20 Sep 2006 01:39:40 +0000 (01:39 +0000)]
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

18 years ago80 col.
Evan Cheng [Wed, 20 Sep 2006 01:10:02 +0000 (01:10 +0000)]
80 col.

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

18 years agoAllow PatFrag to be a leaf node.
Evan Cheng [Tue, 19 Sep 2006 19:08:04 +0000 (19:08 +0000)]
Allow PatFrag to be a leaf node.

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

18 years agoAdd result of a Xform to isel queue.
Evan Cheng [Tue, 19 Sep 2006 18:40:15 +0000 (18:40 +0000)]
Add result of a Xform to isel queue.

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

18 years agoIf we have an add, do it in the pointer realm, not the int realm. This is critical...
Andrew Lenharth [Tue, 19 Sep 2006 18:24:51 +0000 (18:24 +0000)]
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

18 years agoInspired by the linux kernel, the more we keep adds in the pointer realm, the better...
Andrew Lenharth [Tue, 19 Sep 2006 18:23:39 +0000 (18:23 +0000)]
Inspired by the linux kernel, the more we keep adds in the pointer realm, the better pointer analysis works.

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

18 years agoFix UnitTests/2005-05-12-Int64ToFP.c with llc-beta. In particular, do not
Chris Lattner [Tue, 19 Sep 2006 18:02:01 +0000 (18:02 +0000)]
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

18 years agofix header
Rafael Espindola [Tue, 19 Sep 2006 16:41:40 +0000 (16:41 +0000)]
fix header
add comments
untabify

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

18 years agoImplement a MachineFunctionPass to fix the mul instruction
Rafael Espindola [Tue, 19 Sep 2006 15:49:25 +0000 (15:49 +0000)]
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

18 years agonumber test right
Chris Lattner [Tue, 19 Sep 2006 06:19:19 +0000 (06:19 +0000)]
number test right

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

18 years agoitem done
Chris Lattner [Tue, 19 Sep 2006 06:19:03 +0000 (06:19 +0000)]
item done

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

18 years agoimplement select.ll:test19-22
Chris Lattner [Tue, 19 Sep 2006 06:18:21 +0000 (06:18 +0000)]
implement select.ll:test19-22

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

18 years agomake this harder
Chris Lattner [Tue, 19 Sep 2006 06:17:55 +0000 (06:17 +0000)]
make this harder

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

18 years agonew testcases
Chris Lattner [Tue, 19 Sep 2006 06:16:46 +0000 (06:16 +0000)]
new testcases

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

18 years agoFold the PPCISD shifts when presented with 0 inputs. This occurs for code
Chris Lattner [Tue, 19 Sep 2006 05:22:59 +0000 (05:22 +0000)]
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

18 years agoFold extract_element(cst) to cst
Chris Lattner [Tue, 19 Sep 2006 05:02:39 +0000 (05:02 +0000)]
Fold extract_element(cst) to cst

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

18 years agoMinor speedup for legalize by avoiding some malloc traffic
Chris Lattner [Tue, 19 Sep 2006 04:51:23 +0000 (04:51 +0000)]
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

18 years agoIf multiple predicates are listed, they must all pass
Chris Lattner [Tue, 19 Sep 2006 00:41:36 +0000 (00:41 +0000)]
If multiple predicates are listed, they must all pass

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

18 years agoEnable dejagnu tests for predicate simplifier.
Nick Lewycky [Tue, 19 Sep 2006 00:31:54 +0000 (00:31 +0000)]
Enable dejagnu tests for predicate simplifier.

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

18 years agoFix a typo.
Evan Cheng [Mon, 18 Sep 2006 23:28:33 +0000 (23:28 +0000)]
Fix a typo.

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

18 years agoThere!
Chris Lattner [Mon, 18 Sep 2006 22:41:07 +0000 (22:41 +0000)]
There!

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

18 years agoFix Regression/TableGen/2006-09-18-LargeInt.td
Chris Lattner [Mon, 18 Sep 2006 22:28:27 +0000 (22:28 +0000)]
Fix Regression/TableGen/2006-09-18-LargeInt.td

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

18 years agonew testcase
Chris Lattner [Mon, 18 Sep 2006 22:28:07 +0000 (22:28 +0000)]
new testcase

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

18 years agoAllow i32 UDIV, SDIV, UREM, SREM to be expanded into libcalls.
Evan Cheng [Mon, 18 Sep 2006 21:49:04 +0000 (21:49 +0000)]
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

18 years agoWalk down the dominator tree instead of the control flow graph. That means
Nick Lewycky [Mon, 18 Sep 2006 21:09:35 +0000 (21:09 +0000)]
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

18 years agoFix findCaseDest to return null when BB is both the default dest and one
Nick Lewycky [Mon, 18 Sep 2006 20:44:37 +0000 (20:44 +0000)]
Fix findCaseDest to return null when BB is both the default dest and one
of the numeric cases.

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

18 years agoA pass to remove the worst of the replay trap offenders, and as a bonus, align basic...
Andrew Lenharth [Mon, 18 Sep 2006 19:44:29 +0000 (19:44 +0000)]
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

18 years agoAdd a new helper method to SwitchInst. Useful when you've got a BB from
Nick Lewycky [Mon, 18 Sep 2006 19:03:59 +0000 (19:03 +0000)]
Add a new helper method to SwitchInst. Useful when you've got a BB from
somewhere (like the dominator graph) and would like to know which case it
came from.

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

18 years agoFix an infinite loop building the CFE
Chris Lattner [Mon, 18 Sep 2006 18:27:05 +0000 (18:27 +0000)]
Fix an infinite loop building the CFE

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

18 years agonew testcase
Chris Lattner [Mon, 18 Sep 2006 18:07:51 +0000 (18:07 +0000)]
new testcase

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

18 years agoJump tables on Alpha
Andrew Lenharth [Mon, 18 Sep 2006 18:01:03 +0000 (18:01 +0000)]
Jump tables on Alpha

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

18 years agooops
Andrew Lenharth [Mon, 18 Sep 2006 18:00:18 +0000 (18:00 +0000)]
oops

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

18 years agoabsolute addresses must match pointer size
Andrew Lenharth [Mon, 18 Sep 2006 17:59:35 +0000 (17:59 +0000)]
absolute addresses must match pointer size

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

18 years agoSort out mangled names for globals
Jim Laskey [Mon, 18 Sep 2006 14:47:26 +0000 (14:47 +0000)]
Sort out mangled names for globals

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

18 years agoImplement a trivial optzn: of vastart is never called in a function that takes
Chris Lattner [Mon, 18 Sep 2006 07:02:31 +0000 (07:02 +0000)]
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

18 years agonew testcase
Chris Lattner [Mon, 18 Sep 2006 07:01:39 +0000 (07:01 +0000)]
new testcase

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

18 years agoadd a note. Our 64-bit shifts are ~30% slower than gcc's
Chris Lattner [Mon, 18 Sep 2006 05:36:54 +0000 (05:36 +0000)]
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

18 years agoImplement InstCombine/cast.ll:test31. This speeds up 462.libquantum by 26%.
Chris Lattner [Mon, 18 Sep 2006 05:27:43 +0000 (05:27 +0000)]
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

18 years agonew testcase
Chris Lattner [Mon, 18 Sep 2006 05:25:10 +0000 (05:25 +0000)]
new testcase

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

18 years agoAdd support for pattern matching cast operations
Chris Lattner [Mon, 18 Sep 2006 05:17:11 +0000 (05:17 +0000)]
Add support for pattern matching cast operations

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

18 years agofix typo
Chris Lattner [Mon, 18 Sep 2006 04:58:06 +0000 (04:58 +0000)]
fix typo

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

18 years agoadd a helper method
Chris Lattner [Mon, 18 Sep 2006 04:54:57 +0000 (04:54 +0000)]
add a helper method

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

18 years agoThis is closer to what we really want.
Chris Lattner [Mon, 18 Sep 2006 04:54:35 +0000 (04:54 +0000)]
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

18 years agoImplement Transforms/InstCombine/shift-sra.ll:test0
Chris Lattner [Mon, 18 Sep 2006 04:31:40 +0000 (04:31 +0000)]
Implement Transforms/InstCombine/shift-sra.ll:test0

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

18 years agoNew testcase, can be an srl instead of sra
Chris Lattner [Mon, 18 Sep 2006 04:31:18 +0000 (04:31 +0000)]
New testcase, can be an srl instead of sra

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

18 years agoRewrite shift/and/compare sequences to promote better licm of the RHS.
Chris Lattner [Mon, 18 Sep 2006 04:22:48 +0000 (04:22 +0000)]
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

18 years agoMake the LLVM Publications link point to /pubs/ since this has moved to
Reid Spencer [Sun, 17 Sep 2006 23:05:15 +0000 (23:05 +0000)]
Make the LLVM Publications link point to /pubs/ since this has moved to
its own page on the LLVM web site.

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

18 years agoAdded some eye-candy for Subtarget type checking
Anton Korobeynikov [Sun, 17 Sep 2006 20:25:45 +0000 (20:25 +0000)]
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

18 years agoAdd ShiftInst::isLogical/ArithmeticShift methods.
Chris Lattner [Sun, 17 Sep 2006 19:29:56 +0000 (19:29 +0000)]
Add ShiftInst::isLogical/ArithmeticShift methods.

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

18 years agoAdd new SetCondInst::isRelational/isEquality methods. Rename
Chris Lattner [Sun, 17 Sep 2006 19:14:47 +0000 (19:14 +0000)]
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

18 years agoExplain change with a comment.
Nick Lewycky [Sun, 17 Sep 2006 17:51:00 +0000 (17:51 +0000)]
Explain change with a comment.

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

18 years agoFix PR912. The input to erase() must not be a reference to the data
Nick Lewycky [Sun, 17 Sep 2006 16:23:36 +0000 (16:23 +0000)]
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

18 years agoSmall fixes for supporting dll* linkage types
Anton Korobeynikov [Sun, 17 Sep 2006 13:06:18 +0000 (13:06 +0000)]
Small fixes for supporting dll* linkage types

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

18 years agoadd a note noticed through source inspection
Chris Lattner [Sat, 16 Sep 2006 23:57:51 +0000 (23:57 +0000)]
add a note noticed through source inspection

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

18 years agoOh yeah, this is needed too
Chris Lattner [Sat, 16 Sep 2006 05:08:34 +0000 (05:08 +0000)]
Oh yeah, this is needed too

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

18 years agoadd a note
Chris Lattner [Sat, 16 Sep 2006 03:30:19 +0000 (03:30 +0000)]
add a note

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

18 years agoFix Transforms/InstCombine/2006-09-15-CastToBool.ll and PR913
Chris Lattner [Sat, 16 Sep 2006 03:14:10 +0000 (03:14 +0000)]
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

18 years agoTestcase for PR913
Chris Lattner [Sat, 16 Sep 2006 03:13:22 +0000 (03:13 +0000)]
Testcase for PR913

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

18 years agosimplify control flow, no functionality change
Chris Lattner [Sat, 16 Sep 2006 00:21:44 +0000 (00:21 +0000)]
simplify control flow, no functionality change

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

18 years agoAllow custom expand of mul
Chris Lattner [Sat, 16 Sep 2006 00:09:24 +0000 (00:09 +0000)]
Allow custom expand of mul

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

18 years agocomment out debug code
Chris Lattner [Fri, 15 Sep 2006 23:01:10 +0000 (23:01 +0000)]
comment out debug code

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

18 years agoAdd a new -cbe-bug mode, which works just like -run-llc, except that it uses
Chris Lattner [Fri, 15 Sep 2006 21:29:15 +0000 (21:29 +0000)]
Add a new -cbe-bug mode, which works just like -run-llc, except that it uses
LLC as the reference compiler to reduce testcases for bugs in GCC.

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