1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

13722 Commits

Author SHA1 Message Date
Chris Lattner
ac98e20cc9 Use normal lvx for scalar_to_vector instead of lve*x. They do the exact
same thing and we have a dag node for the former.

llvm-svn: 27205
2006-03-28 01:43:22 +00:00
Jim Laskey
702240530d More bulletproofing of DebugInfoDesc verify.
llvm-svn: 27203
2006-03-28 01:30:18 +00:00
Chris Lattner
d5da541d42 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
Evan Cheng
d8d7ec47bd Model unpack lower and interleave as vector_shuffle so we can lower the
intrinsics as such.

llvm-svn: 27200
2006-03-28 00:39:58 +00:00
Andrew Lenharth
4130ea834c If adding a link to a collapsed, node, ignore offset.
Fixes 2006-03-27-LinkedCollapsed.ll

llvm-svn: 27194
2006-03-27 23:39:58 +00:00
Jim Laskey
d2619bb575 Reactivate llvm.dbg.declare.
llvm-svn: 27192
2006-03-27 23:31:10 +00:00
Chris Lattner
0b857e9ffc Disable dbg_declare, it currently breaks the CFE build
llvm-svn: 27182
2006-03-27 21:36:03 +00:00
Chris Lattner
d3368b1114 Fix legalization of intrinsics with chain and result values
llvm-svn: 27181
2006-03-27 20:28:29 +00:00
Jim Laskey
8688957c53 Translate llvm target registers to dwarf register numbers properly.
llvm-svn: 27180
2006-03-27 20:18:45 +00:00
Chris Lattner
b64eb6593a unbreak the build
llvm-svn: 27174
2006-03-27 16:52:45 +00:00
Chris Lattner
f5de9e0ab3 Unbreak the build on non-apple compilers :-(
llvm-svn: 27173
2006-03-27 16:10:59 +00:00
Evan Cheng
11d2b6217d Try again
llvm-svn: 27171
2006-03-27 08:10:26 +00:00
Chris Lattner
dab8425129 Add a bunch of notes from my journey thus far.
llvm-svn: 27170
2006-03-27 07:41:00 +00:00
Evan Cheng
73d281ae4c Incorrect check for FP all one's
llvm-svn: 27169
2006-03-27 07:26:17 +00:00
Chris Lattner
f1d6a9483f Split out altivec notes into their own README
llvm-svn: 27168
2006-03-27 07:04:16 +00:00
Evan Cheng
0865274fa5 Use pcmpeq to generate vector of all ones.
llvm-svn: 27167
2006-03-27 07:00:16 +00:00
Evan Cheng
2a36326bb0 Changed isBuildVectorAllOnesInteger to isBuildVectorAllOnes.
llvm-svn: 27166
2006-03-27 06:59:32 +00:00
Evan Cheng
4667bd17cb Change isBuildVectorAllOnesInteger to isBuildVectorAllOnes. Also check for
floating point cases.

llvm-svn: 27165
2006-03-27 06:58:47 +00:00
Chris Lattner
c508c91acb Instead of printing "INTRINSIC" on intrinsic node, print the intrinsic name.
llvm-svn: 27164
2006-03-27 06:45:25 +00:00
Chris Lattner
dc5d97a341 teach the inliner to work with packed constants
llvm-svn: 27161
2006-03-27 05:50:18 +00:00
Chris Lattner
4b0fc38fe7 Fix the JIT encoding of VSEL
llvm-svn: 27160
2006-03-27 03:34:17 +00:00
Chris Lattner
b5efa3e0f5 Fix the JIT encoding of VSPLTI*
llvm-svn: 27159
2006-03-27 03:28:57 +00:00
Jim Laskey
c195040bcf Pass llvm/test/Regression/CodeGen/Generic/debug-info.ll.
llvm-svn: 27158
2006-03-27 01:51:47 +00:00
Nate Begeman
3d518334b9 SelectionDAGISel can now natively handle Switch instructions, in the same
manner that the LowerSwitch LLVM to LLVM pass does: emitting a binary
search tree of basic blocks.  The new approach has several advantages:
it is faster, it generates significantly smaller code in many cases, and
it paves the way for implementing dense switch tables as a jump table by
handling switches directly in the instruction selector.

This functionality is currently only enabled on x86, but should be safe for
every target.  In anticipation of making it the default, the cfg is now
properly updated in the x86, ppc, and sparc select lowering code.

llvm-svn: 27156
2006-03-27 01:32:24 +00:00
Jim Laskey
fb55c2c6a7 Bullet proof against undefined args produced by upgrading ols-style debug info.
llvm-svn: 27155
2006-03-26 22:46:27 +00:00
Jim Laskey
278ca1e735 How to be dumb on $5/day. Need a tri-state to track valid debug descriptors.
llvm-svn: 27154
2006-03-26 22:45:20 +00:00
Chris Lattner
03ad35fd49 add vsel
llvm-svn: 27153
2006-03-26 22:38:43 +00:00
Nate Begeman
507e293848 Readme note
llvm-svn: 27152
2006-03-26 19:19:27 +00:00
Chris Lattner
65a455b060 Codegen vector predicate compares.
llvm-svn: 27151
2006-03-26 10:06:40 +00:00
Evan Cheng
1dfbede1d1 Remove X86:isZeroVector, use ISD::isBuildVectorAllZeros instead; some fixes / cleanups
llvm-svn: 27150
2006-03-26 09:53:12 +00:00
Evan Cheng
b17bbf8ccb Remove PPC:isZeroVector, use ISD::isBuildVectorAllZeros instead
llvm-svn: 27149
2006-03-26 09:52:32 +00:00
Evan Cheng
5809827989 Add immAllZerosV helper
llvm-svn: 27148
2006-03-26 09:51:39 +00:00
Evan Cheng
ef3b33b847 Add ISD::isBuildVectorAllZeros predicate
llvm-svn: 27147
2006-03-26 09:50:58 +00:00
Chris Lattner
aef813a8cf Allow targets to custom lower their own intrinsics if desired.
llvm-svn: 27146
2006-03-26 09:12:51 +00:00
Chris Lattner
dc8250447f Update dependencies to reflect split of the Intrinsics.td file
llvm-svn: 27144
2006-03-26 07:45:48 +00:00
Chris Lattner
f0c36b99e6 Add all of the altivec comparison instructions. Add patterns for the
non-predicate altivec compare intrinsics.

llvm-svn: 27143
2006-03-26 04:57:17 +00:00
Chris Lattner
4e0a78ea30 Add and 8/16-bit adds, add all integer subtracts, add saturating subtract
intrinsics.

llvm-svn: 27142
2006-03-26 02:39:02 +00:00
Chris Lattner
d33ef7a1bc implement the vsldoi intrinsic.
llvm-svn: 27139
2006-03-26 00:41:48 +00:00
Chris Lattner
7d557e00f3 fix the pattern for vandc, it's NOT vnand
llvm-svn: 27136
2006-03-25 23:10:40 +00:00
Chris Lattner
88a0c65463 add patterns for VANDC/VNOR, implementing
CodeGen/PowerPC/eqv-andc-orc-nor.ll:VNOR/VANDC

llvm-svn: 27135
2006-03-25 23:05:29 +00:00
Chris Lattner
8b6f0daaae Add some comments.
llvm-svn: 27133
2006-03-25 23:00:56 +00:00
Chris Lattner
f83db1efe6 add a vnot helper node for matching 'not' on vectors
llvm-svn: 27132
2006-03-25 23:00:08 +00:00
Chris Lattner
f9c8e9646d Fix a bug in ISD::isBuildVectorAllOnesInteger that caused it to always return
false

llvm-svn: 27131
2006-03-25 22:59:28 +00:00
Chris Lattner
d89668e503 Implement the ISD::isBuildVectorAllOnesInteger predicate
llvm-svn: 27130
2006-03-25 22:57:01 +00:00
Chris Lattner
62185c0496 Don't call SimplifyDemandedBits on vectors
llvm-svn: 27128
2006-03-25 22:19:00 +00:00
Chris Lattner
f80b39f9b1 Add some logical operations
llvm-svn: 27127
2006-03-25 22:16:05 +00:00
Chris Lattner
bc48efc7fa Don't crash on packed logical ops
llvm-svn: 27125
2006-03-25 21:58:26 +00:00
Chris Lattner
a458878f87 Teach BinaryOperator::createNot to work with packed integer types
llvm-svn: 27124
2006-03-25 21:54:21 +00:00
Jim Laskey
5a27f03274 Cast instruction not inserted into basic block.
llvm-svn: 27122
2006-03-25 18:40:47 +00:00
Evan Cheng
875c895b0f Added missing (any_extend (load ...)) patterns.
llvm-svn: 27120
2006-03-25 09:45:48 +00:00
Evan Cheng
e5807f6b47 Build arbitrary vector with more than 2 distinct scalar elements with a
series of unpack and interleave ops.

llvm-svn: 27119
2006-03-25 09:37:23 +00:00
Chris Lattner
d2823658b4 implement a bunch of intrinsics
llvm-svn: 27118
2006-03-25 08:01:02 +00:00
Chris Lattner
cb5f9269a9 Move all Altivec stuff out into a new PPCInstrAltivec.td file.
Add a bunch of patterns for different datatypes, e.g. bit_convert, undef and
zero vector support.

llvm-svn: 27117
2006-03-25 07:51:43 +00:00
Chris Lattner
57064915a6 Add some basic patterns for other datatypes
llvm-svn: 27116
2006-03-25 07:39:07 +00:00
Chris Lattner
7f5fba9c67 add all supported formats to the vector register file
llvm-svn: 27115
2006-03-25 07:36:56 +00:00
Chris Lattner
2fa3a6c436 Add support for __builtin_altivec_vnmsubfp /vmaddfp
llvm-svn: 27112
2006-03-25 07:05:55 +00:00
Chris Lattner
e199d55073 #include Intrinsics.h into all dag isels
llvm-svn: 27109
2006-03-25 06:47:10 +00:00
Chris Lattner
b014b3c7ab Implement Intrinsic::getName
llvm-svn: 27108
2006-03-25 06:32:47 +00:00
Chris Lattner
0899b16b2d Codegen things like:
<int -1, int -1, int -1, int -1>
and
 <int 65537, int 65537, int 65537, int 65537>

Using things like:
  vspltisb v0, -1
and:
  vspltish v0, 1

instead of using constant pool loads.

This implements CodeGen/PowerPC/vec_splat.ll:splat_imm_i{32|16}.

llvm-svn: 27106
2006-03-25 06:12:06 +00:00
Evan Cheng
8601147e68 Added SSE cachebility ops
llvm-svn: 27103
2006-03-25 06:03:26 +00:00
Evan Cheng
cad90504fe Instruction encoding bug
llvm-svn: 27102
2006-03-25 06:00:03 +00:00
Chris Lattner
b0e8c6dd7f Add new intrinsic node definitions for tblgen use
llvm-svn: 27100
2006-03-25 02:29:35 +00:00
Evan Cheng
234090b386 Added 128-bit packed integer subtraction.
llvm-svn: 27096
2006-03-25 01:33:37 +00:00
Evan Cheng
b280b34497 Added CVTTPS2PI.
llvm-svn: 27095
2006-03-25 01:31:59 +00:00
Evan Cheng
041c9c534b Added CVTSS2SI.
llvm-svn: 27094
2006-03-25 01:00:18 +00:00
Evan Cheng
bdb85b387f Support for scalar to vector with zero extension.
llvm-svn: 27091
2006-03-24 23:15:12 +00:00
Chris Lattner
1e4694ed84 fix inverted conditional
llvm-svn: 27089
2006-03-24 22:49:42 +00:00
Jim Laskey
37a8c245ce D'oh - should be even numbered.
llvm-svn: 27088
2006-03-24 22:48:02 +00:00
Evan Cheng
33dad39b46 Added LDMXCSR
llvm-svn: 27087
2006-03-24 22:28:37 +00:00
Chris Lattner
2d08e8aee1 plug the intrinsics into the patterns for movmsk*
llvm-svn: 27083
2006-03-24 21:49:18 +00:00
Jim Laskey
1716e53341 Add dwarf register numbering to register data.
llvm-svn: 27081
2006-03-24 21:15:58 +00:00
Jim Laskey
d577317f38 Add support for dwarf register numbering.
llvm-svn: 27080
2006-03-24 21:13:21 +00:00
Jim Laskey
a39264632c Hack no more.
llvm-svn: 27079
2006-03-24 21:10:36 +00:00
Chris Lattner
8840036091 add another note
llvm-svn: 27077
2006-03-24 20:04:27 +00:00
Chris Lattner
045f6bf0ef add a note
llvm-svn: 27076
2006-03-24 19:59:17 +00:00
Chris Lattner
b979b51e39 Shuffle some includes around
llvm-svn: 27073
2006-03-24 18:52:35 +00:00
Evan Cheng
ff1db97bca 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
8e14f3544b expose intrinsic info to the targets.
llvm-svn: 27070
2006-03-24 18:44:11 +00:00
Chris Lattner
21abff3712 Fix a bad JIT encoding of VPERM. Why is VPERM D,A,B,C but vfmadd is D,A,C,B ??
llvm-svn: 27069
2006-03-24 18:24:43 +00:00
Chris Lattner
3133dafd4b Like the comment says, prefer to use the implicit add done by [r+r] addressing
modes than emitting an explicit add and using a base of r0.  This implements
Regression/CodeGen/PowerPC/mem-rr-addr-mode.ll

llvm-svn: 27068
2006-03-24 17:58:06 +00:00
Jim Laskey
704b1e07a3 Fix indent.
llvm-svn: 27065
2006-03-24 10:08:23 +00:00
Jim Laskey
06c78bb995 Clean up some commentary.
llvm-svn: 27064
2006-03-24 10:00:56 +00:00
Jim Laskey
0d63725a26 Rename for truth in advertising.
llvm-svn: 27063
2006-03-24 09:50:27 +00:00
Chris Lattner
303dc30593 Disable the i32->float G5 optimization. It is unsafe, as documented in the
comment.

This fixes 177.mesa, and McCat/09-vor with the td scheduler.

llvm-svn: 27060
2006-03-24 07:53:47 +00:00
Chris Lattner
ba4966c16c add support for using vxor to build zero vectors. This implements
Regression/CodeGen/PowerPC/vec_zero.ll

llvm-svn: 27059
2006-03-24 07:48:08 +00:00
Evan Cheng
d58d54cf3e Handle BUILD_VECTOR with all zero elements.
llvm-svn: 27056
2006-03-24 07:29:27 +00:00
Chris Lattner
62b04677c0 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
b2b32e9283 fix spello
llvm-svn: 27053
2006-03-24 07:15:07 +00:00
Chris Lattner
826dbd7173 Fix spello
llvm-svn: 27052
2006-03-24 07:14:34 +00:00
Chris Lattner
37951daad5 add the actual cost to the debug info
llvm-svn: 27051
2006-03-24 07:14:00 +00:00
Chris Lattner
ace2d0d227 Gabor points out that we can't spell. :)
llvm-svn: 27049
2006-03-24 07:12:19 +00:00
Evan Cheng
8507228441 All v2f64 shuffle cases can be handled.
llvm-svn: 27044
2006-03-24 06:40:32 +00:00
Evan Cheng
3028b04057 More efficient v2f64 shuffle using movlhps, movhlps, unpckhpd, and unpcklpd.
llvm-svn: 27040
2006-03-24 02:58:06 +00:00
Evan Cheng
184c4b937e A new entry
llvm-svn: 27039
2006-03-24 02:57:03 +00:00
Jeff Cohen
dab30f45d8 Get JIT/Interpreter working on Windows again.
llvm-svn: 27037
2006-03-24 02:53:49 +00:00
Chris Lattner
f7ceb5fdd4 legalize vbit_convert nodes whose result is a legal type.
Legalize intrinsic nodes.

llvm-svn: 27036
2006-03-24 02:26:29 +00:00
Chris Lattner
041588d953 Lower target intrinsics into an INTRINSIC node
llvm-svn: 27035
2006-03-24 02:22:33 +00:00
Reid Spencer
845084b469 Ignore the burg output files.
llvm-svn: 27033
2006-03-24 02:21:35 +00:00
Chris Lattner
3c7f31ad32 fix some bogus assertions: noop bitconverts are legal
llvm-svn: 27032
2006-03-24 02:20:47 +00:00
Evan Cheng
68410804f0 Handle more shuffle cases with SHUFP* instructions.
llvm-svn: 27024
2006-03-24 01:18:28 +00:00
Evan Cheng
a54a9fbe05 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
c5c9034e7f Identify the INTRINSIC node
llvm-svn: 27020
2006-03-24 01:04:30 +00:00
Reid Spencer
69e6b844d6 Add new generated files.
llvm-svn: 27013
2006-03-23 23:48:12 +00:00
Evan Cheng
7528344998 Typo
llvm-svn: 27008
2006-03-23 23:24:51 +00:00
Jim Laskey
27e9f1bfa5 Unneeded forward.
llvm-svn: 27004
2006-03-23 23:05:52 +00:00
Jim Laskey
4ab13dc9be Make sure types are allocated in the scope of their use.
llvm-svn: 27002
2006-03-23 23:02:34 +00:00
Chris Lattner
2e5162fa6e add a note
llvm-svn: 27000
2006-03-23 21:28:44 +00:00
Chris Lattner
175ac8ea20 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
Evan Cheng
daa75ed684 Typo
llvm-svn: 26997
2006-03-23 20:26:04 +00:00
Jim Laskey
6e1c75ab01 Add some more bulletproofing to auto upgrade of llvm.dbg intrinsics.
llvm-svn: 26996
2006-03-23 20:13:25 +00:00
Chris Lattner
974982c89c Add PPC vector bit-convert support
llvm-svn: 26995
2006-03-23 19:54:27 +00:00
Jim Laskey
cec9c18c62 Add support to locate local variables in frames (early version.)
llvm-svn: 26994
2006-03-23 18:12:57 +00:00
Jim Laskey
88493ace30 Strip changes to llvm.dbg intrinsics.
llvm-svn: 26993
2006-03-23 18:11:33 +00:00
Jim Laskey
5df6eab07d Can't combine anymore - we don't have a chain through llvm.dbg intrinsics.
llvm-svn: 26992
2006-03-23 18:10:42 +00:00
Jim Laskey
f3cc740d75 Change interface to DwarfWriter.
llvm-svn: 26991
2006-03-23 18:09:44 +00:00
Jim Laskey
f47cb47216 Modify how CBE handles #lines.
llvm-svn: 26990
2006-03-23 18:08:29 +00:00
Jim Laskey
867301543c Generate local variable and scope information and equivalent dwarf forms.
llvm-svn: 26989
2006-03-23 18:07:55 +00:00
Jim Laskey
b0ebfecdbf Handle new forms of llvm.dbg intrinsics.
llvm-svn: 26988
2006-03-23 18:06:46 +00:00
Jim Laskey
47de3793e3 Simplify handling of llvm.dbg intrinsic operands to one spot.
llvm-svn: 26987
2006-03-23 18:05:12 +00:00
Jim Laskey
570a3973ab Change the argument types of llvm.dbg intrinsics.
llvm-svn: 26985
2006-03-23 18:03:20 +00:00
Chris Lattner
ec3f1b5cd1 Fix the encodings of these new instructions, hopefully fixing the JIT
failures from last night

llvm-svn: 26981
2006-03-23 16:13:50 +00:00
Evan Cheng
a6dc6e535d Following icc's lead: use movdqa to load / store 128-bit integer vectors
llvm-svn: 26980
2006-03-23 07:44:07 +00:00
Chris Lattner
56a6600a72 prune #includes
llvm-svn: 26975
2006-03-23 05:43:58 +00:00
Chris Lattner
89e0790edb Eliminate IntrinsicLowering from TargetMachine.
Make the CBE and V9 backends create their own, since they're the only ones that use it.

llvm-svn: 26974
2006-03-23 05:43:16 +00:00
Chris Lattner
7db942251a simplify some code
llvm-svn: 26972
2006-03-23 05:29:04 +00:00
Chris Lattner
3d5ca510c9 remove always-null IntrinsicLowering argument.
llvm-svn: 26971
2006-03-23 05:28:02 +00:00
Chris Lattner
2aa3f9a6b5 remove the intrinsiclowering hook
llvm-svn: 26970
2006-03-23 05:22:51 +00:00
Evan Cheng
c1fe87ea8b Add v4i32 <-> v4f32 bitconvert patterns.
llvm-svn: 26969
2006-03-23 02:36:37 +00:00
Evan Cheng
5f7cf963db Add 128-bit integer vector load and add (for testing).
llvm-svn: 26967
2006-03-23 01:57:24 +00:00
Nate Begeman
0ec15cd042 Add support for 8 bit immediates with 16/32 bit cmp instructions
llvm-svn: 26966
2006-03-23 01:29:48 +00:00
Chris Lattner
2ef03f3a43 Fix a typo
llvm-svn: 26965
2006-03-22 22:20:49 +00:00
Evan Cheng
54215cd1ea Added a ValueType operand to isShuffleMaskLegal(). For now, x86 will not do
64-bit vector shuffle.

llvm-svn: 26964
2006-03-22 22:07:06 +00:00
Chris Lattner
7eaf8fa583 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
Evan Cheng
56b67b2c4f SHUFP* are two address code.
llvm-svn: 26959
2006-03-22 20:08:18 +00:00
Evan Cheng
7cb4e14749 Some clean up.
llvm-svn: 26957
2006-03-22 19:22:18 +00:00
Evan Cheng
ae6a39ea92 - Supposely movlhps is faster / better than unpcklpd.
- Don't forget pshufd is only available with sse2.

llvm-svn: 26956
2006-03-22 19:16:21 +00:00
Evan Cheng
cff38e19c3 - Implement X86ISelLowering::isShuffleMaskLegal(). We currently only support
splat and PSHUFD cases.
- Clean up shuffle / splat matching code.

llvm-svn: 26954
2006-03-22 18:59:22 +00:00
Chris Lattner
a779db7473 silence a bogus gcc warning
llvm-svn: 26953
2006-03-22 17:27:24 +00:00
Evan Cheng
f6dc0a7f5e - VECTOR_SHUFFLE of v4i32 / v4f32 with undef second vector always matches
PSHUFD. We can make permutes entries which point to the undef pointing
  anything we want.
- Change some names to appease Chris.

llvm-svn: 26951
2006-03-22 08:01:21 +00:00
Chris Lattner
64be951e06 add a note
llvm-svn: 26950
2006-03-22 07:33:46 +00:00
Evan Cheng
25440d19b1 Fix PSHUF* and SHUF* jit code emission problems
llvm-svn: 26949
2006-03-22 07:10:28 +00:00
Chris Lattner
ab22cd5c33 Eliminate the dependency of ExecutionEngine on the JIT/Interpreter libraries.
Now you can build a tool with just the JIT or just the interpreter.

llvm-svn: 26946
2006-03-22 06:07:50 +00:00
Chris Lattner
5141ebb2c4 This has been implemented. Tweak it into another note
llvm-svn: 26944
2006-03-22 05:33:23 +00:00
Chris Lattner
f84f3bf95b When possible, custom lower 32-bit SINT_TO_FP to this:
_foo2:
        extsw r2, r3
        std r2, -8(r1)
        lfd f0, -8(r1)
        fcfid f0, f0
        frsp f1, f0
        blr

instead of this:

_foo2:
        lis r2, ha16(LCPI2_0)
        lis r4, 17200
        xoris r3, r3, 32768
        stw r3, -4(r1)
        stw r4, -8(r1)
        lfs f0, lo16(LCPI2_0)(r2)
        lfd f1, -8(r1)
        fsub f0, f1, f0
        frsp f1, f0
        blr

This speeds up Misc/pi from 2.44s->2.09s with LLC and from 3.01->2.18s
with llcbeta (16.7% and 38.1% respectively).

llvm-svn: 26943
2006-03-22 05:30:33 +00:00
Chris Lattner
cfbce5186a Add support for "ri" addressing modes where the immediate is a 14-bit field
which is shifted left two bits before use.  Instructions like STD use this
addressing mode.

llvm-svn: 26942
2006-03-22 05:26:03 +00:00
Chris Lattner
1554bf155e fix a warning
llvm-svn: 26941
2006-03-22 04:18:34 +00:00
Evan Cheng
7aac4350c7 Some splat and shuffle support.
llvm-svn: 26940
2006-03-22 02:53:00 +00:00
Evan Cheng
b6c46ed8c9 Add a couple more pseudo instructions.
llvm-svn: 26939
2006-03-22 02:52:03 +00:00
Chris Lattner
c8696247e5 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
2e606dc60f Fix the JIT encoding of the VAForm_1 instructions, including vmaddfp
llvm-svn: 26935
2006-03-22 01:44:36 +00:00
Chris Lattner
51b4436cce Enclose some variables in a scope to avoid error with some gcc versions
llvm-svn: 26934
2006-03-22 00:12:37 +00:00
Evan Cheng
7c8d7bc4b3 Didn't mean to check this in. No MMX support yet.
llvm-svn: 26933
2006-03-21 23:04:23 +00:00
Evan Cheng
47dd756c72 - Use movaps to store 128-bit vector integers.
- Each scalar to vector v8i16 and v16i8 is a any_extend followed by a movd.

llvm-svn: 26932
2006-03-21 23:01:21 +00:00
Chris Lattner
12e4b95b6b add expand support for extractelement
llvm-svn: 26931
2006-03-21 21:02:03 +00:00
Chris Lattner
31a93c7740 These targets don't support EXTRACT_VECTOR_ELT, though, in time, X86 will.
llvm-svn: 26930
2006-03-21 20:51:05 +00:00
Chris Lattner
b90d9241c1 add some trivial support for extractelement.
llvm-svn: 26928
2006-03-21 20:44:12 +00:00
Chris Lattner
140be98ab8 Don't emit pseudo instructions!
llvm-svn: 26926
2006-03-21 20:19:37 +00:00
Chris Lattner
128089ae91 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
Nate Begeman
4bd73df4bd Update readme
llvm-svn: 26924
2006-03-21 18:58:20 +00:00
Chris Lattner
414fed4108 Print absolute memory references like this:
lwz r2, 8(0)
instead of this:
       lwz r2, 8(r0)

This fixes the llc/llc-beta failures on PPC last night.

llvm-svn: 26922
2006-03-21 17:21:13 +00:00
Evan Cheng
a56ed39464 Combine 2 entries
llvm-svn: 26921
2006-03-21 07:18:26 +00:00
Evan Cheng
f8d8d45ff8 Add a note about x86 register coallescing
llvm-svn: 26920
2006-03-21 07:12:57 +00:00
Evan Cheng
6ec225863c - Remove scalar to vector pseudo ops. They are just wrong.
- Handle FR32 to VR128:v4f32 and FR64 to VR128:v2f64 with aliases of MOVAPS
and MOVAPD. Mark them as move instructions and *hope* they will be deleted.

llvm-svn: 26919
2006-03-21 07:09:35 +00:00
Chris Lattner
6417236c41 With Evan's latest tblgen patch, this code is obsolete, thanks Evan!
llvm-svn: 26917
2006-03-21 06:37:40 +00:00
Chris Lattner
acb2506622 When codegen'ing vector MUL using VFMADD, *add* the 0, don't *mul* the 0.
llvm-svn: 26913
2006-03-21 00:51:38 +00:00
Chris Lattner
9e611a25c7 minor note
llvm-svn: 26912
2006-03-21 00:47:09 +00:00
Evan Cheng
a4db61ddc1 x86 ISD::SCALAR_TO_VECTOR support.
llvm-svn: 26911
2006-03-21 00:33:35 +00:00
Evan Cheng
d90127aafd Junk unused vector register classes.
llvm-svn: 26910
2006-03-21 00:30:59 +00:00
Chris Lattner
cdc4657988 Handle constant addresses more efficiently, folding the low bits into the
disp field of the load/store if possible.  This compiles
CodeGen/PowerPC/load-constant-addr.ll to:

_test:
        lis r2, 2838
        lfs f1, 26848(r2)
        blr

instead of:

_test:
        lis r2, 2838
        ori r2, r2, 26848
        lfs f1, 0(r2)
        blr

llvm-svn: 26908
2006-03-20 22:38:22 +00:00
Chris Lattner
a498dd25d9 remove dead variable
llvm-svn: 26907
2006-03-20 22:37:23 +00:00
Chris Lattner
978628896b Fix a couple of bugs in permute/splat generate, thanks to Nate for actually
figuring these out! :)

