oota-llvm.git
18 years agocompletely disable folding of loads into scalar sse instructions and provide
Chris Lattner [Sat, 7 Oct 2006 21:55:32 +0000 (21:55 +0000)]
completely disable folding of loads into scalar sse instructions and provide
a framework for doing it right.  This fixes
CodeGen/X86/2006-10-07-ScalarSSEMiscompile.ll.

Once X86DAGToDAGISel::SelectScalarSSELoad is implemented right, this task
will be done.

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

18 years agonew testcase we miscompile
Chris Lattner [Sat, 7 Oct 2006 21:54:08 +0000 (21:54 +0000)]
new testcase we miscompile

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

18 years agoconvert packed FP add/sub/mul/div to use a multiclass.
Chris Lattner [Sat, 7 Oct 2006 21:17:13 +0000 (21:17 +0000)]
convert packed FP add/sub/mul/div to use a multiclass.

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

18 years agoone multiclass now defines all 8 variants of binary-scalar-sse-fp operations.
Chris Lattner [Sat, 7 Oct 2006 20:55:57 +0000 (20:55 +0000)]
one multiclass now defines all 8 variants of binary-scalar-sse-fp operations.

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

18 years agoSwitch ADD/MUL/DIV/SUB scalarsse fp ops to a multiclass
Chris Lattner [Sat, 7 Oct 2006 20:35:44 +0000 (20:35 +0000)]
Switch ADD/MUL/DIV/SUB scalarsse fp ops to a multiclass

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

18 years agoRandom acts of shrinkage
Chris Lattner [Sat, 7 Oct 2006 19:49:05 +0000 (19:49 +0000)]
Random acts of shrinkage

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

18 years agoConvert pand/por/pxor to use multiclass
Chris Lattner [Sat, 7 Oct 2006 19:37:30 +0000 (19:37 +0000)]
Convert pand/por/pxor to use multiclass

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

18 years agoConvert some more instructions over to use a new multiclass.
Chris Lattner [Sat, 7 Oct 2006 19:34:33 +0000 (19:34 +0000)]
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

18 years agoFix a bug where PADDQrm printed paddd instead of paddq.
Chris Lattner [Sat, 7 Oct 2006 19:15:46 +0000 (19:15 +0000)]
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

18 years agoAdd multiclass for SSE2 instructions that correspond to simple binops.
Chris Lattner [Sat, 7 Oct 2006 19:14:49 +0000 (19:14 +0000)]
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

18 years agorename:
Chris Lattner [Sat, 7 Oct 2006 19:02:31 +0000 (19:02 +0000)]
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

18 years agoConvert saturating PADD/PSUB's to use a multiclass
Chris Lattner [Sat, 7 Oct 2006 18:48:46 +0000 (18:48 +0000)]
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

18 years agoConvert PAVG*, PMADDWD, and PMUL* to use multiclasses.
Chris Lattner [Sat, 7 Oct 2006 18:39:00 +0000 (18:39 +0000)]
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

18 years agoFix typo in packsswb instr definition, where the load had the wrong type.
Chris Lattner [Sat, 7 Oct 2006 18:23:58 +0000 (18:23 +0000)]
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

18 years agoimplement FUITOS and FUITOD
Rafael Espindola [Sat, 7 Oct 2006 14:24:52 +0000 (14:24 +0000)]
implement FUITOS and FUITOD

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

18 years agoimplement FLDD
Rafael Espindola [Sat, 7 Oct 2006 14:03:39 +0000 (14:03 +0000)]
implement FLDD

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

18 years agoimplement fadds, faddd, fmuls and fmuld
Rafael Espindola [Sat, 7 Oct 2006 13:46:42 +0000 (13:46 +0000)]
implement fadds, faddd, fmuls and fmuld

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

18 years agohandle pmin/pmax with multiclasses
Chris Lattner [Sat, 7 Oct 2006 07:49:33 +0000 (07:49 +0000)]
handle pmin/pmax with multiclasses

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

