Commit Graph

8464 Commits

Author SHA1 Message Date
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