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

4763 Commits

Author SHA1 Message Date
Owen Anderson
ecc3b561eb When we're determining what registers to coallesce, track the VNInfo IDs for the definitions that
feed the PHI instructions.  We'll need these IDs in order to update LiveIntervals properly.

llvm-svn: 48277
2008-03-12 03:13:29 +00:00
Evan Cheng
ee092b2dfc Total brain cramp.
llvm-svn: 48274
2008-03-12 02:05:05 +00:00
Evan Cheng
1812351f99 Set NextMII after issuing a physical register spill.
llvm-svn: 48263
2008-03-12 00:14:07 +00:00
Evan Cheng
909992f970 Minor debug output bug.
llvm-svn: 48261
2008-03-12 00:02:46 +00:00
Anton Korobeynikov
55f54ba252 Correctly propagate thread-local flag from aliasee to alias. This fixes PR2137
llvm-svn: 48257
2008-03-11 22:38:53 +00:00
Dan Gohman
8e3c88c4e9 Use PassManagerBase instead of FunctionPassManager for functions
that merely add passes. This allows them to be used with either
FunctionPassManager or PassManager, or even with a custom new
kind of pass manager.

llvm-svn: 48256
2008-03-11 22:29:46 +00:00
Anton Korobeynikov
aa1433ab47 Honour aliases visibility during asm emission
llvm-svn: 48249
2008-03-11 21:41:14 +00:00
Evan Cheng
665363494f Transfer physical register spill info when load / store folding happens.
llvm-svn: 48246
2008-03-11 21:34:46 +00:00
Dan Gohman
1fece90de9 Use the correct value for InSignBit.
llvm-svn: 48245
2008-03-11 21:29:43 +00:00
Dan Gohman
55a443d612 Initial codegen support for functions and calls with multiple return values.
llvm-svn: 48244
2008-03-11 21:11:25 +00:00
Christopher Lamb
74f4d837df Recommitting parts of r48130. These do not appear to cause the observed failures.
llvm-svn: 48223
2008-03-11 10:09:17 +00:00
Evan Cheng
794f4ee703 Use TargetRegisterInfo::getPhysicalRegisterRegClass. Remove duplicated code.
llvm-svn: 48221
2008-03-11 07:55:13 +00:00
Evan Cheng
af1c76846d When the register allocator runs out of registers, spill a physical register around the def's and use's of the interval being allocated to make it possible for the interval to target a register and spill it right away and restore a register for uses. This likely generates terrible code but is before than aborting.
llvm-svn: 48218
2008-03-11 07:19:34 +00:00
Duncan Sands
1b059ad5d5 Some LegalizeTypes code factorization and minor
enhancements.

llvm-svn: 48215
2008-03-11 06:41:14 +00:00
Chris Lattner
3241d0df37 compile: double test() {}
into:

_test:
	fldz
	ret

instead of:

_test:
	subl	$12, %esp
	#IMPLICIT_DEF %xmm0
	movsd	%xmm0, (%esp)
	fldl	(%esp)
	addl	$12, %esp
	ret

llvm-svn: 48213
2008-03-11 06:21:08 +00:00
Chris Lattner
e58af59475 variadic instructions don't have operand info for variadic arguments.
llvm-svn: 48208
2008-03-11 03:14:42 +00:00
Dan Gohman
85bfbe2293 Generalize ExpandIntToFP to handle the case where the operand is legal
and it's the result that requires expansion. This code is a little confusing
because the TargetLoweringInfo tables for [US]INT_TO_FP use the operand type
(the integer type) rather than the result type. 

llvm-svn: 48206
2008-03-11 01:59:03 +00:00
Chris Lattner
98af9eac5f If a register operand comes from the variadic part of a node, don't
verify the register constraint matches what the instruction expects.

llvm-svn: 48205
2008-03-11 00:59:28 +00:00
Evan Cheng
77df19cb8c Temporarily revert 48175.
llvm-svn: 48204
2008-03-11 00:27:34 +00:00
Dan Gohman
1a65335a9b More APInt-ification.
llvm-svn: 48201
2008-03-11 00:11:06 +00:00
Dan Gohman
65bfbfb8dd Correctly clone FlaggedNodes.
llvm-svn: 48196
2008-03-10 23:48:14 +00:00
Dan Gohman
7f8c939777 APInt-ify this.
llvm-svn: 48194
2008-03-10 23:38:17 +00:00
Dan Gohman
67aed9bbb0 Implement more support for fp-to-i128 and i128-to-fp conversions.
llvm-svn: 48189
2008-03-10 23:03:31 +00:00
Evan Cheng
863da1c28c If the register allocator ran out of registers, just abort for now.
llvm-svn: 48175
2008-03-10 21:27:20 +00:00
Dan Gohman
47137eba06 Fix mul expansion to check the correct number of bits for
zero extension when checking if an unsigned multiply is
safe.

