Commit Graph

127 Commits

Author SHA1 Message Date
Evan Cheng 7d564c3b4a lastRegisterUse() should ignore identity copies. Those will be erased.
llvm-svn: 48759
2008-03-25 02:02:19 +00:00
Bill Wendling 6306183df3 Use the bit size of the operand instead of the hard-coded 32 to generate the
mask.

llvm-svn: 48750
2008-03-24 23:16:37 +00:00
Bill Wendling 7e2a6c4112 New testcase.
llvm-svn: 48697
2008-03-22 22:27:01 +00:00
Dan Gohman b9056838d2 Add support for multiple return values for the PPC target by
converting call result lowering to use the CallingConvLowering
infastructure.

llvm-svn: 48552
2008-03-19 21:39:28 +00:00
Evan Cheng 44c0b4f754 Fix live variables issues:
1. If part of a register is re-defined, an implicit kill and an implicit def are added to denote read / mod / write. However, this should only be necessary if the register is actually read later. This is a performance issue.
2. If a sub-register is being defined, and it doesn't have a previous use, do not add a implicit kill to the last use of a super-register:
   = EAX, AX<imp-use,kill>
...
AX =
In this case, EAX is live but AX is killed, this is wrong and will cause the coalescer to do bad things.

llvm-svn: 48521
2008-03-19 00:52:20 +00:00
Dale Johannesen 12c76db312 Make conversions of i8/i16 to ppcf128 work.
llvm-svn: 48493
2008-03-18 17:28:38 +00:00
Evan Cheng d096ec0a86 Rewrite code that propagate isDead information after a dead copy is coalesced. This remove some ugly spaghetti code and fixed a number of subtle bugs.
llvm-svn: 48490
2008-03-18 08:26:47 +00:00
Dan Gohman b72127ac4c More APInt-ification.
llvm-svn: 48344
2008-03-13 22:13:53 +00:00
Dale Johannesen 1b12647544 The feature this is testing did not work in the general case,
and has been removed.

