Commit Graph

8851 Commits

Author SHA1 Message Date
Chris Lattner
0a3d4d971d rename PT -> VT for VectorTypes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47805 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-02 03:18:46 +00:00
Chris Lattner
c8b6d339d7 Print i32/i64 integer constants as 1u instead of ((unsigned int)1).
Use dyn_cast better.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47804 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-02 03:16:38 +00:00
Chris Lattner
a11deb0392 Move pr717 to here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47803 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-02 02:51:40 +00:00
Andrew Lenharth
fe0753efba good catch anton
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47800 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-01 23:18:21 +00:00
Andrew Lenharth
ce1105da43 make CAS work
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47799 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-01 22:27:48 +00:00
Andrew Lenharth
26ed8697d4 all but CAS working on x86
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47798 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-01 21:52:34 +00:00
Andrew Lenharth
ea7da50e5a Add lock prefix support to x86. Also add the instructions necessary for the atomic ops. They are still marked pseudo, since I cannot figure out what format to use, but they are the correct opcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47795 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-01 13:37:02 +00:00
Anton Korobeynikov
8213f9cf94 Use enumeration for preffered EH dwarf encoding reason
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47770 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-29 22:09:08 +00:00
Anders Carlsson
b26947e967 Use the correct instruction encodings for the 64-bit MMX movd.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47740 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-29 01:35:12 +00:00
Evan Cheng
d703ed6aed Added option -align-loops=<true/false> to disable loop aligner pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47736 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-28 23:29:57 +00:00
Dale Johannesen
28d08fdb9f Interface of getByValTypeAlignment differed between
generic & x86 versions; change generic to follow x86
and improve comments.  Add PPC version (not right
for non-Darwin.)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47734 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-28 22:31:51 +00:00
Lauro Ramos Venancio
f3c630e3fc Initialize TextAlignFillValue. Fix revision 47703.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47732 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-28 22:14:09 +00:00
Lauro Ramos Venancio
1f4a887e32 Avoid collisions in value names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47725 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-28 20:26:04 +00:00
Chris Lattner
e29536ca8d add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47720 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-28 17:21:27 +00:00
Evan Cheng
e526d8a955 Set to default: x86 no longer fold and into test if it has more than one use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47711 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-28 07:46:38 +00:00
Chris Lattner
6baaf91598 Sparc backend doesn't support debug info yet, mark the nodes as expand. This fixes a crash on
test/DebugInfo/funccall.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47709 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-28 05:54:25 +00:00
Chris Lattner
a4b521598a Fix CodeGen/Generic/storetrunc-fp.ll on sparc, PR2105
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47707 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-28 05:48:04 +00:00
Chris Lattner
61273d55e9 fix CodeGen/Generic/2008-01-25-dag-combine-mul.ll on sparc, PR2105
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47706 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-28 05:44:20 +00:00
Chris Lattner
48840f8db9 target-indep codegen memcpy lowering issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47705 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-28 05:34:27 +00:00
Chris Lattner
daf6c541b2 Add a random not very important note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47704 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-28 04:52:59 +00:00
Evan Cheng
fb8075d03f Add a quick and dirty "loop aligner pass". x86 uses it to align its loops to 16-byte boundaries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47703 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-28 00:43:03 +00:00
Eli Friedman
41ce5b82da A few more small things I've run into.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47702 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-28 00:21:43 +00:00
Anton Korobeynikov
7b1b7f5c5a EHPreferredDataFormat hook for PPC targets. Looks like Darwin
uses the same encoding everywhere. Linux FIXME'ed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47701 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27 23:49:15 +00:00
Anton Korobeynikov
cee750fb1e Preparation step for some cleanup/generalization in EH information emission:
provide TAI hook for selection of EH data emission format. Currently unused.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47699 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27 23:33:50 +00:00
Dan Gohman
ec59b95a19 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47692 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27 21:12:32 +00:00
Evan Cheng
fd1074f171 This is done.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47688 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27 20:26:32 +00:00
Bill Wendling
6ef781f3ce Final de-tabification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47663 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27 06:33:05 +00:00
Chris Lattner
b09916bdfb Make X86TargetLowering::LowerSINT_TO_FP return without creating a dead
stack slot and store if the  SINT_TO_FP is actually legal.  This allows
us to compile:

double a(double b) {return (unsigned)b;}

to:

_a:
	cvttsd2siq	%xmm0, %rax
	movl	%eax, %eax
	cvtsi2sdq	%rax, %xmm0
	ret

instead of:

_a:
	subq	$8, %rsp
	cvttsd2siq	%xmm0, %rax
	movl	%eax, %eax
	cvtsi2sdq	%rax, %xmm0
	addq	$8, %rsp
	ret

crazy.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47660 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27 05:57:41 +00:00
Chris Lattner
22eedf4eec this code is correct but strange looking ;-)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47659 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27 05:48:44 +00:00
Chris Lattner
d0ba2a9c14 Compile x86-64-and-mask.ll into:
_test:
	movl	%edi, %eax
	ret

instead of:

_test:
        movl    $4294967295, %ecx
        movq    %rdi, %rax
        andq    %rcx, %rax
        ret