llvm-svn: 48171
2008-03-10 20:42:19 +00:00
Evan Cheng
8b8d58e1aa Somewhat better solution.
llvm-svn: 48170
2008-03-10 19:58:22 +00:00
Evan Cheng
7d9e5a7680 Default ISD::PREFETCH to expand.
llvm-svn: 48169
2008-03-10 19:38:10 +00:00
Evan Cheng
067ecbc341 Revert 48125, 48126, and 48130 for now to unbreak some x86-64 tests.
llvm-svn: 48167
2008-03-10 19:31:26 +00:00
Scott Michel
bb8e8fca47 Give TargetLowering::getSetCCResultType() a parameter so that ISD::SETCC's
return ValueType can depend its operands' ValueType.

This is a cosmetic change, no functionality impacted.

llvm-svn: 48145
2008-03-10 15:42:14 +00:00
Bill Wendling
91ff268a77 Minor cleanup. No functionality change.
llvm-svn: 48142
2008-03-10 08:13:01 +00:00
Evan Cheng
02b66c3a32 - Fix a subtle bug in RemoveCopyByCommutingDef. ALR is the live range where the source is defined; BLR is the live range which is defined by the copy.
If ALR and BLR overlaps and end of BLR extends beyond end of ALR, e.g.                                                                                                 
 A = or A, B                                                                                                                                                            
 ...                                                                                                                                                                    
 B = A                                                                                                                                                                  
 ...                                                                                                                                                                    
 C = A<kill>                                                                                                                                                            
 ...                                                                                                                                                                    
   = B                                                                                                                                                                  
                                                                                                                                                                        
then do not add kills of A to the newly created B interval.
- Also fix some kill info update bug.

llvm-svn: 48141
2008-03-10 08:11:32 +00:00
Evan Cheng
554d2c443b Doh
llvm-svn: 48140
2008-03-10 07:59:01 +00:00
Owen Anderson
6b69a8671e Move StrongPHIElimination after live interval analysis. This will make things happier down the road.
llvm-svn: 48138
2008-03-10 07:22:36 +00:00
Evan Cheng
3c0ddc999f Avoid creating BUILD_VECTOR of all zero elements of "non-normalized" type (e.g. v8i16 on x86) after legalizer. Instruction selection does not expect to see them. In all likelihood this can only be an issue in a bugpoint reduced test case.
llvm-svn: 48136
2008-03-10 07:19:13 +00:00
Christopher Lamb
32e5ce3d96 Allow insert_subreg into implicit, target-specific values.
Change insert/extract subreg instructions to be able to be used in TableGen patterns.
Use the above features to reimplement an x86-64 pseudo instruction as a pattern.

llvm-svn: 48130
2008-03-10 06:12:08 +00:00
Dale Johannesen
e6b0009792 Increase ISD::ParamFlags to 64 bits. Increase the ByValSize
field to 32 bits, thus enabling correct handling of ByVal
structs bigger than 0x1ffff.  Abstract interface a bit.
Fixes gcc.c-torture/execute/pr23135.c and 
gcc.c-torture/execute/pr28982b.c in gcc testsuite (were ICE'ing
on ppc32, quietly producing wrong code on x86-32.)

llvm-svn: 48122
2008-03-10 02:17:22 +00:00
Chris Lattner
9d93efcfbd remove an extraneous (and ugly) default argument, thanks Duncan.
llvm-svn: 48117
2008-03-09 20:04:36 +00:00
Chris Lattner
a85b0b591e fp_round's produced by getCopyFromParts should always be exact, because
they are produced by calls (which are known exact) and by cross block copies
which are known to be produced by extends.

This improves:

define double @test2() {
	%tmp85 = call double asm sideeffect "fld0", "={st(0)}"()
	ret double %tmp85
}

from:

