1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-25 14:02:52 +02:00
Commit Graph

4580 Commits

Author SHA1 Message Date
Duncan Sands
0056f1e823 In TargetLowering::LowerCallTo, don't assert that
the return value is zero-extended if it isn't
sign-extended.  It may also be any-extended.
Also, if a floating point value was returned
in a larger floating point type, pass 1 as the
second operand to FP_ROUND, which tells it
that all the precision is in the original type.
I think this is right but I could be wrong.
Finally, when doing libcalls, set isZExt on
a parameter if it is "unsigned".  Currently
isSExt is set when signed, and nothing is
set otherwise.  This should be right for all
calls to standard library routines.

llvm-svn: 47122
2008-02-14 17:28:50 +00:00
Nate Begeman
1ef1013b6c Change how FP immediates are handled.
1) ConstantFP is now expand by default
2) ConstantFP is not turned into TargetConstantFP during Legalize
   if it is legal.

This allows ConstantFP to be handled like Constant, allowing for 
targets that can encode FP immediates as MachineOperands.

As a bonus, fix up Itanium FP constants, which now correctly match,
and match more constants!  Hooray.

llvm-svn: 47121
2008-02-14 08:57:00 +00:00
Nate Begeman
8352abdd98 Support a new type of MachineOperand, MO_FPImmediate, used for holding
FP Immediates, crazily enough

llvm-svn: 47117
2008-02-14 07:39:30 +00:00
Dan Gohman
83374c9be5 Allow the APInt form of ComputeMaskedBits to operate on i128 types.
llvm-svn: 47101
2008-02-13 23:13:32 +00:00
Dan Gohman
a5ad7ff23b Avoid setting bits that aren't demanded.
llvm-svn: 47098
2008-02-13 22:43:25 +00:00
Dan Gohman
99b38405e3 Simplify some logic in ComputeMaskedBits. And change ComputeMaskedBits
to pass the mask APInt by value, not by reference. 

llvm-svn: 47096
2008-02-13 22:28:48 +00:00
Nicolas Geoffray
72fa78e195 Enable exception handling int JIT
llvm-svn: 47079
2008-02-13 18:39:37 +00:00
Duncan Sands
2e9661573f Teach LegalizeTypes how to expand and promote CTLZ,
CTTZ and CTPOP.  The expansion code differs from
that in LegalizeDAG in that it chooses to take the
CTLZ/CTTZ count from the Hi/Lo part depending on
whether the Hi/Lo value is zero, not on whether
CTLZ/CTTZ of Hi/Lo returned 32 (or whatever the
width of the type is) for it.  I made this change
because the optimizers may well know that Hi/Lo
is zero and exploit it.  The promotion code for
CTTZ also differs from that in LegalizeDAG: it
uses an "or" to get the right result when the
original value is zero, rather than using a compare
and select.  This also means the value doesn't
need to be zero extended.

llvm-svn: 47075
2008-02-13 18:01:53 +00:00
Evan Cheng
d513437ce1 Some code clean up.
llvm-svn: 47060
2008-02-13 09:56:03 +00:00
Evan Cheng
84c503fdd4 Simplify.
llvm-svn: 47058
2008-02-13 09:13:21 +00:00
Evan Cheng
0e4d4f17cc Fix a potential serious problem where kills belonging to the val# defined by a two-address instruction is also on the val# that defines the input.
llvm-svn: 47057
2008-02-13 09:06:18 +00:00
Evan Cheng
e0cad13e5e * Cannot safely commute an instruction there are other defs which can reach its uses.
* Ignore copy instructions which have already been coalesced.

llvm-svn: 47056
2008-02-13 08:41:08 +00:00
Chris Lattner
a30946c576 In SDISel, for targets that support FORMAL_ARGUMENTS nodes, lower this
node as soon as we create it in SDISel.  Previously we would lower it in
legalize.  The problem with this is that it only exposes the argument
loads implied by FORMAL_ARGUMENTs after legalize, so that only dag combine 2
can hack on them.  This causes us to miss some optimizations because 
datatype expansion also happens here.

Exposing the loads early allows us to do optimizations on them.  For example
we now compile arg-cast.ll to:

_foo:
	movl	$2147483647, %eax
	andl	8(%esp), %eax
	ret

where we previously produced:

_foo:
	subl	$12, %esp
	movsd	16(%esp), %xmm0
	movsd	%xmm0, (%esp)
	movl	$2147483647, %eax
	andl	4(%esp), %eax
	addl	$12, %esp
	ret