It would be great to write this as a Pat pattern that used subregs 
instead of a 'pseudo' instruction, but I don't know how to do that
in td files.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47658 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27 05:47:54 +00:00
Evan Cheng
d36531249a Spiller now remove unused spill slots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47657 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27 03:04:06 +00:00
Dan Gohman
b3564aa836 Convert the last remaining users of the non-APInt form of
ComputeMaskedBits to use the APInt form, and remove the
non-APInt form.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47654 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27 01:23:58 +00:00
Chris Lattner
ba309d43aa add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47652 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27 01:17:20 +00:00
Arnold Schwaighofer
258bb1b8e8 Refactor according to Evan's and Anton's suggestions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47635 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 22:21:54 +00:00
Bill Wendling
e6d088acc9 Rename PrintableName to Name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47629 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 21:47:57 +00:00
Bill Wendling
74ab84c31e Change "Name" to "AsmName" in the target register info. Gee, a refactoring tool
would have been a Godsend here!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47625 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 21:11:01 +00:00
Arnold Schwaighofer
16a3e52d08 Correct function comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47606 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 17:50:59 +00:00
Bill Wendling
85db3a96b4 De-tabify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47600 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 10:57:23 +00:00
Arnold Schwaighofer
a2a4b475fc Add support for intermodule tail calls on x86/32bit with
GOT-style position independent code. Before only tail calls to
protected/hidden functions within the same module were optimized.
Now all function calls are tail call optimized.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47594 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 10:21:54 +00:00
Arnold Schwaighofer
865c68188a Change the lowering of arguments for tail call optimized
calls. Before arguments that could overwrite each other were
explicitly lowered to a stack slot, not giving the register allocator
a chance to optimize. Now a sequence of copyto/copyfrom virtual
registers ensures that arguments are loaded in (virtual) registers
before they are lowered to the stack slot (and might overwrite each
other). Also parameter stack slots are marked mutable for
(potentially) tail calling functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47593 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 09:19:59 +00:00
Dan Gohman
545914311a Revert the assert for MUL_LOHI with an unused high result; Chris
pointed out that this isn't correct at -O0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47575 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 22:43:48 +00:00
Dale Johannesen
14e2ea9a55 Revise previous patch per review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47573 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 22:29:22 +00:00
Dan Gohman
c2d9b5fcdf Add an assert to verify that we don't see an
{S,U}MUL_LOHI with an unused high value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47569 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 22:15:55 +00:00
Dan Gohman
fcf81db600 Remove the hack that turned an {S,U}MUL_LOHI with an unused high
result into a MUL late in the X86 codegen process. ISD::MUL is
once again Legal on X86, so this is no longer needed. And, the
hack was suboptimal; see PR1874 for details.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47567 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 21:57:04 +00:00
Dan Gohman
2e68b6f52d Convert MaskedValueIsZero and all its users to use APInt. Also add
a SignBitIsZero function to simplify a common use case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47561 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 21:11:39 +00:00
Dale Johannesen
079f2a66ae Expand removal of MMX memory copies to allow 1 level
of TokenFactor underneath chain (seems to be enough)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47554 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 19:20:14 +00:00
Bill Wendling
181eb737b2 Some platforms use the same name for 32-bit and 64-bit registers (like
%r3 on PPC) in their ASM files. However, it's hard for humans to read
during debugging. Adding a new field to the register data that lets you
specify a different name to be printed than the one that goes into the
ASM file -- %x3 instead of %r3, for instance.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47534 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-24 00:56:13 +00:00
Scott Michel
a59d469e9b Merge current work back to tree to minimize diffs and drift. Major highlights
for CellSPU modifications:

- SPUInstrInfo.td refactoring: "multiclass" really is _your_ friend.
- Other improvements based on refactoring effort in SPUISelLowering.cpp,
  esp. in SPUISelLowering::PerformDAGCombine(), where zero amount shifts and
  rotates are now eliminiated, other scalar-to-vector-to-scalar silliness
  is also eliminated.
- 64-bit operations are being implemented, _muldi3.c gcc runtime now
  compiles and generates the right code. More work still needs to be done.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47532 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-23 18:41:37 +00:00
Evan Cheng
c19eca38ef Turning on remat of pic loads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47524 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-23 02:07:42 +00:00
Evan Cheng
b2a0abce1e No need recognize load from a fixed argument slot as re-materializable. LiveIntervalAnalysis already handles it as a special case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47522 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-23 01:47:44 +00:00
Dale Johannesen
22c3979fca Split ParameterAttributes.h, putting the complicated
stuff into ParamAttrsList.h.  Per feedback from
ParamAttrs changes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47504 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22 22:17:59 +00:00
Dale Johannesen
3edd6dcf82 MMX vectors are passed 4-byte aligned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47483 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22 17:47:28 +00:00
Evan Cheng
d8850a512e Allow re-materialization of pic load (controlled by -remat-pic-load for now).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47476 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22 09:25:47 +00:00
Chris Lattner
d2b1fb27df copy mmx values from/to memory with GPRs on x86-32
instead of with mmx registers.  This horribleness is apparently
done by gcc to avoid having to insert emms in places that really 
should have it.  This is the second half of rdar://5741668.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47474 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22 05:18:04 +00:00
Chris Lattner
149a4e56fc Start using GPR's to copy around mmx value instead of mmx regs.
GCC apparently does this, and code depends on not having to do
emms when this happens.  This is x86-64 only so far, second half
should handle x86-32.

rdar://5741668


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47470 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22 02:09:43 +00:00
Eli Friedman
a2e7efa6d3 A few minor updates, removing implemented stuff and adding a couple of
new things.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47458 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21 21:16:49 +00:00
Chris Lattner
7c1687c196 Dan implemented one multiply issue. Replace it with another. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47431 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21 06:51:29 +00:00
Andrew Lenharth
ab0b949e0e Atomic op support. If any gcc test uses __sync builtins, it might start failing on archs that haven't implemented them yet
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47430 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21 06:45:13 +00:00
Evan Cheng
3738f2d59f Poorly named option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47400 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 20:57:32 +00:00
Evan Cheng
5144ed1e35 Temporarily backing out r47337. It breaks a number of CBE tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47385 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 18:32:05 +00:00
Anton Korobeynikov
4aefd6b7d4 Fix newly-introduced 4.3 warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47375 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 12:07:57 +00:00
Anton Korobeynikov
d28b57569d Fix code style
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47370 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 11:24:05 +00:00
Anton Korobeynikov
7c1c261272 Remove bunch of gcc 4.3-related warnings from Target
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47369 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 11:22:39 +00:00
Anton Korobeynikov
ae9f3a3b7c Unbreak build with gcc 4.3: provide missed includes and silence most annoying warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47367 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 11:08:44 +00:00
Evan Cheng
79964fdbaf Disable for now. This is pessimizing code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47354 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 02:29:17 +00:00
Evan Cheng
e9c608d6cc Add hidden option -x86-fold-and-in-test to test the effect the test / and folding change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47351 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 23:36:51 +00:00
Andrew Lenharth
86532db5d7 fix some byval problems in the cbe. Closes PR2065
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47337 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 19:47:54 +00:00
Chris Lattner
ce2bcc8839 Don't fold and's into test instructions if they have multiple uses.
This compiles test-nofold.ll into:

_test:
	movl	$15, %ecx
	andl	4(%esp), %ecx
	testl	%ecx, %ecx
	movl	$42, %eax
	cmove	%ecx, %eax
	ret

