oota-llvm.git
18 years agoCodegen
Nate Begeman [Tue, 31 Jan 2006 08:17:29 +0000 (08:17 +0000)]
Codegen

bool %test(int %X) {
  %Y = seteq int %X, 13
  ret bool %Y
}

as

_test:
        addi r2, r3, -13
        cntlzw r2, r2
        srwi r3, r2, 5
        blr

rather than

_test:
        cmpwi cr7, r3, 13
        mfcr r2
        rlwinm r3, r2, 31, 31, 31
        blr

This has very little effect on most code, but speeds up analyzer 23% and
mason 11%

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

18 years agookay, one more
Chris Lattner [Tue, 31 Jan 2006 07:45:45 +0000 (07:45 +0000)]
okay, one more

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

18 years agoanother note
Chris Lattner [Tue, 31 Jan 2006 07:45:08 +0000 (07:45 +0000)]
another note

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

18 years agoMore notes
Chris Lattner [Tue, 31 Jan 2006 07:43:33 +0000 (07:43 +0000)]
More notes

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

18 years agoanother one
Chris Lattner [Tue, 31 Jan 2006 07:38:32 +0000 (07:38 +0000)]
another one

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

18 years agoadd a note
Chris Lattner [Tue, 31 Jan 2006 07:37:20 +0000 (07:37 +0000)]
add a note

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

18 years agoadd conditional moves of float and double values on int/fp condition codes.
Chris Lattner [Tue, 31 Jan 2006 07:26:55 +0000 (07:26 +0000)]
add conditional moves of float and double values on int/fp condition codes.

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

18 years agoexample nate pointed out
Chris Lattner [Tue, 31 Jan 2006 07:16:34 +0000 (07:16 +0000)]
example nate pointed out

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

