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

20412 Commits

Author SHA1 Message Date
Hartmut Kaiser
4cbb4f081b Fixed linker errors (unresolved externals: split<>(...)) when compiling with VC++. Please review.
llvm-svn: 43081
2007-10-17 18:37:09 +00:00
Dan Gohman
231159e8a3 Define a helper function ConstantVector::getSplatValue for testing for
and working with broadcasted constants.

llvm-svn: 43076
2007-10-17 17:51:30 +00:00
Dan Gohman
2903f7fc26 Add support for ISD::SELECT in SplitVectorOp.
llvm-svn: 43072
2007-10-17 14:48:28 +00:00
Duncan Sands
0a5a15c3a0 Return Expand from getOperationAction for all extended
types.  This is needed for SIGN_EXTEND_INREG at least.
It is not clear if this is correct for other operations.
On the other hand, for the various load/store actions
it seems to correct to return the type action, as is
currently done.
Also, it seems that SelectionDAG::getValueType can be
called for extended value types; introduce a map for
holding these, since we don't really want to extend
the vector to be 2^32 pointers long!
Generalize DAGTypeLegalizer::PromoteResult_TRUNCATE
and DAGTypeLegalizer::PromoteResult_INT_EXTEND to handle
the various funky possibilities that apints introduce,
for example that you can promote to a type that needs
to be expanded.

llvm-svn: 43071
2007-10-17 13:49:58 +00:00
Devang Patel
cf2f9d6daa Apply "Instead of loading small c string constant, use integer constant directly" transformation while processing load instruction.
llvm-svn: 43070
2007-10-17 07:24:40 +00:00
Evan Cheng
4bba09dc4e Apply Chris' suggestions.
llvm-svn: 43069
2007-10-17 06:53:44 +00:00
Chris Lattner
3a19e981f5 Change fp to sint legalization on x86-32 to do 2 x i32
loads instead of 1 x i64 loads.  This doesn't change any functionality yet.

llvm-svn: 43068
2007-10-17 06:17:29 +00:00
Chris Lattner
ba2d55a564 fix some funny indentation, add comments.
llvm-svn: 43066
2007-10-17 06:02:13 +00:00
Evan Cheng
18a3c3dd37 One more extract_subreg coalescing bug fix.
llvm-svn: 43065
2007-10-17 05:29:37 +00:00
Evan Cheng
0899e1e26c Fix MergeValueInAsValue(). It allows overlapping live ranges but should replace
their value numbers with the specified value number.

llvm-svn: 43062
2007-10-17 02:13:29 +00:00
Evan Cheng
d292b1c096 Clean up code that calculate MBB live-in's.
llvm-svn: 43061
2007-10-17 02:12:22 +00:00
Evan Cheng
be47f9df2e Clean up code that calculate MBB live-in's.
llvm-svn: 43060
2007-10-17 02:10:22 +00:00
Owen Anderson
1235d1218b Move splitBlock into DomTreeBase from DomTree.
llvm-svn: 43059
2007-10-17 02:03:17 +00:00
Devang Patel
c3d0477a0e Use immediate stores.
llvm-svn: 43055
2007-10-16 23:44:18 +00:00
Dale Johannesen
fdb488d4b5 Disable attempts to constant fold PPC f128.
Remove the assumption that this will happen from
various places.

llvm-svn: 43053
2007-10-16 23:38:29 +00:00
Evan Cheng
97ada80b22 Some clean up.
llvm-svn: 43043
2007-10-16 21:09:14 +00:00
Owen Anderson
43fefb53a6 Template DominatorTreeBase by node type. This is the next major step towards
having dominator information on MBB's.

llvm-svn: 43036
2007-10-16 19:59:25 +00:00
Evan Cheng
09fa6ed483 Fix PR1734.
llvm-svn: 43035
2007-10-16 19:29:47 +00:00
Dale Johannesen
63411d36bf Check for invalid cc's in f80 select.
llvm-svn: 43033
2007-10-16 18:09:08 +00:00
Chris Lattner
45d9c7aa07 Fix a bug handling frame references in ppc inline asm when the frame offset
doesn't fit into 16 bits.

llvm-svn: 43032
2007-10-16 18:00:18 +00:00
Duncan Sands
9d622a6de1 Initial infrastructure for arbitrary precision integer
codegen support.  This should have no effect on codegen
for other types.  Debatable bits: (1) the use (abuse?)
of a set in SDNode::getValueTypeList; (2) the length of
getTypeToTransformTo, which maybe should be refactored
with a non-inline part for extended value types.