instead of:
_test:
	movl	4(%esp), %eax
	movl	%eax, %ecx
	andl	$15, %ecx
	testl	$15, %eax
	movl	$42, %eax
	cmove	%ecx, %eax
	ret



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47330 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 17:37:35 +00:00
Evan Cheng
422cba6ed0 Me not like duplicated comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47300 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 02:05:16 +00:00
Evan Cheng
efec751a1b - When DAG combiner is folding a bit convert into a BUILD_VECTOR, it should check if it's essentially a SCALAR_TO_VECTOR. Avoid turning (v8i16) <10, u, u, u> to <10, 0, u, u, u, u, u, u>. Instead, simply convert it to a SCALAR_TO_VECTOR of the proper type.
- X86 now normalize SCALAR_TO_VECTOR to (BIT_CONVERT (v4i32 SCALAR_TO_VECTOR)). Get rid of X86ISD::S2VEC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47290 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 23:04:32 +00:00
Dan Gohman
b00ee21f21 Chris pointed out that it's not necessary to set i64 MUL to Expand
on x86-32 since i64 itself is not a Legal type. And, update some
comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47282 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 19:34:53 +00:00
Chris Lattner
7c4e9a44a4 upgrade some tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47280 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 18:46:39 +00:00
Nate Begeman
e9fe65c973 Add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47279 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 18:39:23 +00:00
Chris Lattner
92b416f64e Add a note about sext from i1 plus flags use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47278 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 18:30:13 +00:00
Dan Gohman
339ffedca9 Don't mark scalar integer multiplication as Expand on x86, since x86
has plain one-result scalar integer multiplication instructions.
This avoids expanding such instructions into MUL_LOHI sequences that
must be special-cased at isel time, and avoids the problem with that
code that provented memory operands from being folded.

