1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

5151 Commits

Author SHA1 Message Date
Dale Johannesen
f170e29cf5 Fixes the last x86-64 test failure in compat.exp:
<16 x float> is 64-byte aligned (for some reason),
which gets us into the stack realignment code.  The
computation changing FP-relative offsets to SP-relative
was broken, assiging a spill temp to a location
also used for parameter passing.  This
fixes it by rounding up the stack frame to a multiple
of the largest alignment (I concluded it wasn't fixable
without doing this, but I'm not very sure.)

llvm-svn: 52750
2008-06-26 01:51:13 +00:00
Eric Christopher
4f05c48718 Move GetConstantStringInfo to lib/Analysis. Remove
string output routine from Constant. Update all
callers. Change debug intrinsic api slightly to
accomodate move of routine, these now return values
instead of strings.

llvm-svn: 52748
2008-06-26 00:31:12 +00:00
Chris Lattner
2b67ff8632 when we know the signbit of an input to uint_to_fp is zero,
change it to sint_to_fp on targets where that is cheaper (and
visaversa of course).  This allows us to compile uint_to_fp to:

_test:
	movl	4(%esp), %eax
	shrl	$23, %eax
	cvtsi2ss	%eax, %xmm0
	movl	8(%esp), %eax
	movss	%xmm0, (%eax)
	ret

instead of:

	.align	3
LCPI1_0:					##  double
	.long	0	## double least significant word 4.5036e+15
	.long	1127219200	## double most significant word 4.5036e+15
	.text
	.align	4,0x90
	.globl	_test
_test:
	subl	$12, %esp
	movl	16(%esp), %eax
	shrl	$23, %eax
	movl	%eax, (%esp)
	movl	$1127219200, 4(%esp)
	movsd	(%esp), %xmm0
	subsd	LCPI1_0, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movl	20(%esp), %eax
	movss	%xmm0, (%eax)
	addl	$12, %esp
	ret

llvm-svn: 52747
2008-06-26 00:16:49 +00:00
Owen Anderson
68f11ecb86 Remember which MachineOperand we were processing, so we don't have to scan the list to find it again later.
This speeds up live intervals from 0.37s to 0.30s on instcombine.

llvm-svn: 52745
2008-06-25 23:39:39 +00:00
Dan Gohman
d1467012f5 Fix the text in an assert string.
llvm-svn: 52744
2008-06-25 22:14:43 +00:00
Evan Cheng
71fbfe73c1 - Fix a x86 vector isel bug: illegal transformation of a vector_shuffle into a
shift.
- Add a readme entry for a missing vector_shuffle optimization that results in
  awful codegen.

llvm-svn: 52740
2008-06-25 20:52:59 +00:00
Duncan Sands
12c1bee452 Add support for expanding PPC 128 bit floats.
For this it is convenient to permit floats to
be used with EXTRACT_ELEMENT, so I tweaked
things to allow that.  I also added libcalls
for ppcf128 to i32 forms of FP_TO_XINT, since
they exist in libgcc and this case can certainly
occur (and does occur in the testsuite) - before
the i64 libcall was being used.  Also, the
XINT_TO_FP result seemed to be wrong when
the argument is an i128: the wrong fudge
factor was added (the i32 and i64 cases were
handled directly, but the i128 code fell
through to some generic softening code which
seemed to think it was i64 to f32!).  So I
fixed it by adding a fudge factor that I
found in my breakfast cereal.

llvm-svn: 52739
2008-06-25 20:24:48 +00:00
Duncan Sands
ab85726912 Add/complete support for integer and float
select_cc and friends.  This code could be
factorized a bit but I'm not sure that it's
worth it.

llvm-svn: 52724
2008-06-25 16:34:21 +00:00
Dan Gohman
404964dbc0 Remove the OrigVT member from AtomicSDNode, as it is redundant with
the base SDNode's VTList.

llvm-svn: 52722
2008-06-25 16:07:49 +00:00
Mon P Wang
7d89d61387 Added MemOperands to Atomic operations since Atomics touches memory.
Added abstract class MemSDNode for any Node that have an associated MemOperand
Changed atomic.lcs => atomic.cmp.swap, atomic.las => atomic.load.add, and
atomic.lss => atomic.load.sub

llvm-svn: 52706
2008-06-25 08:15:39 +00:00
Evan Cheng
bab5925a0b Enable two-address remat by default.
llvm-svn: 52701
2008-06-25 01:16:38 +00:00
Owen Anderson
8b2f51618a Use SmallVector instead of std::vector for a minor compile time improvement.
llvm-svn: 52689
2008-06-24 21:44:59 +00:00
Dan Gohman
0e992740a0 A brief survey of priority_queue usage in the tree turned this up
as a questionable case, but the code isn't actually needed.

llvm-svn: 52657
2008-06-23 23:51:16 +00:00
Bill Wendling
2501066409 This situation can occur:
,------.
    |      |
    |      v
    |   t2 = phi ... t1 ...
    |      |
    |      v
    |   t1 = ...
    |  ... = ... t1 ...
    |      |
    `------'

where there is a use in a PHI node that's a predecessor to the defining
block. We don't want to mark all predecessors as having the value "alive" in
this case. Also, the assert was too restrictive and didn't handle this case.

llvm-svn: 52655
2008-06-23 23:41:14 +00:00
Dan Gohman
95743e3078 Use the new PriorityQueue in ScheduleDAGList too, which also
needs arbitrary-element removal.

llvm-svn: 52654
2008-06-23 23:40:09 +00:00
Owen Anderson
f2386cff4f Use getMBBEndIdx rather than assuming that the end is right after the last instruction in the block.
llvm-svn: 52649
2008-06-23 22:12:23 +00:00
Evan Cheng
73bdede529 Remove option used to debug stack coloring bugs. It's no longer needed since stack coloring is now bug free.
llvm-svn: 52644
2008-06-23 21:24:32 +00:00
Dan Gohman
71a0e81d0b Move a DenseMap's declaration outside of a loop, and just call
clear() on each iteration. This avoids allocating and deallocating
all of DenseMap's memory on each iteration.

llvm-svn: 52642
2008-06-23 21:15:00 +00:00
Evan Cheng
6e5a126667 Instead of adding an isSS field to LiveInterval to denote stack slot. Use top bit of 'reg' instead. If the top bit is set, than the LiveInterval represents a stack slot live interval.
llvm-svn: 52639
2008-06-23 21:03:19 +00:00
Dan Gohman
84cef04f76 Duncan pointed out this code could be tidied.
llvm-svn: 52624
2008-06-23 15:29:14 +00:00
Duncan Sands
e7f2c80a8c Port some integer multiplication fixes from LegalizeDAG.
Bail out with an error if there is no libcall available
for the given size of integer.

llvm-svn: 52622
2008-06-23 15:15:44 +00:00
Duncan Sands
86e6f1a3b6 Support for expanding the result of EXTRACT_ELEMENT.
llvm-svn: 52621
2008-06-23 15:08:15 +00:00
Duncan Sands
1b83cbdebe Cleanup up LegalizeTypes handling of loads and
stores.

llvm-svn: 52620
2008-06-23 14:19:45 +00:00
Duncan Sands
d1d3e67d30 Make custom lowering of ADD work correctly. This
fixes PR2476; patch by Richard Osborne.  The same
problem exists for a bunch of other operators, but
I'm ignoring this because they will be automagically
fixed when the new LegalizeTypes infrastructure lands,
since it already solves this problem centrally.

llvm-svn: 52610
2008-06-22 09:42:16 +00:00
Dan Gohman
a41cf16a8f Simplify some getNode calls.
llvm-svn: 52604
2008-06-21 22:06:07 +00:00
Dan Gohman
4d2c1733d7 canClobberPhysRegDefs shouldn't called without checking hasPhysRegDefs;
check this with an assert.

llvm-svn: 52603
2008-06-21 22:05:24 +00:00
Dan Gohman
a313808e69 Use clear() to zero an existing APInt.
llvm-svn: 52601
2008-06-21 22:02:15 +00:00
Dan Gohman
7460588026 Use back() instead of [size()-1].
llvm-svn: 52600
2008-06-21 22:00:54 +00:00
Dan Gohman
1e71795b8d Remove a redundant return.
llvm-svn: 52585
2008-06-21 19:34:57 +00:00
Dan Gohman
015a5ca374 Remove ScheduleDAG's SUnitMap altogether. Instead, use SDNode's NodeId
field, which is otherwise unused after instruction selection, as an index
into the SUnit array.

llvm-svn: 52583
2008-06-21 19:18:17 +00:00
Dan Gohman
4099d0bf27 Add a priority queue class, which is a wrapper around std::priority_queue
and provides fairly efficient removal of arbitrary elements. Switch
ScheduleDAGRRList from std::set to this new priority queue.

llvm-svn: 52582
2008-06-21 18:35:25 +00:00
Duncan Sands
1dd6ef8f8e Support for load/store of expanded float types. I
don't know if a truncating store is possible here,
but added support for it anyway.

llvm-svn: 52577
2008-06-21 17:00:47 +00:00
Dan Gohman
3a5a96e045 Change ScheduleDAG's SUnitMap from DenseMap<SDNode*, vector<SUnit*> >
to DenseMap<SDNode*, SUnit*>, and adjust the way cloned SUnit nodes are
handled so that only the original node needs to be in the map.
This speeds up llc on 447.dealII.llvm.bc by about 2%.

llvm-svn: 52576
2008-06-21 15:52:51 +00:00
Evan Cheng
1d07cd32c2 Undo spill weight tweak. Need to investigate the performance regressions.
llvm-svn: 52572
2008-06-21 06:45:54 +00:00
Dan Gohman
62fb667283 Simplify some template parameterization.
llvm-svn: 52571
2008-06-21 01:08:22 +00:00
Evan Cheng
c1f551b43e Enhanced heuristic to determine the *best* register to spill. Instead of picking the register with the lowest spill weight. Consider (up to) 2 additional registers with spill weights that are close to the lowest spill weight. The one with fewest defs and uses that conflicts with the current interval (weighted by loop depth) is the spill candidate.
This is not always a win, but there are much more wins than loses and wins tend to be more noticeable.

llvm-svn: 52554
2008-06-20 21:45:16 +00:00
Duncan Sands
59b9db1fb6 Share some code that is common between integer and
float expansion (and sometimes vector splitting too).

llvm-svn: 52548
2008-06-20 18:40:50 +00:00
Duncan Sands
bccd4c58ba Rename the operation of turning a float type into an
integer of the same type.  Before it was "promotion",
but this is confusing because it is quite different
to promotion of integers.  Call it "softening" instead,
inspired by "soft float".

llvm-svn: 52546
2008-06-20 17:49:55 +00:00
Dan Gohman
10e3188458 Clean up some uses of std::distance, now that we have allnodes_size.
llvm-svn: 52545
2008-06-20 17:15:19 +00:00
Dan Gohman
359de5a04e Teach ReturnInst lowering about aggregate return values.
llvm-svn: 52522
2008-06-20 01:29:26 +00:00
Dan Gohman
0d86d31373 Fix the index calculations for the extractvalue lowering code.
llvm-svn: 52517
2008-06-20 00:54:19 +00:00
Dan Gohman
826ad19523 Simplify the ComputeLinearIndex logic and fix a few bugs.
llvm-svn: 52516
2008-06-20 00:53:00 +00:00
Evan Cheng
4006f4cdf0 ISD::UNDEF should be expanded recursively / iteratively.
llvm-svn: 52508
2008-06-19 22:01:11 +00:00
Dan Gohman
cd78a0e385 Use the transferSuccessors helper function.
llvm-svn: 52495
2008-06-19 17:22:29 +00:00
Evan Cheng
b12290e31b Missed a check.
llvm-svn: 52487
2008-06-19 06:17:19 +00:00
Owen Anderson
864a2c23ed Revert my last patch, which was causing regression test failures.
llvm-svn: 52485
2008-06-19 05:29:34 +00:00
Evan Cheng
22b431d28f Coalesce copy from one register class to a sub register class. e.g. X86::MOV16to16_.
llvm-svn: 52480
2008-06-19 01:39:21 +00:00
Evan Cheng
f129d15d03 Cosmetic changes.
llvm-svn: 52479
2008-06-19 01:21:26 +00:00
Evan Cheng
968679913e Minor spiller tweak to unfavor reload into load/store instructions.
llvm-svn: 52477
2008-06-19 01:16:17 +00:00
Owen Anderson
abbc43e493 Insert empty slots into the instruction numbering in live intervals, so that we can more easily
add new instructions.

llvm-svn: 52475
2008-06-19 00:10:49 +00:00