18 years agotreat conditional branches the same way as conditional moves (giving them
Chris Lattner [Tue, 31 Jan 2006 06:56:30 +0000 (06:56 +0000)]
treat conditional branches the same way as conditional moves (giving them
an operand that contains the condcode), making things significantly simpler.

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

18 years agocompactify all of the integer conditional moves into one instruction that takes
Chris Lattner [Tue, 31 Jan 2006 06:49:09 +0000 (06:49 +0000)]
compactify all of the integer conditional moves into one instruction that takes
a CC as an operand.  Much smaller, much happier.

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

18 years agoAdd immediate forms of integer cmovs
Chris Lattner [Tue, 31 Jan 2006 06:24:29 +0000 (06:24 +0000)]
Add immediate forms of integer cmovs

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

18 years agoShrinkify
Chris Lattner [Tue, 31 Jan 2006 06:18:16 +0000 (06:18 +0000)]
Shrinkify

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

18 years agoimplement test/Regression/TableGen/DagIntSubst.ll
Chris Lattner [Tue, 31 Jan 2006 06:02:35 +0000 (06:02 +0000)]
implement test/Regression/TableGen/DagIntSubst.ll

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

18 years agonew testcase
Chris Lattner [Tue, 31 Jan 2006 06:01:40 +0000 (06:01 +0000)]
new testcase

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

18 years agoAdd the full complement of conditional moves of integer registers.
Chris Lattner [Tue, 31 Jan 2006 05:26:36 +0000 (05:26 +0000)]
Add the full complement of conditional moves of integer registers.

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

18 years agoCompile this:
Chris Lattner [Tue, 31 Jan 2006 05:05:52 +0000 (05:05 +0000)]
Compile this:

void %X(int %A) {
        %C = setlt int %A, 123          ; <bool> [#uses=1]
        br bool %C, label %T, label %F

T:              ; preds = %0
        call int %main( int 0 )         ; <int>:0 [#uses=0]
        ret void

F:              ; preds = %0
        ret void
}

to this:

X:
        save -96, %o6, %o6
        subcc %i0, 122, %l0
        bg .LBBX_2      ! F
        nop
...

not this:

X:
        save -96, %o6, %o6
        sethi 0, %l0
        or %g0, 1, %l1
        subcc %i0, 122, %l2
        bg .LBBX_4      !
        nop
.LBBX_3:        !
        or %g0, %l0, %l1
.LBBX_4:        !
        subcc %l1, 0, %l0
        bne .LBBX_2     ! F
        nop

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

18 years agoOnly insert an AND when converting from BR_COND to BRCC if needed.
Chris Lattner [Tue, 31 Jan 2006 05:04:52 +0000 (05:04 +0000)]
Only insert an AND when converting from BR_COND to BRCC if needed.

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

18 years agoAdded custom lowering of fabs
Evan Cheng [Tue, 31 Jan 2006 03:14:29 +0000 (03:14 +0000)]
Added custom lowering of fabs

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

18 years agoadd the 'lucas' optimization
Chris Lattner [Tue, 31 Jan 2006 02:55:28 +0000 (02:55 +0000)]
add the 'lucas' optimization

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

18 years agoI don't see why this optimization isn't safe, but it isn't, so disable it
Chris Lattner [Tue, 31 Jan 2006 02:45:52 +0000 (02:45 +0000)]
I don't see why this optimization isn't safe, but it isn't, so disable it

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

18 years agoAnother high-prio selection performance bug
Chris Lattner [Tue, 31 Jan 2006 02:10:06 +0000 (02:10 +0000)]
Another high-prio selection performance bug

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

18 years agoHandle physreg input/outputs. We now compile this:
Chris Lattner [Tue, 31 Jan 2006 02:03:41 +0000 (02:03 +0000)]
Handle physreg input/outputs.  We now compile this:

int %test_cpuid(int %op) {
        %B = alloca int
        %C = alloca int
        %D = alloca int
        %A = call int asm "cpuid", "=eax,==ebx,==ecx,==edx,eax"(int* %B, int* %C, int* %D, int %op)
        %Bv = load int* %B
        %Cv = load int* %C
        %Dv = load int* %D
        %x = add int %A, %Bv
        %y = add int %x, %Cv
        %z = add int %y, %Dv
        ret int %z
}

to this:

_test_cpuid:
        sub %ESP, 16
        mov DWORD PTR [%ESP], %EBX
        mov %EAX, DWORD PTR [%ESP + 20]
        cpuid
        mov DWORD PTR [%ESP + 8], %ECX
        mov DWORD PTR [%ESP + 12], %EBX
        mov DWORD PTR [%ESP + 4], %EDX
        mov %ECX, DWORD PTR [%ESP + 12]
        add %EAX, %ECX
        mov %ECX, DWORD PTR [%ESP + 8]
        add %EAX, %ECX
        mov %ECX, DWORD PTR [%ESP + 4]
        add %EAX, %ECX
        mov %EBX, DWORD PTR [%ESP]
        add %ESP, 16
        ret

... note the proper register allocation.  :)

it is unclear to me why the loads aren't folded into the adds.

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

18 years agomore mumbling
Chris Lattner [Tue, 31 Jan 2006 00:45:37 +0000 (00:45 +0000)]
more mumbling

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

18 years agoadd some notes
Chris Lattner [Tue, 31 Jan 2006 00:20:38 +0000 (00:20 +0000)]
add some notes

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

18 years agoDon't generate complex sequence for SETOLE, SETOLT, SETULT, and SETUGT. Flip
Evan Cheng [Mon, 30 Jan 2006 23:41:35 +0000 (23:41 +0000)]
Don't generate complex sequence for SETOLE, SETOLT, SETULT, and SETUGT. Flip
the order of the compare operands and generate SETOGT, SETOGE, SETUGE, and
SETULE instead.

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

18 years agoDon't generate (or setp, setae) for SETUGE. Simply flip the operands around and
Evan Cheng [Mon, 30 Jan 2006 23:39:40 +0000 (23:39 +0000)]
Don't generate (or setp, setae) for SETUGE. Simply flip the operands around and
generate SETULT instead.

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

18 years agoPrint the most trivial inline asms.
Chris Lattner [Mon, 30 Jan 2006 23:00:08 +0000 (23:00 +0000)]
Print the most trivial inline asms.

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

18 years agoFix a bug in my legalizer reworking that caused the X86 backend to not get
Chris Lattner [Mon, 30 Jan 2006 22:43:50 +0000 (22:43 +0000)]
Fix a bug in my legalizer reworking that caused the X86 backend to not get
a chance to custom legalize setcc, which broke a bunch of C++ Codes.
Testcase here: CodeGen/X86/2006-01-30-LongSetcc.ll

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

18 years agonew testcase for the 'C++' failures last night.
Chris Lattner [Mon, 30 Jan 2006 22:43:10 +0000 (22:43 +0000)]
new testcase for the 'C++' failures last night.

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

18 years agoFix FP constants, and the SparcV8/2006-01-22-BitConvertLegalize.ll failure from last...
Chris Lattner [Mon, 30 Jan 2006 22:20:49 +0000 (22:20 +0000)]
Fix FP constants, and the SparcV8/2006-01-22-BitConvertLegalize.ll failure from last night

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

18 years agoi64 -> f32, f32 -> i64 and some clean up.
Evan Cheng [Mon, 30 Jan 2006 22:13:22 +0000 (22:13 +0000)]
i64 -> f32, f32 -> i64 and some clean up.

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

18 years agoAlways use FP stack instructions to perform i64 to f64 as well as f64 to i64
Evan Cheng [Mon, 30 Jan 2006 08:02:57 +0000 (08:02 +0000)]
Always use FP stack instructions to perform i64 to f64 as well as f64 to i64
conversions. SSE does not have instructions to handle these tasks.

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

18 years agoOne more getTargetNode() variant shouldn't hurt...
Evan Cheng [Mon, 30 Jan 2006 07:47:47 +0000 (07:47 +0000)]
One more getTargetNode() variant shouldn't hurt...

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

18 years agoRevamp the ICC/FCC reading instructions to be parameterized in terms of the
Chris Lattner [Mon, 30 Jan 2006 07:43:04 +0000 (07:43 +0000)]
Revamp the ICC/FCC reading instructions to be parameterized in terms of the
SPARC condition codes, not in terms of the DAG condcodes.  This allows us to
write nice clean patterns for cmovs/branches.

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

18 years agoCompile:
Chris Lattner [Mon, 30 Jan 2006 06:14:02 +0000 (06:14 +0000)]
Compile:

uint %test(uint %X) {
        %Y = call uint %llvm.ctpop.i32(uint %X)
        ret uint %Y
}

to:

test:
        save -96, %o6, %o6
        sll %i0, 0, %l0
        popc %l0, %i0
        restore %g0, %g0, %g0
        retl
        nop

instead of to 40 logical ops.  Note the shift-by-zero that clears the top
part of the 64-bit V9 register.

Testcase here: CodeGen/SparcV8/ctpop.ll

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

18 years agonew testcase
Chris Lattner [Mon, 30 Jan 2006 06:11:36 +0000 (06:11 +0000)]
new testcase

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

18 years agoClear the OpAction field before setting it. This allows a target to set
Chris Lattner [Mon, 30 Jan 2006 06:09:03 +0000 (06:09 +0000)]
Clear the OpAction field before setting it.  This allows a target to set
an instruction operation action to Expand, then set it to Legal later.

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

18 years agoIf the target has V9 instructions, this pass is a noop, don't bother
Chris Lattner [Mon, 30 Jan 2006 05:51:14 +0000 (05:51 +0000)]
If the target has V9 instructions, this pass is a noop, don't bother
running it.

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

18 years agoWhen in v9 mode, emit fabsd/fnegd/fmovd
Chris Lattner [Mon, 30 Jan 2006 05:48:37 +0000 (05:48 +0000)]
When in v9 mode, emit fabsd/fnegd/fmovd

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

18 years agoFirst step towards V9 instructions in the V8 backend, two conditional move
Chris Lattner [Mon, 30 Jan 2006 05:35:57 +0000 (05:35 +0000)]
First step towards V9 instructions in the V8 backend, two conditional move
patterns.  This allows emission of this code:

t1:
        save -96, %o6, %o6
        subcc %i0, %i1, %l0
        move %icc, %i0, %i2
        or %g0, %i2, %i0
        restore %g0, %g0, %g0
        retl
        nop

instead of this:

t1:
        save -96, %o6, %o6
        subcc %i0, %i1, %l0
        be .LBBt1_2     !
        nop
.LBBt1_1:       !
        or %g0, %i2, %i0
.LBBt1_2:       !
        restore %g0, %g0, %g0
        retl
        nop

for this:

int %t1(int %a, int %b, int %c) {
        %tmp.2 = seteq int %a, %b
        %tmp3 = select bool %tmp.2, int %a, int %c
        ret int %tmp3
}

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

18 years agoTwo changes:
Chris Lattner [Mon, 30 Jan 2006 04:57:43 +0000 (04:57 +0000)]
Two changes:
1. Default to having V9 instructions, instead of just V8.
2. unless -enable-sparc-v9-insts is passed, disable V9 (for use with llcbeta)

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

18 years agoWhen lowering SELECT_CC, see if the input is a lowered SETCC. If so, fold
Chris Lattner [Mon, 30 Jan 2006 04:34:44 +0000 (04:34 +0000)]
When lowering SELECT_CC, see if the input is a lowered SETCC.  If so, fold
the two operations together.  This allows us to compile this:

void %two(int %a, int* %b) {
        %tmp.2 = seteq int %a, 0
        %tmp.0.0 = select bool %tmp.2, int 10, int 20
        store int %tmp.0.0, int* %b
        ret void
}

into:

two:
        save -96, %o6, %o6
        or %g0, 20, %l0
        or %g0, 10, %l1
        subcc %i0, 0, %l2
        be .LBBtwo_2    ! entry
        nop
.LBBtwo_1:      ! entry
        or %g0, %l0, %l1
.LBBtwo_2:      ! entry
        st %l1, [%i1]
        restore %g0, %g0, %g0
        retl
        nop

instead of:

two:
        save -96, %o6, %o6
        sethi 0, %l0
        or %g0, 1, %l1
        or %g0, 20, %l2
        or %g0, 10, %l3
        subcc %i0, 0, %l4
        be .LBBtwo_2    ! entry
        nop
.LBBtwo_1:      ! entry
        or %g0, %l0, %l1
.LBBtwo_2:      ! entry
        subcc %l1, 0, %l0
        bne .LBBtwo_4   ! entry
        nop
.LBBtwo_3:      ! entry
        or %g0, %l2, %l3
.LBBtwo_4:      ! entry
        st %l3, [%i1]
        restore %g0, %g0, %g0
        retl
        nop

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

18 years agoAdd AddSymbol() method to DynamicLibrary to work around Windows limitation
Jeff Cohen [Mon, 30 Jan 2006 04:33:51 +0000 (04:33 +0000)]
Add AddSymbol() method to DynamicLibrary to work around Windows limitation
of being unable to search for symbols in an EXE.  It will also allow other
existing hacks to be improved.

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

18 years agodon't insert an and node if it isn't needed here, this can prevent folding
Chris Lattner [Mon, 30 Jan 2006 04:22:28 +0000 (04:22 +0000)]
don't insert an and node if it isn't needed here, this can prevent folding
of lowered target nodes.

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

18 years agoMove MaskedValueIsZero from the DAGCombiner to the TargetLowering interface,making...
Chris Lattner [Mon, 30 Jan 2006 04:09:27 +0000 (04:09 +0000)]
Move MaskedValueIsZero from the DAGCombiner to the TargetLowering interface,making isMaskedValueZeroForTargetNode simpler, and useable from other partsof the compiler.

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

18 years agoMove MaskedValueIsZero from the DAGCombiner to the TargetLowering interface,
Chris Lattner [Mon, 30 Jan 2006 04:08:18 +0000 (04:08 +0000)]
Move MaskedValueIsZero from the DAGCombiner to the TargetLowering interface,
making isMaskedValueZeroForTargetNode simpler, and useable from other parts
of the compiler.

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

18 years agoAdd _CRT_SECURE_NO_DEPRECATE preprocessor symbol to make VS2005 happy.
Jeff Cohen [Mon, 30 Jan 2006 04:07:08 +0000 (04:07 +0000)]
Add _CRT_SECURE_NO_DEPRECATE preprocessor symbol to make VS2005 happy.

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

18 years agoImplement isMaskedValueZeroForTargetNode for the various v8 selectcc nodes,
Chris Lattner [Mon, 30 Jan 2006 03:51:45 +0000 (03:51 +0000)]
Implement isMaskedValueZeroForTargetNode for the various v8 selectcc nodes,
allowing redundant and's to be eliminated by the dag combiner.

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

18 years agopass the address of MaskedValueIsZero into isMaskedValueZeroForTargetNode,
Chris Lattner [Mon, 30 Jan 2006 03:49:37 +0000 (03:49 +0000)]
pass the address of MaskedValueIsZero into isMaskedValueZeroForTargetNode,
to permit recursion

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

18 years agoadjust prototype
Chris Lattner [Mon, 30 Jan 2006 03:49:07 +0000 (03:49 +0000)]
adjust prototype

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

18 years agoPass the address of the main MaskedValueIsZero function to allow recursion.
Chris Lattner [Mon, 30 Jan 2006 03:48:36 +0000 (03:48 +0000)]
Pass the address of the main MaskedValueIsZero function to allow recursion.

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

18 years agofix make install/uninstall of libcrtend.
Chris Lattner [Mon, 30 Jan 2006 02:03:56 +0000 (02:03 +0000)]
fix make install/uninstall of libcrtend.

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

18 years agoFix indentation.
Jeff Cohen [Sun, 29 Jan 2006 22:02:52 +0000 (22:02 +0000)]
Fix indentation.

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

18 years agoFix RET of promoted values on targets that custom expand RET to a target node.
Chris Lattner [Sun, 29 Jan 2006 21:02:23 +0000 (21:02 +0000)]
Fix RET of promoted values on targets that custom expand RET to a target node.

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

18 years agoFunctions that are lazily streamed in from the .bc file are *not* external.
Chris Lattner [Sun, 29 Jan 2006 20:49:17 +0000 (20:49 +0000)]
Functions that are lazily streamed in from the .bc file are *not* external.
This fixes llvm-test/SingleSource/UnitTests/2006-01-29-SimpleIndirectCall.c
and PR704

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

18 years agosimplify some code
Chris Lattner [Sun, 29 Jan 2006 20:01:35 +0000 (20:01 +0000)]
simplify some code

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

18 years agoRemove extra qualifier.
Jim Laskey [Sun, 29 Jan 2006 09:52:11 +0000 (09:52 +0000)]
Remove extra qualifier.

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

18 years agoadd another note
Chris Lattner [Sun, 29 Jan 2006 09:46:06 +0000 (09:46 +0000)]
add another note

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

18 years agoadd some performance notes from looking at sgefa
Chris Lattner [Sun, 29 Jan 2006 09:42:20 +0000 (09:42 +0000)]
add some performance notes from looking at sgefa

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

18 years agoadd a high-priority SSE issue from sgefa
Chris Lattner [Sun, 29 Jan 2006 09:14:47 +0000 (09:14 +0000)]
add a high-priority SSE issue from sgefa

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

18 years agoadd a missed optimization
Chris Lattner [Sun, 29 Jan 2006 09:08:15 +0000 (09:08 +0000)]
add a missed optimization

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

18 years agocleanups to the ValueTypeActions interface
Chris Lattner [Sun, 29 Jan 2006 08:42:06 +0000 (08:42 +0000)]
cleanups to the ValueTypeActions interface

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

18 years agoNow that OpActions is big enough, we can specify actions for vector types
Chris Lattner [Sun, 29 Jan 2006 08:41:37 +0000 (08:41 +0000)]
Now that OpActions is big enough, we can specify actions for vector types

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

18 years agoclean up interface to ValueTypeActions
Chris Lattner [Sun, 29 Jan 2006 08:41:12 +0000 (08:41 +0000)]
clean up interface to ValueTypeActions

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

18 years agoClean up the interface to ValueTypeActions, allowing Legalize to use a copy
Chris Lattner [Sun, 29 Jan 2006 08:40:37 +0000 (08:40 +0000)]
Clean up the interface to ValueTypeActions, allowing Legalize to use a copy
of it more cleanly.  Double the size of OpActions, allowing it to hold actions
for any VT.

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

18 years agorevert an accidental commit
Chris Lattner [Sun, 29 Jan 2006 07:59:37 +0000 (07:59 +0000)]
revert an accidental commit

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

18 years agoRemove some special case hacks for CALLSEQ_*, using UpdateNodeOperands
Chris Lattner [Sun, 29 Jan 2006 07:58:15 +0000 (07:58 +0000)]
Remove some special case hacks for CALLSEQ_*, using UpdateNodeOperands
instead.

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

18 years agoremove some methods
Chris Lattner [Sun, 29 Jan 2006 07:57:11 +0000 (07:57 +0000)]
remove some methods

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

18 years agodisable this for now
Chris Lattner [Sun, 29 Jan 2006 07:31:33 +0000 (07:31 +0000)]
disable this for now

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

18 years agoAdd a note about lowering llvm.memset, llvm.memcpy, and llvm.memmove to a
Reid Spencer [Sun, 29 Jan 2006 06:48:25 +0000 (06:48 +0000)]
Add a note about lowering llvm.memset, llvm.memcpy, and llvm.memmove to a
few stores under certain conditions.

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

18 years agoremove now-dead code, the legalizer takes care of this for us
Chris Lattner [Sun, 29 Jan 2006 06:45:31 +0000 (06:45 +0000)]
remove now-dead code, the legalizer takes care of this for us

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

18 years agoThe FP stack doesn't support UNDEF, ask the legalizer to legalize it
Chris Lattner [Sun, 29 Jan 2006 06:44:22 +0000 (06:44 +0000)]
The FP stack doesn't support UNDEF, ask the legalizer to legalize it
instead of lying and saying we have it.

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

18 years agoAllow custom expansion of ConstantVec nodes. PPC will use this in the future.
Chris Lattner [Sun, 29 Jan 2006 06:34:16 +0000 (06:34 +0000)]
Allow custom expansion of ConstantVec nodes.  PPC will use this in the future.

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

18 years agoRequest expansion of ConstantVec nodes.
Chris Lattner [Sun, 29 Jan 2006 06:32:58 +0000 (06:32 +0000)]
Request expansion of ConstantVec nodes.

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

18 years agoLegalize ConstantFP into TargetConstantFP when the target allows. Implement
Chris Lattner [Sun, 29 Jan 2006 06:26:56 +0000 (06:26 +0000)]
Legalize ConstantFP into TargetConstantFP when the target allows.  Implement
custom expansion of ConstantFP nodes.

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

18 years agoTargets all now request ConstantFP to be legalized into TargetConstantFP.
Chris Lattner [Sun, 29 Jan 2006 06:26:08 +0000 (06:26 +0000)]
Targets all now request ConstantFP to be legalized into TargetConstantFP.
'fpimm' in .td files is now TargetConstantFP.

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

18 years agoUpdate alpha to reflect recent constantfp legalize changes. It's not clear
Chris Lattner [Sun, 29 Jan 2006 06:25:22 +0000 (06:25 +0000)]
Update alpha to reflect recent constantfp legalize changes.  It's not clear
why all this code isn't autogenerated. :(

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

18 years agoMake ConstantFP legalize into TargetConstantFP like other leaf nodes do. Allow
Chris Lattner [Sun, 29 Jan 2006 06:24:40 +0000 (06:24 +0000)]
Make ConstantFP legalize into TargetConstantFP like other leaf nodes do.  Allow
targets to register custom legalizers for ConstantFP in case there isn't a
fixed list of constants that can be generated.  On some architectures (ia64?)
all fp immediates are legal.

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

18 years agoremove the getBR2Way_CC method
Chris Lattner [Sun, 29 Jan 2006 06:01:13 +0000 (06:01 +0000)]
remove the getBR2Way_CC method

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

18 years agoeliminate uses of SelectionDAG::getBR2Way_CC
Chris Lattner [Sun, 29 Jan 2006 06:00:45 +0000 (06:00 +0000)]
eliminate uses of SelectionDAG::getBR2Way_CC

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

18 years agoit is nice not to chop off bits for those blessed with lots of bits
Andrew Lenharth [Sun, 29 Jan 2006 05:22:37 +0000 (05:22 +0000)]
it is nice not to chop off bits for those blessed with lots of bits

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

18 years agomake the casts actually cast to the variable type
Andrew Lenharth [Sun, 29 Jan 2006 05:17:22 +0000 (05:17 +0000)]
make the casts actually cast to the variable type

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

18 years agostart of the 64bit safety cleanup
Andrew Lenharth [Sun, 29 Jan 2006 05:07:04 +0000 (05:07 +0000)]
start of the 64bit safety cleanup

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

18 years agoEmit series of conditionals with &&, emitting stuff like this:
Chris Lattner [Sun, 29 Jan 2006 04:41:05 +0000 (04:41 +0000)]
Emit series of conditionals with &&, emitting stuff like this:

    if (N1.getOpcode() == ISD::LOAD &&
        N1.hasOneUse() &&
        !CodeGenMap.count(N1.getValue(0)) &&
        !CodeGenMap.count(N1.getValue(1))) {

instead of this:

    if (N1.getOpcode() == ISD::LOAD) {
      if (N1.hasOneUse()) {
        if (!CodeGenMap.count(N1.getValue(0))) {
          if (!CodeGenMap.count(N1.getValue(1))) {

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

18 years agoFactor matching code that is common between patterns. This works around
Chris Lattner [Sun, 29 Jan 2006 04:25:26 +0000 (04:25 +0000)]
Factor matching code that is common between patterns.  This works around
GCC not jump-threading across this common code, and produces far nicer
output.

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

18 years agocmovle != cmovlt
Chris Lattner [Sun, 29 Jan 2006 03:47:30 +0000 (03:47 +0000)]
cmovle != cmovlt

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

18 years agoFix typo.
Jeff Cohen [Sun, 29 Jan 2006 03:45:35 +0000 (03:45 +0000)]
Fix typo.

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

18 years agoSplit out code generation from analysis from emission
Chris Lattner [Sun, 29 Jan 2006 02:57:39 +0000 (02:57 +0000)]
Split out code generation from analysis from emission

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

18 years agomove some code around, no change in the generated code
Chris Lattner [Sun, 29 Jan 2006 02:43:35 +0000 (02:43 +0000)]
move some code around, no change in the generated code

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

18 years agonow that we have control over emission of the code, emit the code using nested
Chris Lattner [Sat, 28 Jan 2006 20:43:52 +0000 (20:43 +0000)]
now that we have control over emission of the code, emit the code using nested
"if" statements (indenting it appropriately, of course) instead of using goto's.

This inverts the logic for all of the if statements, which makes things simpler
to understand in addition to making the generated code easier to read.

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

18 years agoChange PatternCodeEmitter to emit code into a buffer instead of emitting it
Chris Lattner [Sat, 28 Jan 2006 20:31:24 +0000 (20:31 +0000)]
Change PatternCodeEmitter to emit code into a buffer instead of emitting it
directly to the output file.  This makes things simple because the code doesn't
have to worry about indentation or the case when there is no goto.  It also
allows us to indent the code better without touching everything :)

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

18 years agoFlesh out AMD family/models.
Jeff Cohen [Sat, 28 Jan 2006 20:30:18 +0000 (20:30 +0000)]
Flesh out AMD family/models.

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

18 years agoCorrectly determine CPU vendor.
Jeff Cohen [Sat, 28 Jan 2006 19:48:34 +0000 (19:48 +0000)]
Correctly determine CPU vendor.

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

18 years agoMake long warnings wrap and have less indent so other portions of the page
Reid Spencer [Sat, 28 Jan 2006 19:44:48 +0000 (19:44 +0000)]
Make long warnings wrap and have less indent so other portions of the page
are not skewed out of view.

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

18 years agoFit to 80 columns, no functionality change
Chris Lattner [Sat, 28 Jan 2006 19:06:51 +0000 (19:06 +0000)]
Fit to 80 columns, no functionality change

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

18 years agoUse union instead of reinterpret_cast.
Jeff Cohen [Sat, 28 Jan 2006 18:47:32 +0000 (18:47 +0000)]
Use union instead of reinterpret_cast.

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

18 years agoFix recognition of Intel CPUs.
Jeff Cohen [Sat, 28 Jan 2006 18:38:20 +0000 (18:38 +0000)]
Fix recognition of Intel CPUs.

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

18 years agoIs64Bit reflects the capability of the chip, not an aspect of the target os
Chris Lattner [Sat, 28 Jan 2006 18:23:48 +0000 (18:23 +0000)]
Is64Bit reflects the capability of the chip, not an aspect of the target os

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

18 years agoFix a bunch of JIT failures with the new isel
Chris Lattner [Sat, 28 Jan 2006 18:19:37 +0000 (18:19 +0000)]
Fix a bunch of JIT failures with the new isel

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

18 years agoImprove X86 subtarget support for Windows and AMD.
Jeff Cohen [Sat, 28 Jan 2006 18:09:06 +0000 (18:09 +0000)]
Improve X86 subtarget support for Windows and AMD.

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