llvm-svn: 26904
2006-03-20 18:26:51 +00:00
Chris Lattner
5c994b8c63 reenable this hack, the tblgen version isn't quite ready
llvm-svn: 26902
2006-03-20 17:54:43 +00:00
Chris Lattner
fb0e160aa5 Fix the pattern for VADDUWM, add i32 splat
llvm-svn: 26901
2006-03-20 17:51:58 +00:00
Evan Cheng
57da1afbc8 Use tblgen'd VECTOR_SHUFFLE selection code.
llvm-svn: 26900
2006-03-20 08:14:16 +00:00
Chris Lattner
dc3605efdb Add support for generating vspltw, instead of a vperm instruction with a
constant pool load.  This generates significantly nicer code for splats.

When tblgen gets bugfixed, we can remove the custom selection code.

llvm-svn: 26898
2006-03-20 06:51:10 +00:00
Chris Lattner
8faa2cf693 Implement PPC::isSplatShuffleMask and PPC::getVSPLTImmediate.
llvm-svn: 26897
2006-03-20 06:37:44 +00:00
Chris Lattner
4b7aa59bbc fix duplicate definition errors
llvm-svn: 26896
2006-03-20 06:33:01 +00:00
Chris Lattner
09ede9ec9f Add a build_vector node
llvm-svn: 26895
2006-03-20 06:18:01 +00:00
Chris Lattner
1cdeda1c5a Check in some intermediate code that adds a skeleton for matching vsplt*
instructions