It might also make sense to do this for ISD::CALL nodes, which have implicit
stores on many targets.

llvm-svn: 47054
2008-02-13 07:39:09 +00:00
Chris Lattner
c798882db7 teach dag combiner how to eliminate MERGE_VALUES nodes.
llvm-svn: 47052
2008-02-13 07:25:05 +00:00
Nate Begeman
f628b4b2a7 Support legalizing insert_vector_elt on targets where the element
type is not legal.

llvm-svn: 47048
2008-02-13 06:43:04 +00:00
Evan Cheng
d4ddda68fa Initial support for copy elimination by commuting its definition MI.
PR1877.
A3 = op A2 B0<kill>                                                                                                                                                                            
...                                                                                                                                                                                     
B1 = A3      <- this copy                                                                                                                                                                      
...                                                                                                                                                                                          
   = op A3   <- more uses                                                                                                                                                                      
                                                                                                                                                                                                 
==>                                                                                                                                                                                             
                                                                                                                                                                                            
B2 = op B0 A2<kill>                                                                                                                                                                            
...                                                                                                                                                                                          
B1 = B2      <- now an identify copy                                                                                                                                                           
...                                                                                                                                                                                          
   = op B2   <- more uses

This speeds up FreeBench/neural by 29%, Olden/bh by 12%, oopack_v1p8 by 53%.

llvm-svn: 47046
2008-02-13 03:01:43 +00:00
Evan Cheng
da24989368 - Added removeValNo() to remove all live ranges of a particular value#.
- removeRange() can now update value# information.

llvm-svn: 47044
2008-02-13 02:48:26 +00:00
Evan Cheng
4b37f5ff05 commuteInstr() can now commute non-ssa machine instrs.
llvm-svn: 47043
2008-02-13 02:46:49 +00:00
Evan Cheng
95894280dc Added debugging routine dumpUses.
llvm-svn: 47042
2008-02-13 02:45:38 +00:00
Dan Gohman
09023887f8 Convert SelectionDAG::ComputeMaskedBits to use APInt instead of uint64_t.
Add an overload that supports the uint64_t interface for use by clients
that haven't been updated yet.

llvm-svn: 47039
2008-02-13 00:35:47 +00:00
Duncan Sands
1122ee4ded Generalize getCopyFromParts and getCopyToParts to
handle arbitrary precision integers and any number
of parts.  For example, on a 32 bit machine an i50
corresponds to two i32 parts.  getCopyToParts will
extend the i50 to an i64 then write half of the i64
to each part; getCopyFromParts will combine the two
i32 parts into an i64 then truncate the result to
i50.

llvm-svn: 47024
2008-02-12 20:46:31 +00:00
Duncan Sands
7916fcbe27 Generalize the handling of call and return arguments,
in preparation for apint support.  These changes are
intended to have no functional effect.

llvm-svn: 46967
2008-02-11 20:58:28 +00:00
Dan Gohman
243661fb31 From Chris' review: use isa instead of explicitly using classof.
llvm-svn: 46964
2008-02-11 19:00:34 +00:00
Dan Gohman
48e7261cca From Chris' review: minor corrections in comments.
llvm-svn: 46963
2008-02-11 19:00:03 +00:00
Dan Gohman
d8e6231471 From Chris' review: use cast instead of dyn_cast with an assert.
llvm-svn: 46962
2008-02-11 18:58:42 +00:00
Dan Gohman
945903a002 From Chris' review: fix 80 column violations
llvm-svn: 46961
2008-02-11 18:57:43 +00:00
Ted Kremenek
f06b7ac532 Added "Profile" method to APFloat for use with FoldingSet.
Added member template "Add" to FoldingSetNodeID that allows "adding" arbitrary
objects to a profile via dispatch to FoldingSetTrait<T>::Profile().

Removed FoldingSetNodeID::AddAPFloat and FoldingSetNodeID::APInt, as their
functionality is now replaced using the above mentioned member template.

llvm-svn: 46957
2008-02-11 17:24:50 +00:00
Duncan Sands
204c89cafa Add a isBigEndian method to complement isLittleEndian.
llvm-svn: 46954
2008-02-11 10:37:04 +00:00
Evan Cheng
19f684ed72 Determine whether a spill kills the register it's spilling before insertion rather than trying to undo the kill marker afterwards.
llvm-svn: 46953
2008-02-11 08:30:52 +00:00
Dan Gohman
cabaec582f Rename MRegisterInfo to TargetRegisterInfo.
llvm-svn: 46930
2008-02-10 18:45:23 +00:00
Duncan Sands
2c2b2822d3 Add truncate and AssertZext result expansion.
llvm-svn: 46926
2008-02-10 10:08:52 +00:00
Bill Wendling
20621788d4 Return "(c1 + c2)" instead of yet another ADD node (which made this a
no-op).

