Commit Graph

15497 Commits

Author SHA1 Message Date
Chris Lattner
6970eda7ca Random acts of shrinkage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30812 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 19:49:05 +00:00
Chris Lattner
a7ebe556c8 Convert pand/por/pxor to use multiclass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30811 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 19:37:30 +00:00
Chris Lattner
70f4f2e513 Convert some more instructions over to use a new multiclass.
Fix a bug where the asmstring for PSUBQrm was wrong.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30810 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 19:34:33 +00:00
Chris Lattner
5650eeb38e Fix a bug where PADDQrm printed paddd instead of paddq.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30809 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 19:15:46 +00:00
Chris Lattner
7c47f9a7ea Add multiclass for SSE2 instructions that correspond to simple binops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30808 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 19:14:49 +00:00
Chris Lattner
45e123c62a rename:
PDI_binop_rm -> PDI_binop_rm_int
  PDI_binop_rmi -> PDI_binop_rmi_int

to make it clear that these are for use with intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30807 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 19:02:31 +00:00
Chris Lattner
d4060cc989 Convert saturating PADD/PSUB's to use a multiclass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30806 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 18:48:46 +00:00
Chris Lattner
8139e28a79 Convert PAVG*, PMADDWD, and PMUL* to use multiclasses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30805 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 18:39:00 +00:00
Chris Lattner
3dca490ff0 Fix typo in packsswb instr definition, where the load had the wrong type.
This allows us to use the multiclass for other packs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30804 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 18:23:58 +00:00
Rafael Espindola
e5bbd6d753 implement FUITOS and FUITOD
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30803 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 14:24:52 +00:00
Rafael Espindola
5aca927ae6 implement FLDD
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30802 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 14:03:39 +00:00
Rafael Espindola
d9ae778125 implement fadds, faddd, fmuls and fmuld
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30801 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 13:46:42 +00:00
Chris Lattner
783d45ef14 handle pmin/pmax with multiclasses
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30800 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 07:49:33 +00:00
Chris Lattner
7733799464 simplify pack and shift intrinsics with multiclasses
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30797 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 07:06:17 +00:00
Chris Lattner
01998742c3 Use a multiclass to simplify 'SSE2 Integer comparison'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30796 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 06:47:08 +00:00
Chris Lattner
736c020fc8 move class defns close to uses to make it easier to read
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30795 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 06:33:36 +00:00
Chris Lattner
fb996ee727 simplify horizontal op definitions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30794 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 06:31:41 +00:00
Chris Lattner
3b57a833a5 remove more unneeded type info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30793 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 06:27:03 +00:00
Chris Lattner
aab370db24 remove unneeded definitions and type info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30792 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 06:19:41 +00:00
Chris Lattner
15258d5f9d remove some unneeded type info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30791 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 06:17:43 +00:00
Chris Lattner
845fb75536 simplify patterns by merging in operand info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30790 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 05:50:25 +00:00
Chris Lattner
d1b651d5de Factor operands into packed unary classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30789 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 05:47:20 +00:00
Chris Lattner
dc5aa21b10 remove dead/duplicate instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30788 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 05:41:52 +00:00
Chris Lattner
a0ea63db75 Pull operand info up into parent class for scalar sse intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30787 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 05:26:13 +00:00
Chris Lattner
86c1b3a2fd convert the sole sd unary intrinsic to a multiclass for consistency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30786 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 05:19:31 +00:00
Chris Lattner
3b8378552e pull operand string into the multiclass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30785 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 05:13:26 +00:00
Chris Lattner
9498ed8ac9 Remove RSQRTSS[rm] RCPSS[rm], which are dead.
Introduce SS_IntUnary, a multiclass to replace SS_Int[rm].


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30784 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 05:09:48 +00:00
Chris Lattner
4cc84edd3b eliminate redundancy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30783 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 04:52:09 +00:00
Chris Lattner
ed83a7019b Fix a bug legalizing zero-extending i64 loads into 32-bit loads. The bottom
part was always forced to be sextload, even when we needed an zextload.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30782 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 00:58:36 +00:00
Chris Lattner
0c79fed5f9 Set the jt section
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30781 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-06 22:52:33 +00:00
Chris Lattner
cf9668f23d initialize ivar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30780 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-06 22:52:08 +00:00
Chris Lattner
0336fdba85 If a target uses a GOT, put it in the jt data section, not the text
section.  This will fix alpha when Andrew implements
AlphaTargetMachine::getTargetLowering().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30779 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-06 22:50:56 +00:00
Chris Lattner
111c2fa2a0 Alpha uses a got
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30778 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-06 22:46:51 +00:00
Chris Lattner
e0cfc8b2f2 jump tables handle pic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30776 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-06 22:32:29 +00:00
Chris Lattner
db3ea6754b print labels even if a MBB doesn't have a corresponding LLVM BB, just don't
print the LLVM BB label.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30775 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-06 21:28:17 +00:00
Rafael Espindola
935b1f8fce add optional input flag to FMRRD
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30774 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-06 20:33:26 +00:00
Rafael Espindola
614057b843 add support for calling functions that return double
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30771 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-06 19:10:05 +00:00
Evan Cheng
3cff9f8947 80 col violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30770 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-06 18:57:51 +00:00
Chris Lattner
6e1f1fdd35 ugly codegen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30769 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-06 17:39:34 +00:00
Chris Lattner
4bdd2753db Fix a miscompilation of:
long long foo(long long X) {
  return (long long)(signed char)(int)X;
}