llvm-svn: 26894
2006-03-20 06:15:45 +00:00
Evan Cheng
c63d434203 Move a few things around.
llvm-svn: 26893
2006-03-20 06:04:52 +00:00
Chris Lattner
5892479894 add vector_shuffle
llvm-svn: 26891
2006-03-20 05:40:45 +00:00
Chris Lattner
c230af9810 fix typo
llvm-svn: 26889
2006-03-20 05:05:55 +00:00
Chris Lattner
bea056ecf2 add vsplat instructions, fix sched description for vperm
llvm-svn: 26888
2006-03-20 04:47:33 +00:00
Chris Lattner
0e56cf0d94 Custom lower arbitrary VECTOR_SHUFFLE's to VPERM.
TODO: leave specific ones as VECTOR_SHUFFLE's and turn them into specialized
operations like vsplt*

llvm-svn: 26887
2006-03-20 01:53:53 +00:00
Chris Lattner
65e6e12dca Claim to have v16i8 for perm masks
llvm-svn: 26886
2006-03-20 01:53:02 +00:00
Chris Lattner
9fd8618130 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
9fc969612c TargetData doesn't know the alignment of vectors :(
llvm-svn: 26884
2006-03-20 01:51:46 +00:00
Chris Lattner
6f502da274 add the vperm instruction
llvm-svn: 26883
2006-03-20 01:00:56 +00:00
Chris Lattner
529a9121d4 Add very basic support for VECTOR_SHUFFLE
llvm-svn: 26880
2006-03-19 23:56:04 +00:00
Chris Lattner
9a87d3e90d add a note with a testcase
llvm-svn: 26877
2006-03-19 22:27:41 +00:00
Chris Lattner
ada41aad4d Add a note about the MUL -> FMADD vector bug.
llvm-svn: 26874
2006-03-19 22:08:08 +00:00
Chris Lattner
986357c54c Teach cee to propagate through switch statements. This implements
Transforms/CorrelatedExprs/switch.ll