This fixes PR1874, addressesing the most common case. The uncommon
cases of optimizing multiply-high operations will require work
in DAGCombiner.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47277 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 17:55:26 +00:00
Chris Lattner
456012c72e move PR2053 to here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47237 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-17 19:43:57 +00:00
Andrew Lenharth
d497d9fab6 I cannot find a libgcc function for this builtin. Therefor expanding it to a noop (which is how it use to be treated). If someone who knows the x86 backend better than me could tell me how to get a lock prefix on an instruction, that would be nice to complete x86 support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47213 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-16 14:46:26 +00:00
Andrew Lenharth
22c5c1b2df llvm.memory.barrier, and impl for x86 and alpha
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47204 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-16 01:24:58 +00:00
Chris Lattner
ec321b4d64 Handle \n's in value names for more targets. The asm printers
really really really need refactoring :(



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47171 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 19:04:54 +00:00
Chris Lattner
3502d0dac3 If the llvm name contains an unprintable character, don't print it in
the global comment.  This prevents printing things like:

...  # foo
bar

when the name is "foo\nbar".



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47170 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 18:56:05 +00:00
Dale Johannesen
3b407444c9 Cosmetics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47168 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 18:40:53 +00:00
Dale Johannesen
ab1a0354ec Remove warning about 64-bit code on processor
that doesn't support it.  Per Chris.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47162 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 18:09:51 +00:00
Dale Johannesen
b4c9a687eb nocona, core2 and penryn support 64 bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47149 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 01:22:41 +00:00
Dale Johannesen
db01c8ba26 Rewrite tblgen handling of subtarget features so
it follows the order of the enum, not alphabetical.
The motivation is to make -mattr=+ssse3,+sse41
select SSE41 as it ought to.  Added "ignored"
enum values of 0 to PPC and SPU to avoid compiler
warnings.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47143 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 23:35:16 +00:00
Nate Begeman
ccef580583 Fix single precision FP constants on SPU. They are actually legal,
which allows us to kill a target-specific node.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47127 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 18:43:04 +00:00
Duncan Sands
00fee65fd2 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47122 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 17:28:50 +00:00
Nate Begeman
e179584f9b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47121 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 08:57:00 +00:00
Nate Begeman
0fec975a18 Move some useful operands up into the all-targets .td
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47115 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 07:25:46 +00:00
Chris Lattner
eb05f90c71 upgrade some entries, remove stuff that is done.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47109 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 06:19:02 +00:00
Chris Lattner
ea1cddf546 the mid-level optimizer removes this stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47108 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 05:43:18 +00:00
Chris Lattner
48b4d96949 this one is easy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47107 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 05:41:38 +00:00
Chris Lattner
8b0cb7bcc6 This readme entry is done, testcase here: CodeGen/X86/zero-remat.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47106 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 05:39:46 +00:00
Dan Gohman
f4f92f5ebe Assigning an APInt to 0 with plain assignment gives it a one-bit
size. Initialize these APInts to properly-sized zero values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47099 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 23:07:24 +00:00
Dan Gohman
977a76fbb6 Simplify some logic in ComputeMaskedBits. And change ComputeMaskedBits
to pass the mask APInt by value, not by reference. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47096 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 22:28:48 +00:00
Nicolas Geoffray
afe6c2b001 Enable exception handling int JIT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47079 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 18:39:37 +00:00
Chris Lattner
a1998d1cba Fix the PPC JIT regressions by encoding zeroreg as 0 for BLR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47067 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 17:24:14 +00:00
Chris Lattner
9f72d1a730 don't try to avoid inserting loads when lowering FORMAL_ARGUMENTS.
DAGCombine is now quite good at zapifying them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47053 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 07:35:30 +00:00
Nate Begeman
b5041b3085 readme updates
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47051 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 07:06:12 +00:00
Nate Begeman
ba8d51c1d7 Make register scavenging happy by not using a reg (CR0) that isn't defined
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47045 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 02:58:33 +00:00
Evan Cheng
a4d16a1f0d commuteInstr() can now commute non-ssa machine instrs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47043 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 02:46:49 +00:00
Dan Gohman
fd29e0eb06 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47039 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 00:35:47 +00:00
Dale Johannesen
3006c39e3a __DATA not __DATA__ is the right segment name on darwin.
Spotted by Nick Kledzik.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47037 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-12 23:35:09 +00:00
Nate Begeman
bf1caa9854 Remove some dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47036 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-12 22:54:40 +00:00
Nate Begeman
cdd1eeca2c SSE4.1 64b integer insert/extract pattern support
Move formats into the formats file


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47035 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-12 22:51:28 +00:00
Evan Cheng
394d28048c Revert r46916 PPCTargetAsmInfo.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47020 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-12 19:25:12 +00:00
Evan Cheng
9f143ce989 Only using x86-64 rip relative addressing in non-staic mode?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47019 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-12 19:20:46 +00:00
Evan Cheng
add251754c Update comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47002 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-12 07:59:55 +00:00
Evan Cheng
5ae45caf79 Unbreak various insert_vector_elt and extract_vector_elt tests in presence of SSE4.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47001 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-12 07:59:45 +00:00
Nate Begeman
5bb013c34a Stuff noticed while grepping code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46979 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-11 23:47:56 +00:00
Nate Begeman
14d12caf1d Enable SSE4 codegen and pattern matching.
Add some notes to the README.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46949 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-11 04:19:36 +00:00
Nate Begeman
a6ed0aa8ec additional missing feature
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46948 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-11 04:16:09 +00:00
Nate Begeman
ab5d56c6b9 xmm0 variable blends
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46931 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-10 18:47:57 +00:00
Dan Gohman
6f0d024a53 Rename MRegisterInfo to TargetRegisterInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46930 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-10 18:45:23 +00:00
Nick Lewycky
16b0bd6c83 Match GCC's behaviour for these sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46916 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-10 00:03:54 +00:00
Nate Begeman
fea2be50b9 memopv16i8 had wrong alignment requirement, would have broken pabsb
pabs{b,w,d} are not two address
fix extract-to-mem sse4 ops
add sse4 vector sign extend nodes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46915 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-09 23:46:37 +00:00
Nate Begeman
1426d52cab Skeleton of insert and extract matching, more to come
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46902 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-09 01:38:08 +00:00
Nate Begeman
b5af3344c1 Tablegen support for insert & extract element matching
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46901 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-09 01:37:05 +00:00
Evan Cheng
5fd79d0560 It's not always safe to fold movsd into xorpd, etc. Check the alignment of the load address first to make sure it's 16 byte aligned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46893 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-08 21:20:40 +00:00
Dale Johannesen
0c191872ab 64-bit (MMX) vectors do not need restrictive alignment.
128-bit vectors need it only when SSE is on.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46890 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-08 19:48:20 +00:00
Dan Gohman
60783304f6 Avoid needlessly casting away const qualifiers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46877 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-08 03:29:40 +00:00
Evan Cheng
33663fc104 Added missing entries in X86 load / store folding tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46866 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-08 00:12:56 +00:00
Dan Gohman
3069b87437 Follow Chris' suggestion; change the PseudoSourceValue accessors
to return pointers instead of references, since this is always what
is needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46857 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-07 18:41:25 +00:00
Dan Gohman
4fdad172de Add SourceValue information for outgoing argument stores on x86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46854 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-07 16:28:05 +00:00
Evan Cheng
be3bf42331 Fix a x86-64 codegen deficiency. Allow gv + offset when using rip addressing mode.
Before:
_main:
        subq    $8, %rsp
        leaq    _X(%rip), %rax
        movsd   8(%rax), %xmm1
        movss   _X(%rip), %xmm0
        call    _t
        xorl    %ecx, %ecx
        movl    %ecx, %eax
        addq    $8, %rsp
        ret
Now:
_main:
        subq    $8, %rsp
        movsd   _X+8(%rip), %xmm1
        movss   _X(%rip), %xmm0
        call    _t
        xorl    %ecx, %ecx
        movl    %ecx, %eax
        addq    $8, %rsp
        ret

Notice there is another idiotic codegen issue that needs to be fixed asap:
xorl    %ecx, %ecx
movl    %ecx, %eax


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46850 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-07 08:53:49 +00:00
Evan Cheng
15246738f2 In some cases, e.g. ADD32ri, no transformation is made. Guide against it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46849 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-07 08:29:53 +00:00
Dan Gohman
69de1932b3 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46827 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-06 22:27:42 +00:00
Evan Cheng
ebaaa91094 Move to getCALLSEQ_END to ensure CALLSEQ_END node produces a flag. This is consistent with the definition in td file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46775 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-05 22:44:06 +00:00
Dale Johannesen
e672af15d6 Implement sseregparm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46764 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-05 20:46:33 +00:00
Nate Begeman
5a804e3e21 Ident mnemonics appropriately
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46746 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-05 08:49:09 +00:00
Evan Cheng
4e3f5a4e9c 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46724 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-04 23:06:48 +00:00
Nate Begeman
c451ac0a42 This method should be virtual
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46723 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-04 23:04:24 +00:00
Nate Begeman
48a65511d0 Eliminate some redundant code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46720 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-04 21:44:06 +00:00
Nate Begeman
204e84e138 The rest of the SSE4.1 intrinsic patterns that are obvious to me. Getting
Evan's help with the rest.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46697 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-04 06:00:24 +00:00
Nate Begeman
2f6f1c02ca Some more SSE 4.1 intrinsic patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46696 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-04 05:34:34 +00:00
Nate Begeman
63ec90a6a8 SSE 4.1 Intrinsics and detection
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46681 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-03 07:18:54 +00:00
Chris Lattner
3d62d780ab explicitly include Compiler.h instead of getting it from tblgen in the middle of a class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46676 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-03 05:43:57 +00:00
Chris Lattner
a47b9bcbde don't do ReplaceUses on a result that doesn't exist.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46673 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-03 03:20:59 +00:00
Evan Cheng
4eecdeb3fa Get rid of the annoying blank lines before labels.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46667 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-02 08:39:46 +00:00
Nick Lewycky
916a9f071f Don't use uninitialized values. Fixes vec_align.ll on X86 Linux.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46666 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-02 08:29:58 +00:00
Evan Cheng
fcf5d4f456 Unbreak ppc debug support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46665 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-02 05:06:29 +00:00
Evan Cheng
a844bdeab3 SDIsel processes llvm.dbg.declare by recording the variable debug information descriptor and its corresponding stack frame index in MachineModuleInfo. This only works if the local variable is "homed" in the stack frame. It does not work for byval parameter, etc.
Added ISD::DECLARE node type to represent llvm.dbg.declare intrinsic. Now the intrinsic calls are lowered into a SDNode and lives on through out the codegen passes.
For now, since all the debugging information recording is done at isel time, when a ISD::DECLARE node is selected, it has the side effect of also recording the variable. This is a short term solution that should be fixed in time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46659 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-02 04:07:54 +00:00
Evan Cheng
b8033e821d Frame index can be negative.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46655 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-02 00:17:00 +00:00
Lauro Ramos Venancio
859efca7f9 CBackend: Implement unaligned load/store.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46646 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-01 21:25:59 +00:00
Evan Cheng
1b08bbca55 Remove the nasty LABEL hack with a much less evil one. Now llvm.dbg.func.start implies a stoppoint is set. SelectionDAGISel records a new source line but does not create a ISD::LABEL node for this special stoppoint. Asm printer will magically print this label. This ensures nothing is emitted before.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46635 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-01 09:10:45 +00:00
Evan Cheng
334dc1f58d Revert 46556 and 46585. Dan please fix the PseudoSourceValue problem and re-commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46623 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31 21:00:00 +00:00
Evan Cheng
bb81d97feb Add an extra operand to LABEL nodes which distinguishes between debug, EH, or misc labels. This fixes the EH breakage. However I am not convinced this is *the* solution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46609 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31 09:59:15 +00:00
Christopher Lamb
8535624739 Allow ComplexExpressions in InstrInfo.td files to be slightly more... complex! ComplexExpressions can now have attributes which affect how TableGen interprets
the pattern when generating matchin code. 

The first (and currently, only) attribute causes the immediate parent node of the ComplexPattern operand to be passed into the matching code rather than the node at the root of the entire DAG containing the pattern.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46606 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31 07:27:46 +00:00
Evan Cheng
c67aa7cbd5 Add x86 specific getFrameIndexOffset(). This fixes local variable debugging info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46598 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31 04:06:00 +00:00
Evan Cheng
72bebb9205 MRegisterInfo::getLocation() is a really bad idea. Its function is to calculate the offset from frame pointer to a stack slot and then storing the delta in a MachineLocation object. The name is bad (it implies a getter), and MRegisterInfo doesn't need to know about MachineLocation.
Replace getLocation() with getFrameIndexOffset() which returns the delta from frame pointer to stack slot. Dwarf writer can then use the information for whatever it wants.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46597 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31 03:37:28 +00:00
Evan Cheng
0a75538a68 Makes the same change in ppc backend: avoid inserting prologue before debug labels.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46596 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31 03:33:38 +00:00
Dan Gohman
bbfb9c57c7 Avoid unnecessarily casting away const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46590 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31 01:01:48 +00:00
Dan Gohman
1a0248690a Rename ISD::FLT_ROUNDS to ISD::FLT_ROUNDS_ to avoid conflicting
with the real FLT_ROUNDS (defined in <float.h>).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46587 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31 00:41:03 +00:00
Dan Gohman
c6c391dadd Create a new class, MemOperand, for describing memory references
in the backend. Introduce a new SDNode type, MemOperandSDNode, for
holding a MemOperand in the SelectionDAG IR, and add a MemOperand
list to MachineInstr, and code to manage them. Remove the offset
field from SrcValueSDNode; uses of SrcValueSDNode that were using
it are all all using MemOperandSDNode now.

Also, begin updating some getLoad and getStore calls to use the
PseudoSourceValue objects.

Most of this was written by Florian Brander, some
reorganization and updating to TOT by me.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46585 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31 00:25:39 +00:00
Evan Cheng
965d1b4bba Treat the label for the first @llvm.dbg.stoppoint the same way as the dbg_func_start label. Make sure nothing else is inserted before them.
Note this solution might be somewhat fragile since ISD::LABEL may be used for other
purposes. If that ends up to be an issue, we may need to introduce a different node
for debug labels.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46571 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-30 20:08:35 +00:00
Evan Cheng
ff9b373e8f Even though InsertAtEndOfBasicBlock is an ugly hack it still deserves a proper name. Rename it to EmitInstrWithCustomInserter since it does not necessarily insert
instruction at the end.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46562 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-30 18:18:23 +00:00
Evan Cheng
d2c860cef1 Skip over the label which marks the beginning of the function before inserting prologue code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46546 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-30 03:57:33 +00:00
Scott Michel
7f9ba9bb3c More cleanups for CellSPU:
- Expand tabs... (poss 80-col violations, will get them later...)
- Consolidate logic for SelectDFormAddr and SelectDForm2Addr into a single
  function, simplifying maintenance. Also reduced custom instruction
  generation for SPUvecinsert/INSERT_MASK.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46544 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-30 02:55:46 +00:00
Dan Gohman
b625f2f896 Factor the addressing mode and the load/store VT out of LoadSDNode
and StoreSDNode into their common base class LSBaseSDNode. Member
functions getLoadedVT and getStoredVT are replaced with the common
getMemoryVT to simplify code that will handle both loads and stores.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46538 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-30 00:15:11 +00:00
Evan Cheng
0d9e976ad2 Work in progress. This patch *fixes* x86-64 calls which are modelled as StructRet but really should be return in registers, e.g. _Complex long double, some 128-bit aggregates. This is a short term solution that is necessary only because llvm, for now, cannot model i128 nor call's with multiple results.
Status: This only works for direct calls, and only the caller side is done. Disabled for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46527 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29 19:34:22 +00:00
Duncan Sands
d102593b42 Use getPreferredAlignmentLog or getPreferredAlignment
to get the alignment of global variables, rather than
using hand-made versions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46495 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29 06:23:44 +00:00
Dale Johannesen
ba2a0b960e Handle 'X' constraint in asm's better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46485 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29 02:21:21 +00:00
Scott Michel
053c1da8d9 Overhaul Cell SPU's addressing mode internals so that there are now
only two addressing mode nodes, SPUaform and SPUindirect (vice the
three previous ones, SPUaform, SPUdform and SPUxform). This improves
code somewhat because we now avoid using reg+reg addressing when
it can be avoided. It also simplifies the address selection logic,
which was the main point for doing this.

Also, for various global variables that would be loaded using SPU's
A-form addressing, prefer D-form offs[reg] addressing, keeping the
base in a register if the variable is used more than once.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46483 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29 02:16:57 +00:00
Bill Wendling
200e90c74b If the function has no machine instructions, then emit a "nop" so that
the function label isn't associated with something it shouldn't be.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46449 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-28 09:15:03 +00:00
Chris Lattner
f6b935d8e6 add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46413 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-27 07:31:41 +00:00
Chris Lattner
71d07a0dac Use fldz and fld1 for long double constants instead of a constant pool load.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46411 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-27 06:19:31 +00:00
Chris Lattner
4d53049c92 Add some notes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46405 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-26 20:12:07 +00:00
Chris Lattner
ba96fbc164 Remove some code for inferring alignment info from the x86 backend
now that the dag combiner does it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46404 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-26 20:07:42 +00:00
Bill Wendling
824a721560 If there's no instructions being emitted on X86 for a function, emit a
nop. Emit the nop directly for PPC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46398 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-26 09:03:52 +00:00
Bill Wendling
381802f8e0 If there are no machine instructions emitted for a function, then insert
a "nop" instruction so that we don't have the function's label associated
with something that it's not supposed to be associated with.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46394 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-26 06:51:24 +00:00
Chris Lattner
1910e2f3ec JITEmitter.cpp was trying to sync the icache for function stubs, but
was actually passing a completely incorrect size to sys_icache_invalidate.
Instead of having the JITEmitter do this (which doesn't have the correct 
size), just make the target sync its own stubs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46354 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-25 16:41:09 +00:00
Chris Lattner
6cf73267c6 optimize fxor like for
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46345 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-25 06:14:17 +00:00
Chris Lattner
af723b9ae4 Add target-specific dag combines for FAND(x,0) and FOR(x,0). This allows
us to compile:

double test(double X) {
  return copysign(0.0, X);
}

into:

_test:
	andpd	LCPI1_0(%rip), %xmm0
	ret

instead of:
_test:
	pxor	%xmm1, %xmm1
	andpd	LCPI1_0(%rip), %xmm1
	movapd	%xmm0, %xmm2
	andpd	LCPI1_1(%rip), %xmm2
	movapd	%xmm1, %xmm0
	orpd	%xmm2, %xmm0
	ret



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46344 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-25 05:46:26 +00:00
Anton Korobeynikov
8eea339298 Provide correct DWARF register numbering for debug information emission on x86-32/Darwin.
This should fix bunch of issues.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46337 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-25 00:34:13 +00:00
Chris Lattner
d43d00cf3a Significantly simplify and improve handling of FP function results on x86-32.
This case returns the value in ST(0) and then has to convert it to an SSE
register.  This causes significant codegen ugliness in some cases.  For 
example in the trivial fp-stack-direct-ret.ll testcase we used to generate:

_bar:
	subl	$28, %esp
	call	L_foo$stub
	fstpl	16(%esp)
	movsd	16(%esp), %xmm0
	movsd	%xmm0, 8(%esp)
	fldl	8(%esp)
	addl	$28, %esp
	ret

because we move the result of foo() into an XMM register, then have to
move it back for the return of bar.

Instead of hacking ever-more special cases into the call result lowering code
we take a much simpler approach: on x86-32, fp return is modeled as always 
returning into an f80 register which is then truncated to f32 or f64 as needed.
Similarly for a result, we model it as an extension to f80 + return.

This exposes the truncate and extensions to the dag combiner, allowing target
independent code to hack on them, eliminating them in this case.  This gives 
us this code for the example above:

_bar:
	subl	$12, %esp
	call	L_foo$stub
	addl	$12, %esp
	ret

The nasty aspect of this is that these conversions are not legal, but we want
the second pass of dag combiner (post-legalize) to be able to hack on them.
To handle this, we lie to legalize and say they are legal, then custom expand
them on entry to the isel pass (PreprocessForFPConvert).  This is gross, but
less gross than the code it is replacing :)