Instead of:

_foo:
        extsb r2, r4
        srawi r3, r4, 31
        mr r4, r2
        blr

we now produce:

_foo:
        extsb r4, r4
        srawi r3, r4, 31
        blr

This fixes a miscompilation in ConstantFolding.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30768 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-06 17:34:12 +00:00
Rafael Espindola
af1dabef35 fix some bugs affecting functions with no arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30767 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-06 17:26:30 +00:00
Rafael Espindola
1b5076887e fix the stack alignment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30766 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-06 14:29:47 +00:00
Rafael Espindola
4a408d46d4 add support for calling functions that have double arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30765 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-06 12:50:22 +00:00
Evan Cheng
a26eb5e1a7 Still need to support -mcpu=<> or cross compilation will fail. Doh.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30764 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-06 09:17:41 +00:00
Evan Cheng
abc346ceda Do away with CPU feature list. Just use CPUID to detect MMX, SSE, SSE2, SSE3, and 64-bit support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30763 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-06 08:21:07 +00:00
Evan Cheng
88c1578011 It appears the inline asm in GetCpuIDAndInfo() may clobbers some registers if it isn't inlined (at < -O3). Force it to be inlined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30762 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-06 07:50:56 +00:00
Chris Lattner
5504602836 MachineBasicBlock::splice was incorrectly updating parent pointers on
instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30760 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-06 01:12:44 +00:00
Evan Cheng
786225adf0 Make use of getStore().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30759 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 23:01:46 +00:00
Evan Cheng
ad071e1cd1 Add getStore() helper function to create ISD::STORE nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30758 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 22:57:11 +00:00
Chris Lattner
9c78ecb511 Don't crash if an MBB doesn't have an LLVM BB
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30757 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 21:40:14 +00:00
Rafael Espindola
39b5a21259 use a const ref for passing the vector to ArgumentLayout
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30756 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 17:46:48 +00:00
Rafael Espindola
a284584352 implement a ArgumentLayout class to factor code common to LowerFORMAL_ARGUMENTS and LowerCALL
implement FMDRR
add support for f64 function arguments


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30754 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 16:48:49 +00:00
Jim Laskey
bc588b8bbf Alias analysis code clean ups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30753 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 15:07:25 +00:00
Chris Lattner
867b99f845 add a new SimplifyDemandedVectorElts method, which works similarly to
SimplifyDemandedBits.  The idea is that some operations can be simplified if
not all of the computed elements are needed.  Some targets (like x86) have a
large number of intrinsics that operate on a single element, but pass other
elts through unmodified.  If those other elements are not needed, the
intrinsics can be simplified to scalar operations, and insertelement ops can
be removed.