Patch contributed by Eric Kidd!

llvm-svn: 26872
2006-03-19 19:37:24 +00:00
Evan Cheng
cc1e38c242 Vector undef's
llvm-svn: 26870
2006-03-19 09:38:54 +00:00
Chris Lattner
789570bafb Custom lower SCALAR_TO_VECTOR into lve*x.
llvm-svn: 26868
2006-03-19 06:55:52 +00:00
Chris Lattner
2144db7a6c Allow SCALAR_TO_VECTOR to be custom lowered.
llvm-svn: 26867
2006-03-19 06:47:21 +00:00
Chris Lattner
6bb71c2ebd Add SCALAR_TO_VECTOR support
llvm-svn: 26866
2006-03-19 06:31:19 +00:00
Chris Lattner
80f9f7138a PPC doesn't have SCALAR_TO_VECTOR
llvm-svn: 26865
2006-03-19 06:17:19 +00:00
Chris Lattner
89bc332152 add support for vector undef
llvm-svn: 26863
2006-03-19 06:10:09 +00:00
Evan Cheng
9f00d55227 Remind us of exit value substitution
llvm-svn: 26862
2006-03-19 06:09:23 +00:00
Evan Cheng
99327f9351 Turning on LSR by default
llvm-svn: 26861
2006-03-19 06:08:49 +00:00
Evan Cheng
98b79bf7ec Remember which tests are hurt by LSR.
llvm-svn: 26860
2006-03-19 06:08:11 +00:00
Chris Lattner
6c7486ff4d Don't bother storing undef elements of BUILD_VECTOR's
llvm-svn: 26858
2006-03-19 05:46:04 +00:00
Chris Lattner
a9b4a2ab99 minor fixes
llvm-svn: 26857
2006-03-19 05:43:01 +00:00
Chris Lattner
d3910ca755 notes
llvm-svn: 26856
2006-03-19 05:33:30 +00:00
Chris Lattner
b46a4c28ad we don't use lmw/stmw. When we want them they are easy enough to add
llvm-svn: 26853
2006-03-19 04:33:37 +00:00
Chris Lattner
52a132ab18 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
c9c081fc40 fold insertelement(buildvector) -> buildvector if the inserted element # is
a constant.  This implements test_constant_insert in CodeGen/Generic/vector.ll