This also allows us to generate better code in several other cases.  For 
example on fp-stack-ret-conv.ll, we now generate:

_test:
	subl	$12, %esp
	call	L_foo$stub
	fstps	8(%esp)
	movl	16(%esp), %eax
	cvtss2sd	8(%esp), %xmm0
	movsd	%xmm0, (%eax)
	addl	$12, %esp
	ret

where before we produced (incidentally, the old bad code is identical to what
gcc produces):

_test:
	subl	$12, %esp
	call	L_foo$stub
	fstpl	(%esp)
	cvtsd2ss	(%esp), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movl	16(%esp), %eax
	movsd	%xmm0, (%eax)
	addl	$12, %esp
	ret

Note that we generate slightly worse code on pr1505b.ll due to a scheduling 
deficiency that is unrelated to this patch.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46307 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-24 08:07:48 +00:00
Evan Cheng
2928650262 Let each target decide byval alignment. For X86, it's 4-byte unless the aggregare contains SSE vector(s). For x86-64, it's max of 8 or alignment of the type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46286 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-23 23:17:41 +00:00
Duncan Sands
f9c98e650d The last pieces needed for loading arbitrary
precision integers.  This won't actually work
(and most of the code is dead) unless the new
legalization machinery is turned on.  While
there, I rationalized the handling of i1, and
removed some bogus (and unused) sextload patterns.
For i1, this could result in microscopically
better code for some architectures (not X86).
It might also result in worse code if annotating
with AssertZExt nodes turns out to be more harmful
than helpful.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46280 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-23 20:39:46 +00:00
Dale Johannesen
25edeb32e7 Honor explicit section information on Darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46267 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-23 00:58:14 +00:00
Evan Cheng
2cbdd27305 SSE varargs arguments are passed in memory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46262 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-22 23:26:53 +00:00
Chris Lattner
18bef16d84 Trivial patch to fix two warnings, please pull into llvm 2.2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46243 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-22 04:47:47 +00:00
Anton Korobeynikov
ea74c7e498 Honour ByVal parameter attribute for name decoration
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46200 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-20 14:00:07 +00:00
Anton Korobeynikov
99e635ca69 Remove Darwin'ism
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46199 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-20 13:59:37 +00:00
Anton Korobeynikov
49964d6847 Enable PIC codegen on x86-64/linux
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46198 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-20 13:58:16 +00:00
Duncan Sands
4bdad51596 Need to handle any 'nest' parameter before integer
parameters, since otherwise it won't be passed in
the right register.  With this change trampolines
work on x86-64 (thanks to Luke Guest for providing
access to an x86-64 box).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46192 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-19 16:42:10 +00:00
Dale Johannesen
5c5eb80255 Implement flt_rounds for PowerPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46174 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-18 19:55:37 +00:00
Chris Lattner
ef97c676f9 get symbolic information for ppc ldbl nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46165 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-18 18:51:16 +00:00
Chris Lattner
a7a02fb828 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).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46161 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-18 16:54:56 +00:00
Chris Lattner
3d66185ff8 make a method public
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46159 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-18 06:52:41 +00:00
Dale Johannesen
25a0195114 Revert the part of 45849 that treated weak globals
as weak globals rather than commons.  While not wrong,
this change tickled a latent bug in Darwin's strip,
so revert it for now as a workaround.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46147 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17 23:36:04 +00:00
Dale Johannesen
d15d086956 Revert the part of 45848 that treated weak globals
as weak globals rather than commons.  While not wrong,
this change tickled a latent bug in Darwin's strip,
so revert it for now as a workaround.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46144 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17 23:04:07 +00:00
Scott Michel
58c5818c01 Forward progress: crtbegin.c now compiles successfully!
Fixed CellSPU's A-form (local store) address mode, so that all globals,
externals, constant pool and jump table symbols are now wrapped within
a SPUISD::AFormAddr pseudo-instruction. This now identifies all local
store memory addresses, although it requires a bit of legerdemain during
instruction selection to properly select loads to and stores from local
store, properly generating "LQA" instructions.