llvm-svn: 46922
2008-02-10 08:10:24 +00:00
Chris Lattner
bc59a2704b add anote
llvm-svn: 46918
2008-02-10 01:01:35 +00:00
Evan Cheng
869b54e60c Remove unused hidden option.
llvm-svn: 46903
2008-02-09 08:36:28 +00:00
Dan Gohman
672d341167 Change ConstantSDNode to store an APInt instead of a uint64_t, and
begin adding some methods to use it this way.

llvm-svn: 46899
2008-02-08 22:59:30 +00:00
Evan Cheng
83066786b0 Forgot these files.
llvm-svn: 46896
2008-02-08 22:05:27 +00:00
Evan Cheng
2d3d000878 Also print alignment.
llvm-svn: 46895
2008-02-08 22:05:07 +00:00
Dan Gohman
1f255f2db7 Avoid needlessly casting away const qualifiers.
llvm-svn: 46876
2008-02-08 03:26:46 +00:00
Evan Cheng
0c6aedd740 Remove remnant of load folding in local register allocator. Patch by Holger Schurig.
llvm-svn: 46861
2008-02-07 19:46:55 +00:00
Dan Gohman
eb7c8e4f6b Follow Chris' suggestion; change the PseudoSourceValue accessors
to return pointers instead of references, since this is always what
is needed.

llvm-svn: 46857
2008-02-07 18:41:25 +00:00
Dan Gohman
ebca101f50 Don't abort if a MemOperand is missing a SourceValue; just print it
as <unknown>. And make some minor adjustments to the MemOperand
dump format.

llvm-svn: 46853
2008-02-07 16:18:00 +00:00
Nick Lewycky
b0f0e69df2 Don't make up new directives. (".set_foobar")
llvm-svn: 46848
2008-02-07 06:36:26 +00:00
Dan Gohman
f00842e086 Re-apply the memory operand changes, with a fix for the static
initializer problem, a minor tweak to the way the
DAGISelEmitter finds load/store nodes, and a renaming of the
new PseudoSourceValue objects.

llvm-svn: 46827
2008-02-06 22:27:42 +00:00
Evan Cheng
2091d9a2e8 Fix a number of local register allocator issues: PR1609.
llvm-svn: 46821
2008-02-06 19:16:53 +00:00
Evan Cheng
34815d69b2 RegAllocaLocal still *requires* LiveVariables since it runs PHIElimination, followed by TwoAddress which requires LiveVariables. We cannot run LiveVariables on non-SSA code.
llvm-svn: 46813
2008-02-06 08:00:32 +00:00
Evan Cheng
851d353eb8 Fix PR1975: dag isel emitter produces patterns that isel wrong flag result.
llvm-svn: 46776
2008-02-05 22:50:29 +00:00
Evan Cheng
69d5e0fc0f If a vr is already marked alive in a bb, then it has PHI uses that are visited earlier, then it is not killed in the def block (i.e. not dead).
llvm-svn: 46763
2008-02-05 20:04:18 +00:00
Evan Cheng
352062f5f7 Typo.
llvm-svn: 46725
2008-02-04 23:10:38 +00:00
Evan Cheng
1c67dcaae7 Dwarf requires variable entries to be in the source order. Right now, since we are recording variable information at isel time this means parameters would appear in the reverse order. The short term fix is to issue recordVariable() at asm printing time instead.
llvm-svn: 46724
2008-02-04 23:06:48 +00:00
Duncan Sands
2ba7682d9e I don't see how NodeUpdated can be called with a
ReadyToProcess node - add an assertion to check
this.  Add an assertion to NodeDeleted that checks
that processed/ready nodes are indeed not deleted.
It is because they are never deleted that none of
the maps can have a deleted node as the source of
a mapping.  It does however seem to be possible in
theory to have a deleted value as the target of a
mapping, however this has not yet been spotted in
the wild.  Still mulling on what to do about this.
[The theoretical situation is this: a node A is
expanded/promoted/whatever to a newly created node
B.  Thus A->B is added to a map.  When the subtree
rooted at B is legalized it is conceivable that B
is deleted due to RAUW on a node somewhere above
it].

llvm-svn: 46705
2008-02-04 09:29:17 +00:00