llvm-svn: 26851
2006-03-19 01:27:56 +00:00
Chris Lattner
bf4033f63a implement basic support for INSERT_VECTOR_ELT.
llvm-svn: 26849
2006-03-19 01:17:20 +00:00
Chris Lattner
1bd0aaf2b8 rename these nodes
llvm-svn: 26848
2006-03-19 01:13:28 +00:00
Chris Lattner
db243940bd 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
855e3c878b implement vector.ll:test_undef
llvm-svn: 26845
2006-03-19 00:20:20 +00:00
Chris Lattner
367f9aef95 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
Evan Cheng
7955a187b1 - Fixed a bogus if condition.
- Added more debugging info.
- Allow reuse of IV of negative stride. e.g. -4 stride == 2 * iv of -2 stride.

llvm-svn: 26841
2006-03-18 08:03:12 +00:00
Chris Lattner
35b6933508 Change the structure of lowering vector stuff. Note: This breaks some
things.

llvm-svn: 26840
2006-03-18 01:44:44 +00:00
Evan Cheng
8dd794ea70 Use the generic vector register classes VR64 / VR128 rather than V4F32,
V8I16, etc.

llvm-svn: 26838
2006-03-18 01:23:20 +00:00
Evan Cheng
afe1ee3496 Sort StrideOrder so we can process the smallest strides first. This allows
for more IV reuses.

llvm-svn: 26837
2006-03-18 00:44:49 +00:00
Nate Begeman
793c8136ae Fix subfic to match subc by default instead of sub so that it is correctly
cost-modeled as producing a flag.  This fixes the test I just added for neg

llvm-svn: 26835
2006-03-17 22:41:37 +00:00
Evan Cheng
f4774c9091 Darwin should use _setjmp/_longjmp instead of setjmp/longjmp.
llvm-svn: 26833
2006-03-17 20:31:41 +00:00
Evan Cheng
ee1a44d5d8 Move some pattern fragments to the right files.
llvm-svn: 26831
2006-03-17 19:55:52 +00:00
Chris Lattner
3358842eb5 add a couple enum values
llvm-svn: 26830
2006-03-17 19:53:59 +00:00
Evan Cheng
fa1b885135 Allow users of iv / stride to be rewritten with expression that is a multiply
of a smaller stride even if they have a common loop invariant expression part.

llvm-svn: 26828
2006-03-17 19:52:23 +00:00
Chris Lattner
647503bccc Disable x86 fastcc from passing args in registers
llvm-svn: 26824
2006-03-17 17:27:47 +00:00
Reid Spencer
5f06b17693 Fix use of LEVEL.
llvm-svn: 26822
2006-03-17 07:39:44 +00:00
Reid Spencer
86ed2295c0 Two fixes:
1. Allow building of Intrinsics.gen to work for srcdir != objdir
2. Add a rule for installation of Intrinsics.gen.

llvm-svn: 26819
2006-03-17 06:27:06 +00:00
Chris Lattner
a71bc63ced Parameterize the number of integer arguments to pass in registers
llvm-svn: 26818
2006-03-17 05:10:20 +00:00
Evan Cheng
1f5cb60f28 Also fold MOV8r0, MOV16r0, MOV32r0 + store to MOV8mi, MOV16mi, and MOV32mi.
llvm-svn: 26817
2006-03-17 02:36:22 +00:00
Evan Cheng
fc79bdafbe Add some missing entries to X86RegisterInfo::foldMemoryOperand(). e.g.
ADD32ri8.

llvm-svn: 26816
2006-03-17 02:25:01 +00:00
Evan Cheng
d16fa97974 - Nuke 16-bit SBB instructions. We'll never use them.
- Nuke a bogus comment.

llvm-svn: 26815
2006-03-17 02:24:04 +00:00
Nate Begeman
42736d46b2 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
87dbd49cbe remove dead variable
llvm-svn: 26813
2006-03-16 23:52:08 +00:00
Chris Lattner
7e80a5a16b Fix a problem fully scalarizing values.
llvm-svn: 26811
2006-03-16 23:05:19 +00:00
Evan Cheng
33055a8aba A new entry.
llvm-svn: 26810
2006-03-16 22:44:22 +00:00
Nate Begeman
63c4456867 Notes on how to kill the eeevil brtwoway, and make ppc branch selector
more target independant, generate better code, and be less conservative.