Also added mul_ops.ll test harness for exercising integer multiplication.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46142 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17 20:38:41 +00:00
Chris Lattner
ddf89566a9 This commit changes:
1. Legalize now always promotes truncstore of i1 to i8. 
2. Remove patterns and gunk related to truncstore i1 from targets.
3. Rename the StoreXAction stuff to TruncStoreAction in TLI.
4. Make the TLI TruncStoreAction table a 2d table to handle from/to conversions.
5. Mark a wide variety of invalid truncstores as such in various targets, e.g.
   X86 currently doesn't support truncstore of any of its integer types.
6. Add legalize support for truncstores with invalid value input types.
7. Add a dag combine transform to turn store(truncate) into truncstore when
   safe.

The later allows us to compile CodeGen/X86/storetrunc-fp.ll to:

_foo:
	fldt	20(%esp)
	fldt	4(%esp)
	faddp	%st(1)
	movl	36(%esp), %eax
	fstps	(%eax)
	ret

instead of:

_foo:
	subl	$4, %esp
	fldt	24(%esp)
	fldt	8(%esp)
	faddp	%st(1)
	fstps	(%esp)
	movl	40(%esp), %eax
	movss	(%esp), %xmm0
	movss	%xmm0, (%eax)
	addl	$4, %esp
	ret



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46140 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17 19:59:44 +00:00
Chris Lattner
0bd4893a07 * Introduce a new SelectionDAG::getIntPtrConstant method
and switch various codegen pieces and the X86 backend over
  to using it.