18 years agoregenerate
Chris Lattner [Sat, 7 Oct 2006 07:15:19 +0000 (07:15 +0000)]
regenerate

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

18 years agoBugfix: this allows multiclasses to have default arguments.
Chris Lattner [Sat, 7 Oct 2006 07:14:48 +0000 (07:14 +0000)]
Bugfix: this allows multiclasses to have default arguments.

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

18 years agosimplify pack and shift intrinsics with multiclasses
Chris Lattner [Sat, 7 Oct 2006 07:06:17 +0000 (07:06 +0000)]
simplify pack and shift intrinsics with multiclasses

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

18 years agoUse a multiclass to simplify 'SSE2 Integer comparison'
Chris Lattner [Sat, 7 Oct 2006 06:47:08 +0000 (06:47 +0000)]
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

18 years agomove class defns close to uses to make it easier to read
Chris Lattner [Sat, 7 Oct 2006 06:33:36 +0000 (06:33 +0000)]
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

18 years agosimplify horizontal op definitions
Chris Lattner [Sat, 7 Oct 2006 06:31:41 +0000 (06:31 +0000)]
simplify horizontal op definitions

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

18 years agoremove more unneeded type info
Chris Lattner [Sat, 7 Oct 2006 06:27:03 +0000 (06:27 +0000)]
remove more unneeded type info

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

18 years agoremove unneeded definitions and type info
Chris Lattner [Sat, 7 Oct 2006 06:19:41 +0000 (06:19 +0000)]
remove unneeded definitions and type info

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

18 years agoremove some unneeded type info
Chris Lattner [Sat, 7 Oct 2006 06:17:43 +0000 (06:17 +0000)]
remove some unneeded type info

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

18 years agosimplify patterns by merging in operand info
Chris Lattner [Sat, 7 Oct 2006 05:50:25 +0000 (05:50 +0000)]
simplify patterns by merging in operand info

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

18 years agoFactor operands into packed unary classes
Chris Lattner [Sat, 7 Oct 2006 05:47:20 +0000 (05:47 +0000)]
Factor operands into packed unary classes

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

18 years agoremove dead/duplicate instructions
Chris Lattner [Sat, 7 Oct 2006 05:41:52 +0000 (05:41 +0000)]
remove dead/duplicate instructions

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

18 years agoPull operand info up into parent class for scalar sse intrinsics.
Chris Lattner [Sat, 7 Oct 2006 05:26:13 +0000 (05:26 +0000)]
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

18 years agoconvert the sole sd unary intrinsic to a multiclass for consistency
Chris Lattner [Sat, 7 Oct 2006 05:19:31 +0000 (05:19 +0000)]
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

18 years agopull operand string into the multiclass
Chris Lattner [Sat, 7 Oct 2006 05:13:26 +0000 (05:13 +0000)]
pull operand string into the multiclass

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

18 years agoRemove RSQRTSS[rm] RCPSS[rm], which are dead.
Chris Lattner [Sat, 7 Oct 2006 05:09:48 +0000 (05:09 +0000)]
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

18 years agoeliminate redundancy
Chris Lattner [Sat, 7 Oct 2006 04:52:09 +0000 (04:52 +0000)]
eliminate redundancy

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

18 years agoFix a bug legalizing zero-extending i64 loads into 32-bit loads. The bottom
Chris Lattner [Sat, 7 Oct 2006 00:58:36 +0000 (00:58 +0000)]
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

18 years agoSet the jt section
Chris Lattner [Fri, 6 Oct 2006 22:52:33 +0000 (22:52 +0000)]
Set the jt section

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

18 years agoinitialize ivar
Chris Lattner [Fri, 6 Oct 2006 22:52:08 +0000 (22:52 +0000)]
initialize ivar

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

18 years agoIf a target uses a GOT, put it in the jt data section, not the text
Chris Lattner [Fri, 6 Oct 2006 22:50:56 +0000 (22:50 +0000)]
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