llvm-svn: 26809
2006-03-16 22:37:48 +00:00
Chris Lattner
f2008cb73b Strangely, calls clobber call-clobbered vector regs. Whodathoughtit?
llvm-svn: 26808
2006-03-16 22:35:59 +00:00
Chris Lattner
8a756c5171 add a note
llvm-svn: 26807
2006-03-16 22:25:55 +00:00
Chris Lattner
57773fdac1 teach the ppc backend how to spill/reload vector regs
llvm-svn: 26806
2006-03-16 22:24:02 +00:00
Chris Lattner
661ee5d3c1 add callee saved vector regs
llvm-svn: 26805
2006-03-16 22:07:06 +00:00
Evan Cheng
0e1abe6e19 Bug fix: condition inverted.
llvm-svn: 26804
2006-03-16 22:02:48 +00:00
Evan Cheng
db35180b27 For each loop, keep track of all the IV expressions inserted indexed by
stride. For a set of uses of the IV of a stride which is a multiple
of another stride, do not insert a new IV expression. Rather, reuse the
previous IV and rewrite the uses as uses of IV expression multiplied by
the factor.

e.g.
x = 0 ...; x ++
y = 0 ...; y += 4
then use of y can be rewritten as use of 4*x for x86.

llvm-svn: 26803
2006-03-16 21:53:05 +00:00
Evan Cheng
cad75d9f0c Added a way for TargetLowering to specify what values can be used as the
scale component of the target addressing mode.

llvm-svn: 26802
2006-03-16 21:47:42 +00:00
Chris Lattner
7f5361757b in functions that use a lot of callee saved regs, this can be more than
5 instructions away.

llvm-svn: 26801
2006-03-16 21:31:45 +00:00
Chris Lattner
bf153651b1 Add support for copying registers. still needed: spilling and reloading them
llvm-svn: 26800
2006-03-16 20:03:58 +00:00
Chris Lattner
413bb13b27 Add support for CopyFromReg from vector values. Note: this doesn't support
illegal vector types yet!

llvm-svn: 26799
2006-03-16 19:57:50 +00:00
Chris Lattner
34f2e70f60 Teach CreateRegForValue how to handle vector types.
llvm-svn: 26798
2006-03-16 19:51:18 +00:00
Chris Lattner
eac8e98036 set TransformToType correctly for vector types.
llvm-svn: 26797
2006-03-16 19:50:01 +00:00
Nate Begeman
cbca1b3d14 Another case we could do better on.
llvm-svn: 26795
2006-03-16 18:50:44 +00:00
Chris Lattner
b5d0896994 Save/restore VRSAVE once per function, not once per block.
llvm-svn: 26793
2006-03-16 18:25:23 +00:00
Chris Lattner
4fd1599ab1 add support for the bitconvert node
llvm-svn: 26789
2006-03-16 01:29:53 +00:00
Chris Lattner
95577cb3cd add support for vector->vector casts
llvm-svn: 26788
2006-03-15 22:19:46 +00:00
Chris Lattner
7c8518a21d 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
b26656cc15 Teach the strip pass to strip type names in addition to value names. This
is fallout from the type/value split in the symtab long long ago :)

llvm-svn: 26785
2006-03-15 19:22:41 +00:00
Jim Laskey
f6494d753a Expand subprogram and added block descriptor.
llvm-svn: 26782
2006-03-15 19:09:58 +00:00
Andrew Lenharth
fc55d15963 no heap is happening here
llvm-svn: 26781
2006-03-15 19:03:16 +00:00
Andrew Lenharth
b377837353 remove qsort for now
llvm-svn: 26779
2006-03-15 18:32:18 +00:00
Andrew Lenharth
ad29f8dfab allow field sensitivity to be a tunable parameter
llvm-svn: 26777
2006-03-15 05:43:41 +00:00
Nate Begeman
e371cb595a Update scheduling info for vrsave instruction
llvm-svn: 26776
2006-03-15 05:25:05 +00:00
Andrew Lenharth
c285b5ff1f Handle one offset with growth case seen in povray. Namely, if we have an offset,
and the offset lands at a field boundary in the old type, construct a new type,
copying the fields masked by the offset from the old type, and unify with that.

llvm-svn: 26775
2006-03-15 04:04:21 +00:00
Andrew Lenharth
f3e73e10cf improve mem intrinsics and add a few things povray uses
llvm-svn: 26774
2006-03-15 03:43:59 +00:00
Chris Lattner
a5dfe68ee9 Bugfix, unbreaking CodeGen/PowerPC/cttz.ll
llvm-svn: 26764
2006-03-14 19:49:57 +00:00
Chris Lattner
981c57fdbd Fix an et-forest memory leak. Patch by Daniel Berlin.
llvm-svn: 26763
2006-03-14 19:41:45 +00:00
Chris Lattner
9df7eb4071 add a note
llvm-svn: 26762
2006-03-14 19:31:24 +00:00
Jim Laskey
864fb2f799 1. Use null for serialized empty strings.
2. Allow for user defined debug descriptors.
3. Allow for user augmented fields on debug descriptors.

llvm-svn: 26760
2006-03-14 18:37:57 +00:00
Chris Lattner
392087f5bd Fix an off by one error that caused PPC LLC failures last night.
llvm-svn: 26758
2006-03-14 17:56:49 +00:00
Chris Lattner
92090188c3 Implement a FIXME, recusively reassociating
A*A*B + A*A*C   -->   A*(A*B+A*C)   -->   A*(A*(B+C))

This implements Reassociate/mul-factor3.ll

llvm-svn: 26757
2006-03-14 16:04:29 +00:00
Chris Lattner
9ccb2201b8 extract some code into a method, no functionality change
llvm-svn: 26755
2006-03-14 07:11:11 +00:00
Chris Lattner
80c5fabe4e transformation implemented
llvm-svn: 26754
2006-03-14 06:57:34 +00:00
Chris Lattner
0e3d81d8ff Promote shifts by a constant to multiplies so that we can reassociate
(x<<1)+(y<<1) -> (X+Y)<<1.  This implements
Transforms/Reassociate/shift-factor.ll

llvm-svn: 26753
2006-03-14 06:55:18 +00:00
Reid Spencer
728a2e9f62 Convert llvm.cs.uiuc.edu -> llvm.org
llvm-svn: 26748
2006-03-14 05:54:52 +00:00
Jim Laskey
11f7fe9fe5 1. Handle removal of all arguments for a morphed intrinsic.
2. Remove the declaration of llvm.dbg.declare.

llvm-svn: 26745
2006-03-14 02:00:35 +00:00
Evan Cheng
ae7469b2c5 PPC LSR pass should use target lowering hooks.
llvm-svn: 26743
2006-03-13 23:56:51 +00:00
Evan Cheng
7ec94f2ff7 Added getTargetLowering() to TargetMachine. Refactored targets to support this.
llvm-svn: 26742
2006-03-13 23:20:37 +00:00
Evan Cheng
99e87e9147 Update
llvm-svn: 26741
2006-03-13 23:19:10 +00:00
Evan Cheng
ed013bd937 Add LSR hooks.
llvm-svn: 26740
2006-03-13 23:18:16 +00:00
Evan Cheng
692235499c Added target lowering hooks which LSR consults to make more intelligent
transformation decisions.

llvm-svn: 26738
2006-03-13 23:14:23 +00:00
Chris Lattner
d5ecfd83f1 Handle builtins that directly correspond to GCC builtins.
llvm-svn: 26737
2006-03-13 23:09:05 +00:00
Chris Lattner
d0505331d2 For functions that use vector registers, save VRSAVE, mark used
registers, and update it on entry to each function, then restore it on exit.