* Add some comments to SelectionDAGNodes.h

* Introduce a second argument to FP_ROUND, which indicates
  whether the FP_ROUND changes the value of its input. If
  not it is safe to xform things like fp_extend(fp_round(x)) -> x.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46125 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17 07:00:52 +00:00
Duncan Sands
339e14fbdc Trampoline support for x86-64. This looks like
it should work, but I have no machine to test
it on.  Committed because it will at least
cause no harm, and maybe someone can test it
for me!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46098 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-16 22:55:25 +00:00
Chris Lattner
78631168d1 make it more clear that this predicate only applies to scalar FP types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46058 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-16 06:24:21 +00:00
Chris Lattner
1956d15676 introduce a isTypeInSSEReg predicate, which allows us to simplify
some code.  No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46055 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-16 06:19:45 +00:00
Chris Lattner
7ff79c2d9d My previous commit had an incomplete message, it should have been:
make the 'fp return in ST(0)' optimization smart enough to
look through token factor nodes.  THis allows us to compile 
testcases like CodeGen/X86/fp-stack-retcopy.ll into:

_carg:
	subl	$12, %esp
	call	L_foo$stub
	fstpl	(%esp)
	fldl	(%esp)
	addl	$12, %esp
	ret

instead of:

_carg:
	subl	$28, %esp
	call	L_foo$stub
	fstpl	16(%esp)
	movsd	16(%esp), %xmm0
	movsd	%xmm0, 8(%esp)
	fldl	8(%esp)
	addl	$28, %esp
	ret

Still not optimal, but much better and this is a trivial patch.  Fixing 
the rest requires invasive surgery that is is not llvm 2.2 material.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46054 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-16 05:56:59 +00:00
Chris Lattner
142fb3fee8 make the 'fp return in ST(0)' optimization smart enough to
look through token factor


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46053 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-16 05:53:06 +00:00
Chris Lattner
b4a6eaa75b various whitespace cleanups, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46052 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-16 05:52:18 +00:00
Dale Johannesen
0991d0b7be Missed file from previous checkin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46030 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-15 23:25:27 +00:00
Dale Johannesen
4af3494452 Fix and enable EH for x86-64 Darwin. Adds
ShortenEHDataFor64Bits as a not-very-accurate
abstraction to cover all the changes in DwarfWriter.
Some cosmetic changes to Darwin assembly code for
gcc testsuite compatibility.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46029 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-15 23:24:56 +00:00
Chris Lattner
e46307a54c If someone wants to implement ppc TRAP, they can go for it :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46019 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-15 22:15:02 +00:00
Chris Lattner
48be23cd65 rename SDTRet -> SDTNone.
Move definition of 'trap' sdnode up from x86 instrinfo to targetselectiondag.td.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46017 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-15 22:02:54 +00:00
Owen Anderson
7047dd4d22 Remove DefInst from LiveVariables::VarInfo. Use the facilities on MachineRegisterInfo instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46016 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-15 22:02:46 +00:00
Chris Lattner
da68d30d24 no need to expand ISD::TRAP to X86ISD::TRAP, just match ISD::TRAP.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46015 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-15 21:58:22 +00:00
Anton Korobeynikov
6bf3ba67a5 Fix JIT encoding of trap/ud2 instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46012 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-15 21:40:02 +00:00
Anton Korobeynikov
66fac79b89 For PR1839: add initial support for __builtin_trap. llvm-gcc part is missed
as well as PPC codegen


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46001 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-15 07:02:33 +00:00
Evan Cheng
6bfa8a121d Rename CCIfStruct to CCIfByVal and CCStructAssign to CCPassByVal. Remove unused parameters of CCStructAssign and add size and alignment requirement info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45997 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-15 03:34:58 +00:00
Evan Cheng
bdfd5ef823 Both x86-32 and x86-64 handle byval parameter attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45996 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-15 03:15:41 +00:00
Chris Lattner
3cc838433a Improve the FP stackifier to decide all on its own whether
an instruction kills a register or not.  This is cheap and 
easy to do now that instructions record this on their flags,
and this eliminates the second pass of LiveVariables from the
x86 backend.  This speeds up a release llc by ~2.5%.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45955 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-14 06:41:29 +00:00
Duncan Sands
9e9cf0ce31 Whitespace tweak.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45940 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-13 21:20:29 +00:00
Chris Lattner
3f732807f3 improve cygwin compatibility, patch by Sam Bishop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45917 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-12 22:54:07 +00:00
Chris Lattner
65844fbd84 clarify a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45914 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-12 18:58:46 +00:00
Evan Cheng
7723ab3a51 Indirect call with byval parameter requires a cast first.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45911 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-12 18:53:07 +00:00
Chris Lattner
d3f6a8a8f0 Add support for NetBSD, patch by Krister Walfridsson!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45902 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-12 06:46:09 +00:00
Evan Cheng
8e5712b8bb Code clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45898 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-12 01:08:07 +00:00
Chris Lattner
144ad580fd fix a wordo that gordon noticed :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45896 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-12 00:53:16 +00:00
Chris Lattner
828bb6c978 Any x86 instruction that reads from an invariant location is invariant.
This allows us to sink things like:
	cvtsi2sd	32(%esp), %xmm1
when reading from the argument area, for example.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45895 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-12 00:35:08 +00:00
Evan Cheng
3d79478671 More cbe byval fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45891 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 23:10:11 +00:00
Scott Michel
497e888daf More CellSPU refinements:
- struct_2.ll: Completely unaligned load/store testing

- call_indirect.ll, struct_1.ll: Add test lines to exercise
   X-form [$reg($reg)] addressing