18 years agoAlpha uses a got
Chris Lattner [Fri, 6 Oct 2006 22:46:51 +0000 (22:46 +0000)]
Alpha uses a got

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

18 years agoAdd support for targets to declare that they use a GOT
Chris Lattner [Fri, 6 Oct 2006 22:46:34 +0000 (22:46 +0000)]
Add support for targets to declare that they use a GOT

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

18 years agojump tables handle pic
Chris Lattner [Fri, 6 Oct 2006 22:32:29 +0000 (22:32 +0000)]
jump tables handle pic

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

18 years agoprint labels even if a MBB doesn't have a corresponding LLVM BB, just don't
Chris Lattner [Fri, 6 Oct 2006 21:28:17 +0000 (21:28 +0000)]
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

18 years agoadd optional input flag to FMRRD
Rafael Espindola [Fri, 6 Oct 2006 20:33:26 +0000 (20:33 +0000)]
add optional input flag to FMRRD

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

18 years agoadd support for calling functions that return double
Rafael Espindola [Fri, 6 Oct 2006 19:10:05 +0000 (19:10 +0000)]
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

18 years ago80 col violation.
Evan Cheng [Fri, 6 Oct 2006 18:57:51 +0000 (18:57 +0000)]
80 col violation.

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

18 years agougly codegen
Chris Lattner [Fri, 6 Oct 2006 17:39:34 +0000 (17:39 +0000)]
ugly codegen

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

18 years agoFix a miscompilation of:
Chris Lattner [Fri, 6 Oct 2006 17:34:12 +0000 (17:34 +0000)]
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

18 years agofix some bugs affecting functions with no arguments
Rafael Espindola [Fri, 6 Oct 2006 17:26:30 +0000 (17:26 +0000)]
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

18 years agofix the stack alignment
Rafael Espindola [Fri, 6 Oct 2006 14:29:47 +0000 (14:29 +0000)]
fix the stack alignment

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

18 years agoadd support for calling functions that have double arguments
Rafael Espindola [Fri, 6 Oct 2006 12:50:22 +0000 (12:50 +0000)]
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

18 years agoStill need to support -mcpu=<> or cross compilation will fail. Doh.
Evan Cheng [Fri, 6 Oct 2006 09:17:41 +0000 (09:17 +0000)]
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

18 years agoDo away with CPU feature list. Just use CPUID to detect MMX, SSE, SSE2, SSE3, and...
Evan Cheng [Fri, 6 Oct 2006 08:21:07 +0000 (08:21 +0000)]
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

18 years agoIt appears the inline asm in GetCpuIDAndInfo() may clobbers some registers if it...
Evan Cheng [Fri, 6 Oct 2006 07:50:56 +0000 (07:50 +0000)]
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

18 years agoadd an accessor
Chris Lattner [Fri, 6 Oct 2006 01:16:29 +0000 (01:16 +0000)]
add an accessor

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

18 years agoMachineBasicBlock::splice was incorrectly updating parent pointers on
Chris Lattner [Fri, 6 Oct 2006 01:12:44 +0000 (01:12 +0000)]
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

18 years agoMake use of getStore().
Evan Cheng [Thu, 5 Oct 2006 23:01:46 +0000 (23:01 +0000)]
Make use of getStore().

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

18 years agoAdd getStore() helper function to create ISD::STORE nodes.
Evan Cheng [Thu, 5 Oct 2006 22:57:11 +0000 (22:57 +0000)]
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

18 years agoDon't crash if an MBB doesn't have an LLVM BB
Chris Lattner [Thu, 5 Oct 2006 21:40:14 +0000 (21:40 +0000)]
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

18 years agouse a const ref for passing the vector to ArgumentLayout
Rafael Espindola [Thu, 5 Oct 2006 17:46:48 +0000 (17:46 +0000)]
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