llvm-svn: 48232
2008-03-11 17:48:26 +00:00
Evan Cheng 34e5b34426 Learn how to xfail a test.
llvm-svn: 48219
2008-03-11 07:51:31 +00:00
Evan Cheng 756f9d9c51 XFAIL due to Dale's change.
llvm-svn: 48216
2008-03-11 07:15:44 +00:00
Dan Gohman d6819da453 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
Dan Gohman f4300950f1 Implement more support for fp-to-i128 and i128-to-fp conversions.
llvm-svn: 48189
2008-03-10 23:03:31 +00:00
Bill Wendling 24155f7381 Update llc flags for PPC register scavenger.
llvm-svn: 48187
2008-03-10 22:59:08 +00:00
Chris Lattner 3ed815a3a5 upgrade this test
llvm-svn: 48062
2008-03-09 00:32:10 +00:00
Dan Gohman d2ab5fd713 Add support for calls with i128 return values on ppc64.
llvm-svn: 48041
2008-03-08 00:19:12 +00:00
Dan Gohman 8d2ead2e34 Add support for lowering 128-bit shifts on ppc64.
llvm-svn: 48029
2008-03-07 20:36:53 +00:00
Bill Wendling 92e52c636f Add testcase.
llvm-svn: 48005
2008-03-06 23:34:22 +00:00
Evan Cheng 29b502e0e0 Fix a coalescer bug wrt how dead copy interval is shortened.
llvm-svn: 47966
2008-03-05 22:09:42 +00:00
Bill Wendling 09de8e494e Use -enable-ppc-regscavenger flag for these checks
llvm-svn: 47916
2008-03-04 23:16:26 +00:00
Bill Wendling 632ea65072 This is the initial check-in for adding register scavenging to PPC. (Currently,
PPC-64 doesn't work.) This also lowers the spilling of the CR registers so that
it uses a register other than the default R0 register (the scavenger scrounges
for one). A significant part of this patch fixes how kill information is
handled.

llvm-svn: 47863
2008-03-03 22:19:16 +00:00
Chris Lattner bd0bb3f07f Evan implemented this.
llvm-svn: 47827
2008-03-02 17:56:29 +00:00
Dale Johannesen 820de906b1 New test for misaligned Altivec laod/store.
llvm-svn: 47698
2008-02-27 23:14:50 +00:00
Dan Gohman 26854f242e Don't hard-code the mask size to be 32, which is incorrect on ppc64
and was causing aborts with the new APInt changes. This may also be
fixing an obscure ppc64 bug.

llvm-svn: 47692
2008-02-27 21:12:32 +00:00
Bill Wendling 30075852ef Upgrade testcase.
llvm-svn: 47644
2008-02-26 23:22:40 +00:00
Gabor Greif 3d9755f6ca Really feed llvm-as with the testcase, do not let it read from stdin. This fixes the hangs seen on solaris10.
llvm-svn: 47604
2008-02-26 13:37:13 +00:00
Tanya Lattner a99d8b5a9a Remove llvm-upgrade and update tests.
llvm-svn: 47325
2008-02-19 08:07:33 +00:00
Nate Begeman fe61967361 Add testcase for recent legalizer change
llvm-svn: 47049
2008-02-13 06:48:40 +00:00
Evan Cheng ad4d57a2f5 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
Evan Cheng 8d78b0597b 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
Chris Lattner f4e5e556fd Add target triples to these so they don't fail on linux.
llvm-svn: 46496
2008-01-29 06:26:07 +00:00
Bill Wendling a60c61dc1a Need to convert to LLVM code and not C.
llvm-svn: 46397
2008-01-26 06:56:08 +00:00
Bill Wendling 0b973210f8 Rename the .c to .ll
llvm-svn: 46396
2008-01-26 06:53:40 +00:00
Bill Wendling 0f69974fdb Move testcase to the code gen directory.
llvm-svn: 46395
2008-01-26 06:53:06 +00:00
Dale Johannesen 5c94cb3596 Implement flt_rounds for PowerPC.
llvm-svn: 46174
2008-01-18 19:55:37 +00:00
Chris Lattner f5b46f7dad Fix a latent bug exposed by my truncstore patch. We compiled stfiwx-2.ll to:
_test:
	fctiwz f0, f1
	stfiwx f0, 0, r4
	blr 

instead of:

_test:
	fctiwz f0, f1
	stfd f0, -8(r1)
	nop
	nop
	lwz r2, -4(r1)
	stb r2, 0(r4)
	blr 

The former is not correct (stores 4 bytes, not 1).

llvm-svn: 46161
2008-01-18 16:54:56 +00:00
Chris Lattner aebbe4700a add testcase for regression
llvm-svn: 46073
2008-01-16 18:03:52 +00:00
Chris Lattner b17db3afa8 remove darwin/i386 t-t
llvm-svn: 45743
2008-01-08 06:52:51 +00:00
Chris Lattner 89f36e6b21 Finally implement correct ordered comparisons for PPC, even though
the code generated is not wonderful.  This turns a miscompilation into
a code quality bug (noted in the ppc readme).  This fixes PR642, which
is over 2 years old (!).  Nate, please review this.

llvm-svn: 45742
2008-01-08 06:46:30 +00:00
Chris Lattner f47015bc74 Fix a significant code quality regression I introduced on PPC64 quite
a while ago.  We now produce:

_foo:
	mflr r0
	std r0, 16(r1)
	ld r2, 16(r1)
	std r2, 0(r3)
	ld r0, 16(r1)
	mtlr r0
	blr 

instead of:

_foo:
	mflr r0
	std r0, 16(r1)
	lis r0, 0
	ori r0, r0, 16
	ldx r2, r1, r0
	std r2, 0(r3)
	ld r0, 16(r1)
	mtlr r0
	blr 

for:

void foo(void **X) {
  *X = __builtin_return_address(0);
}

on ppc64.

llvm-svn: 44701
2007-12-08 07:04:58 +00:00
Chris Lattner f6a8156e4f implement __builtin_return_addr(0) on ppc.
llvm-svn: 44700
2007-12-08 06:59:59 +00:00
Chris Lattner 79ae9895f6 Fix a crash on invalid code due to memcpy lowering.
llvm-svn: 44378
2007-11-27 22:14:42 +00:00
Chris Lattner 6edac0ad1d Testcase for PR1811
llvm-svn: 44244
2007-11-19 21:43:22 +00:00
Dale Johannesen a674612d94 Testcase from PR 1508 (although its's somewhat
orthogonal to the main problem there)

llvm-svn: 44194
2007-11-16 23:16:35 +00:00
Evan Cheng 17b0e3e1ae Skip over deleted val#'s.
llvm-svn: 43700
2007-11-05 06:46:45 +00:00
Bill Wendling b0bfd69684 On second thought. Remove this as it should never be generated in the first
place.

llvm-svn: 43400
2007-10-26 20:34:37 +00:00
Bill Wendling 6d15b32c15 - Remove the hacky code that forces a memcpy. Alignment is taken care of in the
FE.
- Explicitly pass in the alignment of the load & store.
- XFAIL 2007-10-23-UnalignedMemcpy.ll because llc has a bug that crashes on
  unaligned pointers.

llvm-svn: 43398
2007-10-26 20:24:42 +00:00
Bill Wendling e3b859298a If there's an unaligned memcpy to/from the stack, don't lower it. Just call the
memcpy library function instead.

llvm-svn: 43270
2007-10-23 23:32:40 +00:00
Evan Cheng ec271b104c Temporary solution: added a different set of BCTRL_Macho / BCTRL_ELF with right callee-saved defs set for ppc64.
llvm-svn: 43248
2007-10-23 06:42:42 +00:00
Evan Cheng bdbed66333 Use ptr type in the immediate field of a BxA instruction so we don't end up selecting 32-bit call instruction for ppc64.
llvm-svn: 43228
2007-10-22 19:46:19 +00:00