_test2:
	subl	$20, %esp
	# InlineAsm Start
	fld0
	# InlineAsm End
	fstpl	8(%esp)
	movsd	8(%esp), %xmm0
	movsd	%xmm0, (%esp)
	fldl	(%esp)
	addl	$20, %esp
	#FP_REG_KILL
	ret

to:

_test2:
	# InlineAsm Start
	fld0
	# InlineAsm End
	#FP_REG_KILL
	ret

by avoiding a f64 <-> f80 trip

llvm-svn: 48108
2008-03-09 09:38:46 +00:00
Chris Lattner
b6bfedbcfd teach X86InstrInfo::copyRegToReg how to copy into ST(0) from
an RFP register class.

Teach ScheduleDAG how to handle CopyToReg with different src/dst 
reg classes.

This allows us to compile trivial inline asms that expect stuff
on the top of x87-fp stack.

llvm-svn: 48107
2008-03-09 09:15:31 +00:00
Chris Lattner
8d0203478f Add ScheduleDAG support for copytoreg where the src/dst register are
in different register classes, e.g. copy of ST(0) to RFP*.  This gets
some really trivial inline asm working that plops things on the top of
stack (PR879)

llvm-svn: 48105
2008-03-09 08:49:15 +00:00
Chris Lattner
4893d8fac2 fix 80 col violation
llvm-svn: 48100
2008-03-09 07:51:01 +00:00
Chris Lattner
9e5cf6dc21 extend fp values with FP_EXTEND not FP_ROUND.
llvm-svn: 48097
2008-03-09 07:47:22 +00:00
Chris Lattner
92eed4e1b7 Fix two problems in SelectionDAGLegalize::ExpandBUILD_VECTOR's handling
of BUILD_VECTORS that only have two unique elements:

1. The previous code was nondeterminstic, because it walked a map in
   SDOperand order, which isn't determinstic.
2. The previous code didn't handle the case when one element was undef
   very well.  Now we ensure that the generated shuffle mask has the
   undef vector on the RHS (instead of potentially being on the LHS)
   and that any elements that refer to it are themselves undef.  This
   allows us to compile CodeGen/X86/vec_set-9.ll into:

_test3:
	movd	%rdi, %xmm0
	punpcklqdq	%xmm0, %xmm0
	ret

instead of:

_test3:
	movd	%rdi, %xmm1
	#IMPLICIT_DEF %xmm0
	punpcklqdq	%xmm1, %xmm0
	ret

... saving a register.

llvm-svn: 48060
2008-03-09 00:29:42 +00:00
Chris Lattner
7173d3bd70 Teach SD some vector identities, allowing us to compile vec_set-9 into:
_test3:
	movd	%rdi, %xmm1
	#IMPLICIT_DEF %xmm0
	punpcklqdq	%xmm1, %xmm0
	ret

instead of:

_test3:
	#IMPLICIT_DEF %rax
	movd	%rax, %xmm0
	movd	%rdi, %xmm1
	punpcklqdq	%xmm1, %xmm0
	ret

This is still not ideal.  There is no reason to two xmm regs.

llvm-svn: 48058
2008-03-08 23:43:36 +00:00
Evan Cheng
dba1dfe962 Implement x86 support for @llvm.prefetch. It corresponds to prefetcht{0|1|2} and prefetchnta instructions.
llvm-svn: 48042
2008-03-08 00:58:38 +00:00
Bill Wendling
f86174fa61 Something that kills a super-register also
kills the sub-register.

llvm-svn: 48038
2008-03-07 23:45:15 +00:00
Evan Cheng
5f74d1a8dc Fixed a register scavenger bug. If a def is re-defining part of a super register, there must be an implicit def of the super-register on the MI.
llvm-svn: 48024
2008-03-07 20:12:54 +00:00
Bill Wendling
b33eee09d2 When setting the "unused" info, take into account something like this:
%r3<def> = OR %x3<kill>, %x3

We don't want to mark the %r3 as unused even though it's a sub-register of %x3.

llvm-svn: 48003
2008-03-06 23:22:43 +00:00
Evan Cheng
e89c207d52 80 col violation.
llvm-svn: 47998
2008-03-06 17:42:34 +00:00
Gabor Greif
92e00c1e50 some more spelling changes
llvm-svn: 47996
2008-03-06 10:51:21 +00:00