This compiles:

void func(vfloat *a, vfloat *b, vfloat *c) {
        *a = *b * *c + *c;
}

to this:

_func:
        mfspr r2, 256
        oris r6, r2, 49152
        mtspr 256, r6
        lvx v0, 0, r5
        lvx v1, 0, r4
        vmaddfp v0, v1, v0, v0
        stvx v0, 0, r3
        mtspr 256, r2
        blr

GCC produces this (which has additional stack accesses):

_func:
        mfspr r0,256
        stw r0,-4(r1)
        oris r0,r0,0xc000
        mtspr 256,r0
        lvx v0,0,r5
        lvx v1,0,r4
        lwz r12,-4(r1)
        vmaddfp v0,v0,v1,v0
        stvx v0,0,r3
        mtspr 256,r12
        blr

llvm-svn: 26733
2006-03-13 21:52:10 +00:00
Chris Lattner
3b4ceba4ff make sure dead token factor nodes are removed by the dag combiner.
llvm-svn: 26731
2006-03-13 18:37:30 +00:00
Reid Spencer
ba5d13fd59 Bring makefile back into compliance with standard by using
$(Echo) instead of @echo

llvm-svn: 26730
2006-03-13 17:57:31 +00:00
Jim Laskey
c741139c24 Handle the removal of the debug chain.
llvm-svn: 26729
2006-03-13 13:07:37 +00:00
Chris Lattner
ea1453c3dc remove two implemented items
llvm-svn: 26728
2006-03-13 06:52:22 +00:00
Chris Lattner
3a3c8682b5 Fold X+Y -> X|Y when safe. This implements:
Regression/CodeGen/PowerPC/and_add.ll

a case that occurs with dynamic allocas of constant size.

llvm-svn: 26727
2006-03-13 06:51:27 +00:00
Chris Lattner
1782f3971d I can't convince myself that this is safe, remove the recursive call.
llvm-svn: 26725
2006-03-13 06:42:16 +00:00
Chris Lattner
9d0ebb55a6 add a couple of missing folds
llvm-svn: 26724
2006-03-13 06:26:26 +00:00
Chris Lattner
3cb122bfa8 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
3aff8e6acf Fix a couple of bugs that broke the alpha tester build
llvm-svn: 26722
2006-03-13 05:23:59 +00:00
Chris Lattner
9898674f99 Handle cracked instructions in dispatch group formation.
llvm-svn: 26721
2006-03-13 05:20:04 +00:00
Chris Lattner
ba10d4e4ab Mark instructions that are cracked by the PPC970 decoder as such.
llvm-svn: 26720
2006-03-13 05:15:10 +00:00
Chris Lattner
a278639f29 Several big changes:
1. Use flags on the instructions in the .td file to indicate the PPC970 unit
   type instead of a table in the .cpp file.  Much cleaner.
2. Change the hazard recognizer to build d-groups according to the actual
   algorithm used, not my flawed understanding of it.
3. Model "must be in the first slot" and "must be the only instr in a group"
   accurately.

llvm-svn: 26719
2006-03-12 09:13:49 +00:00
Chris Lattner
a54a9d83c3 Don't advance the hazard recognizer when there are no hazards and no instructions
to be emitted.

Don't add one to the latency of a completed instruction if the latency of the
op is 0.

llvm-svn: 26718
2006-03-12 09:01:41 +00:00
Chris Lattner
aea53fc36f Chain operands aren't real uses: they don't require the full latency of the
predecessor to finish before they can start.

llvm-svn: 26717
2006-03-12 03:52:09 +00:00
Chris Lattner
7396b82585 As a pending queue data structure to keep track of instructions whose
operands have all issued, but whose results are not yet available.  This
allows us to compile:

int G;
int test(int A, int B, int* P) {
   return (G+A)*(B+1);
}

to:

_test:
        lis r2, ha16(L_G$non_lazy_ptr)
        addi r4, r4, 1
        lwz r2, lo16(L_G$non_lazy_ptr)(r2)
        lwz r2, 0(r2)
        add r2, r2, r3
        mullw r3, r2, r4
        blr

instead of this, which has a stall between the lis/lwz:

_test:
        lis r2, ha16(L_G$non_lazy_ptr)
        lwz r2, lo16(L_G$non_lazy_ptr)(r2)
        addi r4, r4, 1
        lwz r2, 0(r2)
        add r2, r2, r3
        mullw r3, r2, r4
        blr

llvm-svn: 26716
2006-03-12 00:38:57 +00:00
Chris Lattner
62eafde9c1 rename priorityqueue -> availablequeue. When a node is scheduled, remember
which cycle it lands on.

llvm-svn: 26714
2006-03-11 22:44:37 +00:00
Chris Lattner
04ada12cb7 Make CurrCycle a local var instead of an instance var
llvm-svn: 26713
2006-03-11 22:34:41 +00:00
Chris Lattner
6a9861953b Move some methods around so that BU specific code is together, TD specific code
is together, and direction independent code is together.

llvm-svn: 26712
2006-03-11 22:28:35 +00:00
Chris Lattner
40c02c01a5 merge preds/chainpreds -> preds set
merge succs/chainsuccs -> succs set

This has no functionality change, simplifies the code, and reduces the size
of sunits.

llvm-svn: 26711
2006-03-11 22:24:20 +00:00
Chris Lattner
19b93158c1 blr is a branch too
llvm-svn: 26710
2006-03-11 21:49:49 +00:00
Chris Lattner
916761949b add an example
llvm-svn: 26709
2006-03-11 20:20:40 +00:00
Chris Lattner
115b1be710 add a note
llvm-svn: 26708
2006-03-11 20:17:08 +00:00
Nate Begeman
7c2afcfc02 Fix PR681 by using the standard Lengauer and Tarjan algorithm for dominator
set construction, rather than intersecting various std::sets.  This reduces
the memory usage for the testcase in PR681 from 496 to 26MB of ram on my
darwin system, and reduces the runtime from 32.8 to 0.8 seconds on a
2.5GHz G5.  This also enables future code sharing between Dom and PostDom
now that they share near-identical implementations.

llvm-svn: 26707
2006-03-11 02:20:46 +00:00
Evan Cheng
02418117e1 Doh!
llvm-svn: 26705
2006-03-11 00:13:10 +00:00
Evan Cheng
57c206232d Added a parameter to control whether Constant::getStringValue() would chop
off the result string at the first null terminator.

llvm-svn: 26704
2006-03-10 23:52:03 +00:00
Chris Lattner
f176c9ecac remove some dead code
llvm-svn: 26703
2006-03-10 23:14:22 +00:00
Chris Lattner
02e6c29ad2 scrape out bits of llvm-db
llvm-svn: 26701
2006-03-10 22:48:19 +00:00
Chris Lattner
ec8860221c Remove UnixLocalInferiorProcess: debugging via the JIT isn't a good idea.
Perhaps llvm-db will turn into a read debugger someday.

