Commit Graph

36445 Commits

Author SHA1 Message Date
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
Evan Cheng
01b8fccca0 ByVal arguments are passed on stack. Make sure to allocate a slot using size and alignment information on the parameter attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45897 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-12 01:07:41 +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
Chris Lattner
aad193a7e9 implement support for sinking a load out the bottom of a block that
has no stores between the load and the end of block.  This works 
great and sinks hundreds of stores, but we can't turn it on because
machineinstrs don't have volatility information and we don't want to
sink volatile stores :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45894 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-12 00:17:41 +00:00
Chris Lattner
2769f6fc59 remove some incorrect classof's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45893 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 23:25:16 +00:00
Duncan Sands
bfc5ae6df0 When DAE drops the varargs part of a function, ensure any
attributes on the vararg call arguments are also dropped.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45892 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 23:13:45 +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
Chris Lattner
48e1dce486 llvm-g++ 4.0 has completely different code for this warning,
just xfail it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45890 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 23:06:56 +00:00
Chris Lattner
28123d77e0 new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45888 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 23:04:14 +00:00
Duncan Sands
623a389f62 Do not allow attributes beyond a function's last
parameter, even if it is a varargs function.  Do
allow attributes on the varargs part of a call,
but not beyond the last argument.  Only allow
selected attributes to be on the varargs part of
a call (currently only 'byval' is allowed).  The
reasoning here is that most attributes, eg inreg,
simply make no sense here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45887 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 22:36:48 +00:00
Chris Lattner
10603e0c84 Teach argpromote to ruthlessly hack small byval structs when it can
get away with it, which exposes opportunities to eliminate the memory
objects entirely.  For example, we now compile byval.ll to:

define internal void @f1(i32 %b.0, i64 %b.1) {
entry:
	%tmp2 = add i32 %b.0, 1		; <i32> [#uses=0]
	ret void
}

define i32 @main() nounwind  {
entry:
	call void @f1( i32 1, i64 2 )
	ret i32 0
}

This seems like it would trigger a lot for code that passes around small
structs (e.g. SDOperand's or _Complex)...



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45886 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 22:31:41 +00:00
Duncan Sands
8bc16f0e0e Two occurrences on one line count as one...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45885 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 21:46:24 +00:00
Duncan Sands
eb824709cb If there are attributes on the varargs part of a
call, don't discard them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45884 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 21:23:39 +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
Dale Johannesen
ef68e75618 Disable for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45881 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 20:47:33 +00:00
Chris Lattner
e027efa218 Use smallptrset instead of std::set for efficiency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45878 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 19:36:30 +00:00
Chris Lattner
170b1816b2 a byval argument is guaranteed to be valid to load.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45877 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 19:34:32 +00:00
Chris Lattner
40c14be5bc Update this code to use eraseFromParent where possible. Compute
whether an argument is byval and pass into isSafeToPromoteArgument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45876 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 19:20:39 +00:00
Chris Lattner
f1577014dd replace a loop with a constant time check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45875 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 18:55:10 +00:00
Chris Lattner
6e8410abf1 another minor datastructure tweak.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45874 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 18:47:45 +00:00
Chris Lattner
a10145fdf6 start using smallvector to avoid vector heap thrashing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45873 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 18:43:58 +00:00
Chris Lattner
8874628e30 add operator==/!= to smallvector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45872 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 18:42:02 +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
3dab223dc9 don't include loopinfo.h from this file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45858 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 06:30:04 +00:00
Chris Lattner
fadcd4e60b Move typedef of loop to top of the file where it is more obvious.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45857 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 06:29:42 +00:00
Chris Lattner
131bd2ecf7 Fix 80 col violations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45856 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 06:27:42 +00:00
Chris Lattner
47507ded8c document the byval parameter attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45855 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 06:20:47 +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
Chris Lattner
c93adca358 When inlining a functino with a byval argument, make an explicit
copy of it in case the callee modifies the struct.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45853 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 06:09:30 +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
Evan Cheng
c37ab63df7 Allow parameter attributes on varargs function parameters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45850 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 02:13:09 +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
2445888208 Clamp down on sinking of lots of instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45841 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 22:35:15 +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
Evan Cheng
8480293f41 Only remat loads from immutable stack slots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45831 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 08:24:38 +00:00