18 years agoimplement a ArgumentLayout class to factor code common to LowerFORMAL_ARGUMENTS and...
Rafael Espindola [Thu, 5 Oct 2006 16:48:49 +0000 (16:48 +0000)]
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

18 years agoAlias analysis code clean ups.
Jim Laskey [Thu, 5 Oct 2006 15:07:25 +0000 (15:07 +0000)]
Alias analysis code clean ups.

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

18 years agoadd a new SimplifyDemandedVectorElts method, which works similarly to
Chris Lattner [Thu, 5 Oct 2006 06:55:50 +0000 (06:55 +0000)]
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

18 years agonew testcase
Chris Lattner [Thu, 5 Oct 2006 06:51:54 +0000 (06:51 +0000)]
new testcase

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

18 years agoAdd insertelement/extractelement helper ctors.
Chris Lattner [Thu, 5 Oct 2006 06:24:58 +0000 (06:24 +0000)]
Add insertelement/extractelement helper ctors.

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

18 years agoLower some min/max idioms to minss/maxss when unsafe fp math is enabled.
Chris Lattner [Thu, 5 Oct 2006 04:11:26 +0000 (04:11 +0000)]
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

18 years agoCheck that jump tables wind up in the rodata section
Andrew Lenharth [Thu, 5 Oct 2006 03:27:52 +0000 (03:27 +0000)]
Check that jump tables wind up in the rodata section

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

18 years agoremove JumpTableTextSection
Chris Lattner [Thu, 5 Oct 2006 03:14:23 +0000 (03:14 +0000)]
remove JumpTableTextSection

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

18 years agoDon't bother setting JumpTableTextSection, it is about to disappear
Chris Lattner [Thu, 5 Oct 2006 03:13:59 +0000 (03:13 +0000)]
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

18 years agoEmit pic jumptables to the same section that the function is emitted to,
Chris Lattner [Thu, 5 Oct 2006 03:13:28 +0000 (03:13 +0000)]
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

18 years agoVerify that jump tables are emitted to the same section as the function is,
Chris Lattner [Thu, 5 Oct 2006 03:12:36 +0000 (03:12 +0000)]
Verify that jump tables are emitted to the same section as the function is,
when codegen'ing in pic mode.  This fixes a miscompilation of a switch stmt
in a template, as the template goes to a non-.text section.

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

18 years agoPass the MachineFunction into EmitJumpTableInfo.
Chris Lattner [Thu, 5 Oct 2006 03:01:21 +0000 (03:01 +0000)]
Pass the MachineFunction into EmitJumpTableInfo.

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

18 years agoimplement and use getSectionForFunction
Chris Lattner [Thu, 5 Oct 2006 02:51:36 +0000 (02:51 +0000)]
implement and use getSectionForFunction

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

18 years agoUse getSectionForFunction.
Chris Lattner [Thu, 5 Oct 2006 02:49:23 +0000 (02:49 +0000)]
Use getSectionForFunction.

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

18 years agoUse getSectionForFunction
Chris Lattner [Thu, 5 Oct 2006 02:48:40 +0000 (02:48 +0000)]
Use getSectionForFunction

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

18 years agouse getSectionForFunction to decide which section to emit code into
Chris Lattner [Thu, 5 Oct 2006 02:47:13 +0000 (02:47 +0000)]
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

18 years agoImplement getSectionForFunction, use it when printing function body.
Chris Lattner [Thu, 5 Oct 2006 02:43:52 +0000 (02:43 +0000)]
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

18 years agomove getSectionForFunction to AsmPrinter
Chris Lattner [Thu, 5 Oct 2006 02:42:47 +0000 (02:42 +0000)]
move getSectionForFunction to AsmPrinter

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

18 years agoMove getSectionForFunction to AsmPrinter, change it to return a string.
Chris Lattner [Thu, 5 Oct 2006 02:42:20 +0000 (02:42 +0000)]
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