llvm-svn: 43030
2007-10-16 09:56:48 +00:00
Duncan Sands
12d0747c70 Fixes due to lack of type-safety for ValueType: (1) ValueType
being passed instead of an opcode; (2) ValueType being passed
for isVolatile (!) in getLoad.

llvm-svn: 43028
2007-10-16 09:07:20 +00:00
Arnold Schwaighofer
f0d4d73bf6 Correction to tail call optimization code. The new return address
was stored to the acutal stack slot before the parameters were
lowered to their stack slot. This could cause arguments to be
overwritten by the return address if the called function had less
parameters than the caller function. The update should remove the
last failing test case of llc-beta: SPASS.

llvm-svn: 43027
2007-10-16 09:05:00 +00:00
Evan Cheng
69092e7585 Code clean up.
llvm-svn: 43026
2007-10-16 08:04:24 +00:00
Chris Lattner
427c187f46 implement promotion of select and select_cc, allowing MallocBench/gs to
work with type promotion on x86.

llvm-svn: 43025
2007-10-16 03:00:22 +00:00
Dan Gohman
f5dc4d4f9b Teach IntrinsicLowering.cpp about the sin, cos, and pow intrinsics.
llvm-svn: 43020
2007-10-15 22:07:31 +00:00
Evan Cheng
3650ad3e51 Make CalcLatency() non-recursive.
llvm-svn: 43017
2007-10-15 21:33:22 +00:00
Chris Lattner
c641c8c6ec Change LowerFP_TO_SINT to create the specific code it needs instead of
unconditionally creating an i64 bitcast.  With the future legalizer
design, operation legalization can't introduce new nodes with illegal
types.

This fixes the rest of olden on ppc32.

llvm-svn: 43005
2007-10-15 20:14:52 +00:00
Evan Cheng
f5bcd3d737 LowerFP_TO_SINT must not create a stack object if it's not needed.
llvm-svn: 43004
2007-10-15 20:11:21 +00:00
Devang Patel
b4a9a2e418 Add removeModuleProvider()
llvm-svn: 43002
2007-10-15 19:56:32 +00:00
Evan Cheng
43887d3714 Fix PR1729: watch out for val# with no def.
llvm-svn: 42996
2007-10-15 18:33:50 +00:00
Chris Lattner
542fa12f9a Move CreateStackTemporary out to SelectionDAG
llvm-svn: 42995
2007-10-15 17:48:57 +00:00
Chris Lattner
292bebbb6f add a new CreateStackTemporary helper method.
llvm-svn: 42994
2007-10-15 17:47:20 +00:00
Chris Lattner
2a93fc3ffb implement promotion of BR_CC operands, fixing bisort on ppc.
llvm-svn: 42992
2007-10-15 17:16:12 +00:00
Chris Lattner
a2ebe2c07b updates from duncan
llvm-svn: 42991
2007-10-15 16:46:29 +00:00
Devang Patel
7d1d5d6bf6 Achieve same result but use fewer lines of code.
llvm-svn: 42985
2007-10-15 15:31:35 +00:00
Neil Booth
e14f19eda6 Fast-track obviously over-large and over-small exponents during decimal->
integer conversion.  In some such cases this makes us one or two orders
of magnitude faster than NetBSD's libc.  Glibc seems to have a similar
fast path.

Also, tighten up some upper bounds to save a bit of memory.

llvm-svn: 42984
2007-10-15 15:00:55 +00:00
Duncan Sands
14abc66cfe Fix some typos. Call getTypeToTransformTo rather than
getTypeToExpandTo.  The difference is that
getTypeToExpandTo gives the final result of expansion
(eg: i128 -> i32 on a 32 bit machine) while
getTypeToTransformTo does just one step (i128 -> i64).

llvm-svn: 42982
2007-10-15 13:30:18 +00:00
Chris Lattner
452ebc199e One mundane change: Change ReplaceAllUsesOfValueWith to *optionally*
take a deleted nodes vector, instead of requiring it.

One more significant change:  Implement the start of a legalizer that
just works on types.  This legalizer is designed to run before the 
operation legalizer and ensure just that the input dag is transformed
into an output dag whose operand and result types are all legal, even
if the operations on those types are not.

This design/impl has the following advantages:

1. When finished, this will *significantly* reduce the amount of code in
   LegalizeDAG.cpp.  It will remove all the code related to promotion and
   expansion as well as splitting and scalarizing vectors.