At this point, loads and stores should be under control (he says
in an optimistic tone of voice.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45882 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 21:01:19 +00:00
Chris Lattner
5080f4d991 rename MachineInstr::setInstrDescriptor -> setDesc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45871 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 18:10:50 +00:00
Chris Lattner
f9b3f37abc remove xchg and shift-reg-by-1 instructions, which are dead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45870 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 18:00:50 +00:00
Chris Lattner
047ad94fc0 add a note, remove a done deed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45869 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 18:00:13 +00:00
Arnold Schwaighofer
a51cf0f074 hrm - correct spelling.
Actually were not riding any arguments. Sadly there is no semantic spell checker that is going to safe you from such a mistake.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45868 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 17:10:15 +00:00
Arnold Schwaighofer
c8ab8cde43 Improve tail call optimized call's argument lowering. Before this
commit all arguments where moved to the stack slot where they would
reside on a normal function call before the lowering to the tail call
stack slot. This was done to prevent arguments overwriting each other.
Now only arguments sourcing from a FORMAL_ARGUMENTS node or a
CopyFromReg node with virtual register (could also be a caller's
argument) are lowered indirectly.

 --This line, and those below, will be ignored--

M    X86/X86ISelLowering.cpp
M    X86/README.txt


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45867 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 16:49:42 +00:00
Arnold Schwaighofer
719eb02255 Correct a copy and paste error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45865 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 14:34:56 +00:00
Evan Cheng
588c6f8e6c Some C backend ByVal parameter attribute support. Not yet complete.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45864 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 09:12:49 +00:00
Evan Cheng
90e9d4e013 Rename Int_CVTSI642SSr* to Int_CVTSI2SS64r* for naming consistency and remove unused instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45861 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 07:37:44 +00:00
Chris Lattner
a731c9fac9 more flags set right
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45860 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 07:18:17 +00:00
Chris Lattner
f77e037309 add some missing flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45859 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 06:59:07 +00:00
Chris Lattner
497b7e97c0 add some notes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45854 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 06:17:47 +00:00
Evan Cheng
681d2b8266 A couple of obvious off-by-one bugs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45852 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 03:07:46 +00:00
Scott Michel
9de5d0dd42 More CellSPU refinement and progress:
- Cleaned up custom load/store logic, common code is now shared [see note
  below], cleaned up address modes

- More test cases: various intrinsics, structure element access (load/store
  test), updated target data strings, indirect function calls.

Note: This patch contains a refactoring of the LoadSDNode and StoreSDNode
structures: they now share a common base class, LSBaseSDNode, that
provides an interface to their common functionality. There is some hackery
to access the proper operand depending on the derived class; otherwise,
to do a proper job would require finding and rearranging the SDOperands
sent to StoreSDNode's constructor. The current refactor errs on the
side of being conservatively and backwardly compatible while providing
functionality that reduces redundant code for targets where loads and
stores are custom-lowered.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45851 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 02:53:15 +00:00
Dale Johannesen
12591d70f6 Weak zeroes don't go in bss on Darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45849 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 01:59:45 +00:00
Dale Johannesen
c7406ae773 Weak things initialized to 0 don't go in bss on Darwin.
Cosmetic changes to spacing to match gcc (some dejagnu
tests actually care).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45848 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 00:54:37 +00:00
Chris Lattner
a22edc82ca Simplify the side effect stuff a bit more and make licm/sinking
both work right according to the new flags.

This removes the TII::isReallySideEffectFree predicate, and adds
TII::isInvariantLoad. 

It removes NeverHasSideEffects+MayHaveSideEffects and adds
UnmodeledSideEffects as machine instr flags.  Now the clients
can decide everything they need.

I think isRematerializable can be implemented in terms of the
flags we have now, though I will let others tackle that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45843 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 23:08:24 +00:00
Chris Lattner
b38bec222c IMPLICIT_USE and IMPLICIT_DEF are dead, remove them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45838 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 19:27:54 +00:00
Chris Lattner
8372601521 add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45837 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 18:25:41 +00:00
Duncan Sands
007f9847c4 Output sinl for a long double FSIN node, not sin.
Likewise fix up a bunch of other libcalls.  While
there I remove NEG_F32 and NEG_F64 since they are
not used anywhere.  This fixes 9 Ada ACATS failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45833 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 10:28:30 +00:00
Chris Lattner
ba7e756c22 Start inferring side effect information more aggressively, and fix many bugs in the
x86 backend where instructions were not marked maystore/mayload, and perf issues where
instructions were not marked neverHasSideEffects.  It would be really nice if we could
write patterns for copy instructions.

I have audited all the x86 instructions down to MOVDQAmr.  The flags on others and on
other targets are probably not right in all cases, but no clients currently use this
info that are enabled by default.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45829 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 07:59:24 +00:00
Chris Lattner
36fe6d2f80 rename X86InstrX86-64.td -> X86Instr64bit.td
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45826 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 05:50:42 +00:00
Chris Lattner
b8f217fa7e add SDNPSideEffect node property declaration
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45825 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 05:48:23 +00:00
Chris Lattner
dd41527a7d remove explicit sets of 'neverHasSideEffects' that can now be
inferred from the instr patterns.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45824 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 05:45:39 +00:00
Chris Lattner
9b37aaf04c get def use info more correct.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45821 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 05:12:37 +00:00
Chris Lattner
8947dd539e add SDNPMayLoad to the 'load' sdnode definition. This is enough to get all the x86
instructions (with patterns) that load memory marked, for example.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45818 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 04:44:32 +00:00
Chris Lattner
8794390406 verify that the frame index is immutable before remat'ing (still disabled)
or being side-effect free.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45816 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 04:16:31 +00:00
Evan Cheng
e70bb59840 Mark byval parameter stack objects mutable for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45813 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 02:24:25 +00:00
Dale Johannesen
038129dd58 Emit unused EH frames for weak definitions on Darwin,
because assembler/linker can't cope with weak absolutes.
PR 1880.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45811 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 02:03:30 +00:00
Evan Cheng
27a446afaf Do not use the stack pointer directly, issue a copyfromreg instead. Otherwise we can end up with something like ADD32ri %esp, x which two-address pass won't like.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45798 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 00:37:26 +00:00
Chris Lattner
9c4428b217 Fix PR1845 and rdar://5676945. Generic vectors smaller
than hardware supported type will be scalarized, so we
can infer their alignment from that info.

We now codegen pr1845 into:

_boolVectorSelect:
	lbz r2, 0(r3)
	stb r2, -16(r1)
	blr 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45796 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 00:30:57 +00:00
Evan Cheng
dffbd837b8 Remove comments that do not correspond to anything after recent refactoring.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45792 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 00:09:10 +00:00