Commit Graph

349 Commits

Author SHA1 Message Date
Chris Lattner ef598059f2 Add a new -view-legalize-dags command line option
llvm-svn: 27342
2006-04-02 03:07:27 +00:00
Chris Lattner d9e4daabd2 Do not endian swap split vector loads. This fixes UnitTests/Vector/sumarray-dbl on PPC.
Now all UnitTests/Vector/* tests pass on PPC.

llvm-svn: 27299
2006-03-31 18:22:37 +00:00
Chris Lattner 8d90f526d7 Do not endian swap the operands to a store if the operands came from a vector.
This fixes UnitTests/Vector/simple.c with altivec.

llvm-svn: 27298
2006-03-31 18:20:46 +00:00
Chris Lattner 6f42325dca Implement PromoteOp for VEXTRACT_VECTOR_ELT. Thsi fixes
Generic/vector.ll:test_extract_elt on non-sse X86 systems.

llvm-svn: 27294
2006-03-31 17:55:51 +00:00
Chris Lattner 8e1fcab2bc Scalarized vector stores need not be legal, e.g. if the vector element type
needs to be promoted or expanded.  Relegalize the scalar store once created.
This fixes CodeGen/Generic/vector.ll:test1 on non-SSE x86 targets.

llvm-svn: 27293
2006-03-31 17:37:22 +00:00
Chris Lattner 5fe1f54c17 Significantly improve handling of vectors that are live across basic blocks,
handling cases where the vector elements need promotion, expansion, and when
the vector type itself needs to be decimated.

llvm-svn: 27278
2006-03-31 02:06:56 +00:00
Evan Cheng 168e45b0b3 Expand INSERT_VECTOR_ELT to store vec, sp; store elt, sp+k; vec = load sp;
llvm-svn: 27274
2006-03-31 01:27:51 +00:00
Chris Lattner f6f94d3bce Teach Legalize how to pack VVECTOR_SHUFFLE nodes into VECTOR_SHUFFLE nodes.
llvm-svn: 27232
2006-03-28 20:24:43 +00:00
Chris Lattner e55d171ccd Tblgen doesn't like multiple SDNode<> definitions that map to the sameenum value. Split them into separate enums.
llvm-svn: 27201
2006-03-28 00:40:33 +00:00
Chris Lattner d5f94c9574 Fix legalization of intrinsics with chain and result values
llvm-svn: 27181
2006-03-27 20:28:29 +00:00
Chris Lattner 30ee72586d Allow targets to custom lower their own intrinsics if desired.
llvm-svn: 27146
2006-03-26 09:12:51 +00:00
Evan Cheng 68d9bf26c8 Only to vector shuffle for {x,x,y,y} cases when SCALAR_TO_VECTOR is free.
llvm-svn: 27071
2006-03-24 18:45:20 +00:00
Chris Lattner 77e271cb4e prefer to generate constant pool loads over splats. This prevents us from
using a splat for {1.0,1.0,1.0,1.0}

llvm-svn: 27055
2006-03-24 07:29:17 +00:00
Chris Lattner a4f6805a86 legalize vbit_convert nodes whose result is a legal type.
Legalize intrinsic nodes.

llvm-svn: 27036
2006-03-24 02:26:29 +00:00
Evan Cheng 1d2e995fc1 Lower BUILD_VECTOR to VECTOR_SHUFFLE if there are two distinct nodes (and if
the target can handle it). Issue two SCALAR_TO_VECTOR ops followed by a
VECTOR_SHUFFLE to select from the two vectors.

llvm-svn: 27023
2006-03-24 01:17:21 +00:00
Chris Lattner d7c4e7d255 add support for splitting casts. This implements
CodeGen/Generic/vector.ll:test_cast_2.

llvm-svn: 26999
2006-03-23 21:16:34 +00:00
Chris Lattner 9ea1b3f9fd simplify some code
llvm-svn: 26972
2006-03-23 05:29:04 +00:00
Chris Lattner 2f4119a608 Implement simple support for vector casting. This can currently only handle
casts between legal vector types.

llvm-svn: 26961
2006-03-22 20:09:35 +00:00
Chris Lattner 8fa445a89d Endianness does not affect the order of vector fields. This fixes
SingleSource/UnitTests/Vector/build.c

llvm-svn: 26936
2006-03-22 01:46:54 +00:00
Chris Lattner 5be4352124 Enclose some variables in a scope to avoid error with some gcc versions
llvm-svn: 26934
2006-03-22 00:12:37 +00:00
Chris Lattner 340a6b5c26 add expand support for extractelement
llvm-svn: 26931
2006-03-21 21:02:03 +00:00
Chris Lattner 7c0cd8cafc add some trivial support for extractelement.
llvm-svn: 26928
2006-03-21 20:44:12 +00:00
Chris Lattner 672a42d731 Add a hacky workaround for crashes due to vectors live across blocks.
Note that this code won't work for vectors that aren't legal on the
target.  Improvements coming.

llvm-svn: 26925
2006-03-21 19:20:37 +00:00
Chris Lattner 21e68c8001 If a target supports splatting with SHUFFLE_VECTOR, lower to it from BUILD_VECTOR(x,x,x,x)
llvm-svn: 26885
2006-03-20 01:52:29 +00:00
Chris Lattner 79fb91cc69 Allow SCALAR_TO_VECTOR to be custom lowered.
llvm-svn: 26867
2006-03-19 06:47:21 +00:00
Chris Lattner 9cdc5a0ce7 Add SCALAR_TO_VECTOR support
llvm-svn: 26866
2006-03-19 06:31:19 +00:00
Chris Lattner eb5b2e705c Don't bother storing undef elements of BUILD_VECTOR's
llvm-svn: 26858
2006-03-19 05:46:04 +00:00
Chris Lattner 5d3ff12c8f Implement expand of BUILD_VECTOR containing variable elements.
This implements CodeGen/Generic/vector.ll:test_variable_buildvector

llvm-svn: 26852
2006-03-19 04:18:56 +00:00
Chris Lattner 29b2301460 implement basic support for INSERT_VECTOR_ELT.
llvm-svn: 26849
2006-03-19 01:17:20 +00:00
Chris Lattner f4e1a53647 Rename ConstantVec -> BUILD_VECTOR and VConstant -> VBUILD_VECTOR. Allow*BUILD_VECTOR to take variable inputs.
llvm-svn: 26847
2006-03-19 00:52:58 +00:00
Chris Lattner c16b05e67d implement vector.ll:test_undef
llvm-svn: 26845
2006-03-19 00:20:20 +00:00
Chris Lattner 93640543a9 Fix the remaining bugs in the vector expansion rework I commited yesterday.
This fixes CodeGen/Generic/vector.ll

llvm-svn: 26843
2006-03-19 00:07:49 +00:00
Chris Lattner 32206f54c6 Change the structure of lowering vector stuff. Note: This breaks some
things.

llvm-svn: 26840
2006-03-18 01:44:44 +00:00
Nate Begeman bb01d4f272 Remove BRTWOWAY*
Make the PPC backend not dependent on BRTWOWAY_CC and make the branch
selector smarter about the code it generates, fixing a case in the
readme.

llvm-svn: 26814
2006-03-17 01:40:33 +00:00
Chris Lattner cad70c3e46 Add a note, this code should be moved to the dag combiner.
llvm-svn: 26787
2006-03-15 22:19:18 +00:00
Chris Lattner 994d8e6bd4 For targets with FABS/FNEG support, lower copysign to an integer load,
a select and FABS/FNEG.

This speeds up a trivial (aka stupid) copysign benchmark I wrote from 6.73s
to 2.64s, woo.

llvm-svn: 26723
2006-03-13 06:08:38 +00:00
Chris Lattner 3fe975b846 revert the previous patch, didn't mean to check it in yet
llvm-svn: 26610
2006-03-08 04:39:05 +00:00
Chris Lattner af5e26c980 remove "Slot", it is dead
llvm-svn: 26609
2006-03-08 04:37:58 +00:00
Chris Lattner 5c1ba2ac08 Codegen copysign[f] into a FCOPYSIGN node
llvm-svn: 26542
2006-03-05 05:09:38 +00:00
Evan Cheng 3bf916ddd9 Add more vector NodeTypes: VSDIV, VUDIV, VAND, VOR, and VXOR.
llvm-svn: 26504
2006-03-03 07:01:07 +00:00
Chris Lattner ad3c974a77 remove the read/write port/io intrinsics.
llvm-svn: 26479
2006-03-03 00:19:58 +00:00
Evan Cheng b97aab4371 Vector ops lowering.
llvm-svn: 26436
2006-03-01 01:09:54 +00:00
Chris Lattner 486d1bc5ed Fix a problem on itanium with memset. The value to set has been promoted to
i64 before this code, so zero_ext doesn't work.

llvm-svn: 26290
2006-02-20 06:38:35 +00:00
Nate Begeman 5965bd19f8 kill ADD_PARTS & SUB_PARTS and replace them with fancy new ADDC, ADDE, SUBC
and SUBE nodes that actually expose what's going on and allow for
significant simplifications in the targets.

llvm-svn: 26255
2006-02-17 05:43:56 +00:00
Chris Lattner 9ec392b2aa Fix another miscompilation exposed by lencode, where we lowered i64->f32
conversions to __floatdidf instead of __floatdisf on targets that support
f32 but not i64 (e.g. sparc).

llvm-svn: 26254
2006-02-17 04:32:33 +00:00
Jim Laskey 2eea436192 Should not combine ISD::LOCATIONs until we have scheme to remove from
MachineDebugInfo tables.

llvm-svn: 26216
2006-02-15 19:34:44 +00:00
Chris Lattner 8e2ee7358f Fix a latent bug in the call sequence handling stuff. Some targets (e.g. x86)
create these nodes with flag results.  Remember that we legalized them.

llvm-svn: 26156
2006-02-14 00:55:02 +00:00
Chris Lattner 462505fc5f Completely rewrite libcall insertion by the legalizer, providing the
following handy-dandy properties:

1. it is always correct now
2. it is much faster than before
3. it is easier to understand

This implementation builds off of the recent simplifications of the
legalizer that made it single-pass instead of iterative.

This fixes JM/lencod, JM/ldecod, and
CodeGen/Generic/2006-02-12-InsertLibcall.ll (at least on PPC).

llvm-svn: 26144
2006-02-13 09:18:02 +00:00
Nate Begeman 01bd9d9911 *** empty log message ***
llvm-svn: 25879
2006-02-01 19:05:15 +00:00
Nate Begeman 7e7f439f85 Fix some of the stuff in the PPC README file, and clean up legalization
of the SELECT_CC, BR_CC, and BRTWOWAY_CC nodes.

llvm-svn: 25875
2006-02-01 07:19:44 +00:00