This turns (f.e.):

ushort %Convert_sse(float %f) {
        %tmp = insertelement <4 x float> undef, float %f, uint 0                ; <<4 x float>> [#uses=1]
        %tmp10 = insertelement <4 x float> %tmp, float 0.000000e+00, uint 1             ; <<4 x float>> [#uses=1]
        %tmp11 = insertelement <4 x float> %tmp10, float 0.000000e+00, uint 2           ; <<4 x float>> [#uses=1]
        %tmp12 = insertelement <4 x float> %tmp11, float 0.000000e+00, uint 3           ; <<4 x float>> [#uses=1]
        %tmp28 = tail call <4 x float> %llvm.x86.sse.sub.ss( <4 x float> %tmp12, <4 x float> < float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00 > )               ; <<4 x float>> [#uses=1]
        %tmp37 = tail call <4 x float> %llvm.x86.sse.mul.ss( <4 x float> %tmp28, <4 x float> < float 5.000000e-01, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00 > )               ; <<4 x float>> [#uses=1]
        %tmp48 = tail call <4 x float> %llvm.x86.sse.min.ss( <4 x float> %tmp37, <4 x float> < float 6.553500e+04, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00 > )               ; <<4 x float>> [#uses=1]
        %tmp59 = tail call <4 x float> %llvm.x86.sse.max.ss( <4 x float> %tmp48, <4 x float> zeroinitializer )          ; <<4 x float>> [#uses=1]
        %tmp = tail call int %llvm.x86.sse.cvttss2si( <4 x float> %tmp59 )              ; <int> [#uses=1]
        %tmp69 = cast int %tmp to ushort                ; <ushort> [#uses=1]
        ret ushort %tmp69
}

into:

ushort %Convert_sse(float %f) {
entry:
        %tmp28 = sub float %f, 1.000000e+00             ; <float> [#uses=1]
        %tmp37 = mul float %tmp28, 5.000000e-01         ; <float> [#uses=1]
        %tmp375 = insertelement <4 x float> undef, float %tmp37, uint 0         ; <<4 x float>> [#uses=1]
        %tmp48 = tail call <4 x float> %llvm.x86.sse.min.ss( <4 x float> %tmp375, <4 x float> < float 6.553500e+04, float undef, float undef, float undef > )           ; <<4 x float>> [#uses=1]
        %tmp59 = tail call <4 x float> %llvm.x86.sse.max.ss( <4 x float> %tmp48, <4 x float> < float 0.000000e+00, float undef, float undef, float undef > )            ; <<4 x float>> [#uses=1]
        %tmp = tail call int %llvm.x86.sse.cvttss2si( <4 x float> %tmp59 )              ; <int> [#uses=1]
        %tmp69 = cast int %tmp to ushort                ; <ushort> [#uses=1]
        ret ushort %tmp69
}

which improves codegen from:

_Convert_sse:
        movss LCPI1_0, %xmm0
        movss 4(%esp), %xmm1
        subss %xmm0, %xmm1
        movss LCPI1_1, %xmm0
        mulss %xmm0, %xmm1
        movss LCPI1_2, %xmm0
        minss %xmm0, %xmm1
        xorps %xmm0, %xmm0
        maxss %xmm0, %xmm1
        cvttss2si %xmm1, %eax
        andl $65535, %eax
        ret

to:

_Convert_sse:
        movss 4(%esp), %xmm0
        subss LCPI1_0, %xmm0
        mulss LCPI1_1, %xmm0
        movss LCPI1_2, %xmm1
        minss %xmm1, %xmm0
        xorps %xmm1, %xmm1
        maxss %xmm1, %xmm0
        cvttss2si %xmm0, %eax
        andl $65535, %eax
        ret


This is just a first step, it can be extended in many ways.  Testcase here:
Transforms/InstCombine/vec_demanded_elts.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30752 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 06:55:50 +00:00
Chris Lattner
06a248c238 Add insertelement/extractelement helper ctors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30750 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 06:24:58 +00:00
Chris Lattner
1907a7b37b Lower some min/max idioms to minss/maxss when unsafe fp math is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30748 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 04:11:26 +00:00
Chris Lattner
a66ba5f70b Don't bother setting JumpTableTextSection, it is about to disappear
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30745 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 03:13:59 +00:00
Chris Lattner
e08d6e915e Emit pic jumptables to the same section that the function is emitted to,
allowing label differences to work.  This fixes CodeGen/X86/pic_jumptable.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30744 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 03:13:28 +00:00
Chris Lattner
1da31ee472 Pass the MachineFunction into EmitJumpTableInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30742 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 03:01:21 +00:00
Chris Lattner
edad2b783f implement and use getSectionForFunction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30741 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 02:51:36 +00:00
Chris Lattner
6f6f69950f Use getSectionForFunction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30740 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 02:49:23 +00:00
Chris Lattner
29bd9e12d4 Use getSectionForFunction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30739 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 02:48:40 +00:00
Chris Lattner
6e79629dab use getSectionForFunction to decide which section to emit code into
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30738 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 02:47:13 +00:00
Chris Lattner
afbfdeddff Implement getSectionForFunction, use it when printing function body.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30737 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 02:43:52 +00:00
Chris Lattner
52f0670470 move getSectionForFunction to AsmPrinter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30736 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 02:42:47 +00:00
Chris Lattner
9b7ce7da82 Move getSectionForFunction to AsmPrinter, change it to return a string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30735 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 02:42:20 +00:00
Chris Lattner
b56dcc453e implement DarwinTargetAsmInfo::getSectionForFunction, use it when outputting
function bodies


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30733 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 00:35:50 +00:00
Chris Lattner
f5b10ec509 Give TargetAsmInfo a virtual dtor, add a new getSectionForFunction method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30732 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 00:35:16 +00:00
Chris Lattner
fea13d33e5 emit jump table before debug info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30731 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 00:26:05 +00:00
Chris Lattner
37dfa02788 Always emit the jump table after the function so it's part of the same 'atom'
as the function body.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30730 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 00:24:46 +00:00
Chris Lattner
df20b96ffd getFilename/getDirectory shouldn't abort if the global has no init. This
can happen on bugpoint reduced testcases f.e..


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30729 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-04 23:06:26 +00:00
Evan Cheng
693163e74d Fix some typos that can cause a flag value to have more than one use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30727 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-04 22:23:53 +00:00
Chris Lattner
c055a9191f Fix a static dtor issue
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30726 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-04 22:13:11 +00:00
Chris Lattner
90aa839c88 Fix more static dtor issues
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30725 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-04 21:52:35 +00:00
Chris Lattner
b336409673 Fix some more static dtor issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30724 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-04 21:49:37 +00:00
Evan Cheng
e111303408 Added option -disable-x86-shuffle-opti to disable X86 specific vector shuffle optimizations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30723 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-04 18:33:38 +00:00
Evan Cheng
8e0055de8a Formating.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30722 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-04 18:33:00 +00:00
Jim Laskey
6ff23e5e84 More extensive alias analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30721 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-04 16:53:27 +00:00
Jim Laskey
0c0feb9d5f More long term solution
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30720 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-04 10:40:15 +00:00
Chris Lattner
83e6c9925e Pattern match min/max nodes when we have sse. This implements
CodeGen/X86/scalar_sse_minmax.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30719 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-04 06:57:07 +00:00
Chris Lattner
68e8b9e775 add a note :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30717 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-04 05:52:13 +00:00
Chris Lattner
3a15503c82 This case isn't implemented yet. It seems unlikely to be needed, but if it
ever is, we want to get an assert instead of silent bad codegen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30716 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-04 04:58:58 +00:00
Jim Laskey
0f77fe5ea6 Work around for some problems with templates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30715 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-04 01:43:13 +00:00
Evan Cheng
c548428c5d Combine ISD::EXTLOAD, ISD::SEXTLOAD, ISD::ZEXTLOAD into ISD::LOADX. Add an
extra operand to LOADX to specify the exact value extension type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30714 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-04 00:56:09 +00:00
Chris Lattner
faf1daeb92 Use $( $| $) to represent alternatives in asm blocks instead of {|}. This
is needed to support targets where {|} aren't special symbols.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30712 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-03 23:27:09 +00:00
Evan Cheng
bf497a3a68 Fix an obvious typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30711 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-03 23:08:27 +00:00
Chris Lattner
f28bbda2c6 Bugfixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30709 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-03 20:19:23 +00:00
Chris Lattner
ee773ba72b Print the MBB ID # along with the bb tag in the -print-machine-instrs output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30708 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-03 20:17:24 +00:00
Chris Lattner
e70cab0ca4 Provide a function that ensures MBB numbering is dense and inorder. This
can be used by MachineFunctionPasses who need this property.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30706 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-03 19:18:57 +00:00
Nick Lewycky
f938099aa1 Simplify logic further.
Ensure that we copy KnownProperties before calling visitBasicBlock, else
we may leak properties into blocks where they don't belong.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30705 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-03 17:36:01 +00:00
Rafael Espindola
cd71da5cf0 Implement floating point constants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30704 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-03 17:27:58 +00:00
Chris Lattner
13bf6c1350 Fix PR933 and CodeGen/X86/2006-10-02-BoolRetCrash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30703 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-03 17:18:42 +00:00
Nick Lewycky
a73a654bb4 Simplify, now that predsimplify depends on break-crit-edges.
Fix SwitchInst where dest-block is the same as one of the cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30700 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-03 15:19:11 +00:00
Nick Lewycky
5c8c5d9ace Move break-crit-edges before the predicate simplifier. Allows us to
optimize in more cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30699 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-03 14:52:23 +00:00
Evan Cheng
99435d32b3 Revert previous patch. Still breaking things.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30698 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-03 07:26:07 +00:00
Bill Wendling
f7da4e939f Fix for PR929. The PHI nodes were being gone through for each instruction
in a successor block for every block...resulting in some O(N^k) algorithm
which wasn't very good for performance. Calculating this information up
front and keeping it in a map made it much faster.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30697 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-03 07:20:20 +00:00
Chris Lattner
86f7b2100c Fix PR932 and Analysis/Dominators/2006-10-02-BreakCritEdges.ll:
The critical edge block dominates the dest block if the destblock dominates
all edges other than the one incoming from the critical edge.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30696 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-03 07:02:02 +00:00
Evan Cheng
485130fbf4 These don't have immediate operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30694 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-03 06:55:11 +00:00
Rafael Espindola
9e071f0ae3 fix the names of the 64bit fp register
initial support for returning 64bit floating point numbers


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30692 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-02 19:30:56 +00:00
Jim Laskey
01078fb7ec Debugging kruft
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30688 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-02 13:01:17 +00:00
Jim Laskey
ec20402c90 Add ability to annotate (color) nodes in a viewGraph.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30686 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-02 12:26:53 +00:00
Chris Lattner
39d78d623a Fixme is already done
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30685 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-01 22:46:33 +00:00
Chris Lattner
ab38358fa0 Teach globalsmodref-aa to track scalar pointer global variables which point
to unaliased allocations.  Use this information to disambiguate pointers loaded
from them.  This is a very common case, so it's worthwhile to handle efficiently.

This implements Analysis/GlobalsModRef/indirect-global.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30684 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-01 22:36:45 +00:00
Chris Lattner
e831b9a48b Fix a bug from r1.391 of this file, where we checked the size instead of
the alignment when promoting allocations.  This implements
InstCombine/cast.ll:test32


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30682 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-01 19:40:58 +00:00
Chris Lattner
596721f0d7 Fix debug output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30680 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-30 23:32:50 +00:00
Chris Lattner
8639503abe Implement SRA of heap allocations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30679 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-30 23:32:09 +00:00
Chris Lattner
adc95467e4 Add a version of the globalvariable ctor that inserts at a specific location.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30677 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-30 21:31:26 +00:00
Chris Lattner
cff1673182 Add some ifdef'd out debug info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30676 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-30 19:40:30 +00:00
Evan Cheng
71f84de79b Not needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30674 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-29 22:05:10 +00:00
Rafael Espindola
27185190e6 add floating point registers
implement SINT_TO_FP


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30673 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-29 21:20:16 +00:00
Chris Lattner
151880b020 Define this in the correct n/s
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30671 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-29 18:43:14 +00:00
Chris Lattner
ab4fa4f377 Minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30668 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 23:45:00 +00:00
Chris Lattner
de65fb3a8b Now that ConstantBool::True/False are gone, we can modify Type.cpp to
eliminate its static dtors, without having code that depends on order of
initialization.  Eliminate static ctors/dtors from Type.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30667 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 23:38:07 +00:00
Chris Lattner
003cbf35f4 Eliminate ConstantBool::True and ConstantBool::False. Instead, provide
ConstantBool::getTrue() and ConstantBool::getFalse().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30666 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 23:36:21 +00:00
Chris Lattner
47811b76ca Eliminate ConstantBool::True and ConstantBool::False. Instead, provide
ConstantBool::getTrue() and ConstantBool::getFalse().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30665 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 23:35:22 +00:00
Chris Lattner
850ba99cb6 Eliminate ConstantBool::True and ConstantBool::False. Instead, provideConstantBool::getTrue() and ConstantBool::getFalse().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30664 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 23:34:49 +00:00
Chris Lattner
6458f1807d update comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30663 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 23:33:12 +00:00
Chris Lattner
7be164c0ea wrap long lines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30662 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 23:32:43 +00:00
Chris Lattner
33ce777c4d Simplify some code, reformat break's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30660 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 23:19:29 +00:00
Chris Lattner
f8f791ef1e simplify code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30659 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 23:17:41 +00:00
Chris Lattner
193c2d886f Simplify some code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30658 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 23:14:29 +00:00
Owen Anderson
3295471846 Another attempt at making ArgPromotion smarter. This patch no longer breaks Burg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30657 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 23:02:22 +00:00
Chris Lattner
40d31ecb29 simplify code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30656 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 22:58:25 +00:00
Chris Lattner
9fb471df2e simplify code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30655 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 22:50:29 +00:00
Chris Lattner
7c395ad06f Shift amounts are always 32-bits, even in 64-bit mode. This fixes
CodeGen/PowerPC/2006-09-28-shift_64.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30652 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 20:48:45 +00:00
Reid Spencer
5b7e753d95 Fix PR902:
Errors are generated with the YYERROR macro which can only be called from
a production (inside yyparse) because of the goto statement in the macro.
This lead to several situations where GEN_ERROR was not called but
GenerateError was used instead (because it doesn't use YYERROR). However,
in such situations, catching the error much later (e.g. at the end of
the production) is not sufficient because LLVM can assert on invalid data
before the end of the production is reached. The solution is to ensure that
the CHECK_FOR_ERROR macro (which invokes YYERROR if there's an error) is
used as soon as possible after a call to GenerateError has been made.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30650 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 19:28:24 +00:00
Evan Cheng
5feaa9a707 TargetRegisterClass specifies the desired spill alignment. However, it cannot be honored if stack alignment is smaller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30648 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 18:52:32 +00:00
Bill Wendling
ca756d2cf9 "Once more into the breach, dear friends, once more, or fill the wall up
with our English dead."

No! Really! Serious this time...It was how the vreg uses were being
adjusted that was causing hte Olden tests to fail. I corrected this and
the Olden and Regression tests all passed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30644 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 07:10:24 +00:00
Chris Lattner
57f9a43c64 refactor critical edge breaking out into the SplitCritEdgesForPHIConstants method.
This is a baby step towards fixing PR925.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30643 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 06:17:10 +00:00
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