2. The new code is very simple, idiomatic, and modular: unlike 
   LegalizeDAG.cpp, it has no 3000 line long functions. :)
3. The implementation is completely iterative instead of recursive, good
   for hacking on large dags without blowing out your stack.
4. The implementation updates nodes in place when possible instead of 
   deallocating and reallocating the entire graph that points to some 
   mutated node.
5. The code nicely separates out handling of operations with invalid 
   results from operations with invalid operands, making some cases
   simpler and easier to understand.
6. The new -debug-only=legalize-types option is very very handy :), 
   allowing you to easily understand what legalize types is doing.

This is not yet done.  Until the ifdef added to SelectionDAGISel.cpp is
enabled, this does nothing.  However, this code is sufficient to legalize
all of the code in 186.crafty, olden and freebench on an x86 machine.  The
biggest issues are:

1. Vectors aren't implemented at all yet
2. SoftFP is a mess, I need to talk to Evan about it.
3. No lowering to libcalls is implemented yet.
4. Various operations are missing etc.
5. There are FIXME's for stuff I hax0r'd out, like softfp.

Hey, at least it is a step in the right direction :).  If you'd like to help,
just enable the #ifdef in SelectionDAGISel.cpp and compile code with it.  If
this explodes it will tell you what needs to be implemented.  Help is 
certainly appreciated.

Once this goes in, we can do three things:

1. Add a new pass of dag combine between the "type legalizer" and "operation
   legalizer" passes.  This will let us catch some long-standing isel issues
   that we miss because operation legalization often obfuscates the dag with
   target-specific nodes.
2. We can rip out all of the type legalization code from LegalizeDAG.cpp,
   making it much smaller and simpler.  When that happens we can then 
   reimplement the core functionality left in it in a much more efficient and
   non-recursive way.
3. Once the whole legalizer is non-recursive, we can implement whole-function
   selectiondags maybe...

llvm-svn: 42981
2007-10-15 06:10:22 +00:00
Chris Lattner
d987dc41fd One xform performed by LegalizeDAG is transformation of "store of fp" to "store of int".
Make two changes:
1) only xform "store of f32" if i32 is a legal type for the target.
2) only xform "store of f64" if either i64 or i32 are legal for the target.
3) if i64 isn't legal, manually lower to 2 stores of i32 instead of letting a
   later pass of legalize do it.  This is ugly, but helps future changes I'm 
   about to commit.

llvm-svn: 42980
2007-10-15 05:46:06 +00:00
Chris Lattner
bf2f5b472f avoid an APFloat copy.
llvm-svn: 42979
2007-10-15 05:34:10 +00:00
Chris Lattner
0841469ff0 Add a (disabled by default) way to view the ID of a node.
llvm-svn: 42978
2007-10-15 05:32:43 +00:00
Dale Johannesen
28beae4a4f Handle PPC long double in CBackend.
llvm-svn: 42972
2007-10-15 01:05:37 +00:00
Chris Lattner
95def2ca5a remove misleading comment.
llvm-svn: 42970
2007-10-14 20:35:12 +00:00
Chris Lattner
ac17bf4c0f If a target doesn't have HasMULHU or HasUMUL_LOHI, ExpandOp would return
without lo/hi set.  Fall through to making a libcall instead.

llvm-svn: 42969
2007-10-14 18:35:05 +00:00
Neil Booth
1463947f03 Consolidate logic for creating NaNs. Silence compiler warning.
llvm-svn: 42966
2007-10-14 10:39:51 +00:00
Neil Booth
138d8ef4a7 Whether arithmetic is supported is a property of the semantics. Make it
so, and clean up the checks by putting them in an inline function.

llvm-svn: 42965
2007-10-14 10:29:28 +00:00
Neil Booth
a352eb14cd Separate out parsing of decimal number. Use this to only allocate
memory for the significand once up-front.  Also ignore insignificant
trailing zeroes; this saves unnecessary multiplications later.

llvm-svn: 42964
2007-10-14 10:16:12 +00:00
Evan Cheng
90645f30db Unbreak x86-64.
llvm-svn: 42962
2007-10-14 10:09:39 +00:00
Evan Cheng
62ee7cd439 When coalescing an EXTRACT_SUBREG and the dst register is a physical register,
the source register will be coalesced to the super register of the LHS. Properly
merge in the live ranges of the resulting coalesced interval that were part of
the original source interval to the live interval of the super-register.

llvm-svn: 42961
2007-10-14 10:08:34 +00:00