llvm-svn: 26700
2006-03-10 22:39:48 +00:00
Chris Lattner
2370965e55 teach the JIT to encode vector registers
llvm-svn: 26697
2006-03-10 20:19:50 +00:00
Chris Lattner
0a64d261e0 Move simple-selector-specific types to the simple selector.
llvm-svn: 26693
2006-03-10 07:51:18 +00:00
Chris Lattner
2024573f47 Simplify the interface to the schedulers, to not pass the selected heuristicin.
llvm-svn: 26692
2006-03-10 07:49:12 +00:00
Chris Lattner
da5f77e3cf Move some simple-sched-specific instance vars to the simple scheduler.
llvm-svn: 26690
2006-03-10 07:42:02 +00:00
Chris Lattner
ec2c5aa0bb prune #includes
llvm-svn: 26689
2006-03-10 07:37:35 +00:00
Chris Lattner
808cc02983 move some simple scheduler methods into the simple scheduler
llvm-svn: 26688
2006-03-10 07:35:21 +00:00
Chris Lattner
89a5a946f5 Make EmitNode take a SDNode instead of a NodeInfo*
llvm-svn: 26687
2006-03-10 07:28:36 +00:00
Chris Lattner
3f870d581e Move the VRBase field from NodeInfo to being a separate, explicit, map.
llvm-svn: 26686
2006-03-10 07:25:12 +00:00
Chris Lattner
a316d82d2a no need to build groups anymore
llvm-svn: 26684
2006-03-10 07:15:58 +00:00
Chris Lattner
e23afcfd6d Create SUnits directly from the SelectionDAG.
llvm-svn: 26683
2006-03-10 07:13:32 +00:00
Chris Lattner
ed528a5652 Push PrepareNodeInfo/IdentifyGroups down the inheritance hierarchy
llvm-svn: 26682
2006-03-10 06:34:51 +00:00
Chris Lattner
920325db0a Teach the latency scheduler some new tricks. In particular, to break ties,
keep track of a sense of "mobility", i.e. how many other nodes scheduling one
node will free up.  For something like this:

float testadd(float *X, float *Y, float *Z, float *W, float *V) {
  return (*X+*Y)*(*Z+*W)+*V;
}

For example, this makes us schedule *X then *Y, not *X then *Z.  The former
allows us to issue the add, the later only lets us issue other loads.

This turns the above code from this:

_testadd:
        lfs f0, 0(r3)
        lfs f1, 0(r6)
        lfs f2, 0(r4)
        lfs f3, 0(r5)
        fadds f0, f0, f2
        fadds f1, f3, f1
        lfs f2, 0(r7)
        fmadds f1, f0, f1, f2
        blr

into this:

_testadd:
        lfs f0, 0(r6)
        lfs f1, 0(r5)
        fadds f0, f1, f0
        lfs f1, 0(r4)
        lfs f2, 0(r3)
        fadds f1, f2, f1
        lfs f2, 0(r7)
        fmadds f1, f1, f0, f2
        blr

llvm-svn: 26680
2006-03-10 05:51:05 +00:00
Chris Lattner
1bb3ae8dae add an aggregate method for reinserting scheduled nodes, add a callback for
priority impls that want to be notified when a node is scheduled

llvm-svn: 26678
2006-03-10 04:32:49 +00:00
Jeff Cohen
5002cf68b4 Fix VC++ build breakage.
llvm-svn: 26676
2006-03-10 03:57:45 +00:00
Chris Lattner
a7d7a291d0 use autogenerated side-effect information
llvm-svn: 26673
2006-03-09 22:38:10 +00:00
Chris Lattner
f53321422d Use autogenerated mod/ref info for intrinsics.
llvm-svn: 26670
2006-03-09 22:31:29 +00:00
Chris Lattner
e428e4d828 Use the autogenerated intrinsic verifier
llvm-svn: 26667
2006-03-09 22:06:04 +00:00
Evan Cheng
471bd00cb5 Add option -enable-x86-lsr to enable x86 loop strength reduction pass.
llvm-svn: 26665
2006-03-09 21:51:28 +00:00
Chris Lattner
295e7870b4 Use the function name matcher autogenerated from the .td file.
llvm-svn: 26664
2006-03-09 20:35:01 +00:00
Chris Lattner
1768e6c7b3 This rule also depends on tblgen
llvm-svn: 26662
2006-03-09 20:29:41 +00:00
Chris Lattner
c08825d684 add a note
llvm-svn: 26661
2006-03-09 20:13:21 +00:00
Chris Lattner
dc7268f6a3 remove dbg_declare, it's not used yet.
llvm-svn: 26659
2006-03-09 20:02:42 +00:00
Chris Lattner
f7471a3621 silly case insensitive file systems...
llvm-svn: 26658
2006-03-09 19:55:06 +00:00
Chris Lattner
617ab88e17 Build intrinsics.gen from intrinsics.td
llvm-svn: 26657
2006-03-09 19:53:27 +00:00
Chris Lattner
f133cc059f autoupgrade memcpy/memmove/memset with signed counts.
CVS: ----------------------------------------------------------------------

llvm-svn: 26654
2006-03-09 18:42:10 +00:00
Andrew Lenharth
bbf38867f2 these are copies too
llvm-svn: 26653
2006-03-09 18:18:51 +00:00
Chris Lattner
e93eeb189f remove some now-dead code
llvm-svn: 26652
2006-03-09 18:07:49 +00:00
Andrew Lenharth
f124519fc8 fcopysign for mixed mode
llvm-svn: 26651
2006-03-09 17:56:33 +00:00
Chris Lattner
d00d6b4f23 back out my previous hack
llvm-svn: 26650
2006-03-09 17:48:46 +00:00
Andrew Lenharth
2d36f9d389 relax fcopysign
llvm-svn: 26649
2006-03-09 17:47:22 +00:00
Andrew Lenharth
e08d165146 alpha and llvm have different oppinions on which arg is the sign bit
llvm-svn: 26647
2006-03-09 17:41:50 +00:00
Chris Lattner
4fe39d8f9e remove temporary option
llvm-svn: 26646
2006-03-09 17:31:22 +00:00
Andrew Lenharth
25de2846c5 Alpha Scheduling classes
llvm-svn: 26643
2006-03-09 17:16:45 +00:00
Chris Lattner
f6937476d0 temporary hack to get the build working again, apparently a header
commit was forgotten

llvm-svn: 26642
2006-03-09 17:11:08 +00:00
Andrew Lenharth
c180d749a2 fcopysign and get rid of dsnode cruft. custom PA runtimes make this better in some senses
llvm-svn: 26641
2006-03-09 14:58:25 +00:00
Andrew Lenharth
78af2795b3 fcopysign support
llvm-svn: 26640
2006-03-09 14:57:36 +00:00
Jim Laskey
7fcf238500 Move bit field endianness to backend.
llvm-svn: 26639
2006-03-09 13:28:47 +00:00
Chris Lattner
f35a70d050 yes yes, enabled debug output is bad
llvm-svn: 26637
2006-03-09 07:39:25 +00:00
Chris Lattner
0020b50bac switch the t-d scheduler to use a really dumb and trivial critical path
latency priority function.

llvm-svn: 26636
2006-03-09 07:38:27 +00:00
Chris Lattner
074a604a1b Pull latency information for target instructions out of the latency tables. :)
Only enable this with -use-sched-latencies, I'll enable it by default with a
clean nightly tester run tonight.

PPC is the only target that provides latency info currently.

llvm-svn: 26634
2006-03-09 07:15:18 +00:00
Chris Lattner
34bfd7da1f don't copy all itinerary data
llvm-svn: 26633
2006-03-09 07:13:00 +00:00
Chris Lattner
b1f716a6d1 PriorityQueue is an instance var, use it.
llvm-svn: 26632
2006-03-09 06:48:37 +00:00
Chris Lattner
1d9c1edaa8 add some comments
llvm-svn: 26631
2006-03-09 06:37:29 +00:00
Chris Lattner
2dd7bcc95b Refactor the priority mechanism one step further: now that it is a separate
class, sever its implementation from the interface.  Now we can provide new
implementations of the same interface (priority computation) without touching
the scheduler itself.

llvm-svn: 26630
2006-03-09 06:35:14 +00:00
Chris Lattner
125881e75b Add support for 'special' llvm globals like debug info and static ctors/dtors.
llvm-svn: 26628
2006-03-09 06:14:35 +00:00
Chris Lattner
67a978dc1d fix a pasto
llvm-svn: 26627
2006-03-09 06:09:41 +00:00