18 years agomove getSectionForFunction to AsmPrinter.
Chris Lattner [Thu, 5 Oct 2006 02:41:43 +0000 (02:41 +0000)]
move getSectionForFunction to AsmPrinter.

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

18 years agoimplement DarwinTargetAsmInfo::getSectionForFunction, use it when outputting
Chris Lattner [Thu, 5 Oct 2006 00:35:50 +0000 (00:35 +0000)]
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

18 years agoGive TargetAsmInfo a virtual dtor, add a new getSectionForFunction method.
Chris Lattner [Thu, 5 Oct 2006 00:35:16 +0000 (00:35 +0000)]
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

18 years agoemit jump table before debug info
Chris Lattner [Thu, 5 Oct 2006 00:26:05 +0000 (00:26 +0000)]
emit jump table before debug info

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

18 years agoAlways emit the jump table after the function so it's part of the same 'atom'
Chris Lattner [Thu, 5 Oct 2006 00:24:46 +0000 (00:24 +0000)]
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

18 years agogetFilename/getDirectory shouldn't abort if the global has no init. This
Chris Lattner [Wed, 4 Oct 2006 23:06:26 +0000 (23:06 +0000)]
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

18 years agoFix some typos that can cause a flag value to have more than one use.
Evan Cheng [Wed, 4 Oct 2006 22:23:53 +0000 (22:23 +0000)]
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

18 years agoFix a static dtor issue
Chris Lattner [Wed, 4 Oct 2006 22:13:11 +0000 (22:13 +0000)]
Fix a static dtor issue

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

18 years agoFix more static dtor issues
Chris Lattner [Wed, 4 Oct 2006 21:52:35 +0000 (21:52 +0000)]
Fix more static dtor issues

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

18 years agoFix some more static dtor issues.
Chris Lattner [Wed, 4 Oct 2006 21:49:37 +0000 (21:49 +0000)]
Fix some more static dtor issues.

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

18 years agoAdded option -disable-x86-shuffle-opti to disable X86 specific vector shuffle optimiz...
Evan Cheng [Wed, 4 Oct 2006 18:33:38 +0000 (18:33 +0000)]
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

18 years agoFormating.
Evan Cheng [Wed, 4 Oct 2006 18:33:00 +0000 (18:33 +0000)]
Formating.

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

18 years agoMore extensive alias analysis.
Jim Laskey [Wed, 4 Oct 2006 16:53:27 +0000 (16:53 +0000)]
More extensive alias analysis.

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

18 years agoMore long term solution
Jim Laskey [Wed, 4 Oct 2006 10:40:15 +0000 (10:40 +0000)]
More long term solution

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

18 years agoPattern match min/max nodes when we have sse. This implements
Chris Lattner [Wed, 4 Oct 2006 06:57:07 +0000 (06:57 +0000)]
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

18 years agopattern match min/max nodes
Chris Lattner [Wed, 4 Oct 2006 06:56:02 +0000 (06:56 +0000)]
pattern match min/max nodes

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

18 years agoadd a note :(
Chris Lattner [Wed, 4 Oct 2006 05:52:13 +0000 (05:52 +0000)]
add a note :(

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

18 years agoThis case isn't implemented yet. It seems unlikely to be needed, but if it
Chris Lattner [Wed, 4 Oct 2006 04:58:58 +0000 (04:58 +0000)]
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

18 years agoWork around for some problems with templates.
Jim Laskey [Wed, 4 Oct 2006 01:43:13 +0000 (01:43 +0000)]
Work around for some problems with templates.

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

18 years agoCombine ISD::EXTLOAD, ISD::SEXTLOAD, ISD::ZEXTLOAD into ISD::LOADX. Add an
Evan Cheng [Wed, 4 Oct 2006 00:56:09 +0000 (00:56 +0000)]
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

18 years agoUse $( $| $) to represent alternatives in asm blocks instead of {|}. This
Chris Lattner [Tue, 3 Oct 2006 23:27:09 +0000 (23:27 +0000)]
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