Commit Graph

2974 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
Chris Lattner
269f0595d6 add a testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45768 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-09 00:37:18 +00:00
Duncan Sands
e51775dc5e Use size_t to store Pos, avoid truncating value
on 64-bit builds.  Analysis and original patch
by Török Edwin.  Code audit found another place
with the same problem, also fixed here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45746 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-08 10:06:15 +00:00
Evan Cheng
b353459d68 Minor fix to enable x86-64 pic jit (still fails for other reasons).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45734 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-08 02:07:10 +00:00
Evan Cheng
b1a9aec515 Fix a x86-64 static codegen bug. This fixes a lot of x86-64 jit failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45733 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-08 02:06:11 +00:00
Bill Wendling
750ec00436 Silence warning about loss of precision.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45731 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-08 00:52:29 +00:00
Evan Cheng
9b44944d3d Unbreak x86-64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45725 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 23:08:23 +00:00
Chris Lattner
84a7c41251 add a note that is important for some fp apps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45723 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 21:59:58 +00:00
Duncan Sands
30d15751c8 Unbreak x86-32 darwin long double!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45703 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 16:36:38 +00:00
Duncan Sands
004a81dcc7 Fix long double support on x86-32 linux.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45701 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 13:44:22 +00:00
Bill Wendling
323cd29009 Operand 1 should be a register. We don't care if it's a preg, vreg, or 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45699 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 08:05:29 +00:00
Chris Lattner
749c6f6b5e rename TargetInstrDescriptor -> TargetInstrDesc.
Make MachineInstr::getDesc return a reference instead
of a pointer, since it can never be null.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45695 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 07:27:27 +00:00
Chris Lattner
8f707e15fb rename hasVariableOperands() -> isVariadic(). Add some comments.
Evan, please review the comments I added to getNumDefs to make sure
that they are accurate, thx.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45687 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 05:19:29 +00:00
Chris Lattner
349c495200 Move a bunch more accessors from TargetInstrInfo to TargetInstrDescriptor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45680 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 03:13:06 +00:00
Chris Lattner
cc8cd0cbf1 remove MachineOpCode typedef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45679 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 02:48:55 +00:00
Chris Lattner
8ca5c67c6e Add predicates methods to TargetOperandInfo, and switch all clients
over to using them, instead of diddling Flags directly.  Change the
various flags from const variables to enums.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45677 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 02:39:19 +00:00
Chris Lattner
69244300b8 Rename MachineInstr::getInstrDescriptor -> getDesc(), which reflects
that it is cheap and efficient to get.

Move a variety of predicates from TargetInstrInfo into 
TargetInstrDescriptor, which makes it much easier to query a predicate
when you don't have TII around.  Now you can use MI->getDesc()->isBranch()
instead of going through TII, and this is much more efficient anyway. Not
all of the predicates have been moved over yet.

Update old code that used MI->getInstrDescriptor()->Flags to use the
new predicates in many places.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45674 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 01:56:04 +00:00
Owen Anderson
43dbe05279 Move even more functionality from MRegisterInfo into TargetInstrInfo.
Some day I'll get it all moved over...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45672 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 01:35:02 +00:00
Chris Lattner
7e40ad5106 The pic base can't be duplicated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45668 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-06 23:49:32 +00:00
Chris Lattner
834f1ce031 rename isLoad -> isSimpleLoad due to evan's desire to have such a predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45667 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-06 23:38:27 +00:00
Bill Wendling
f995830daf Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45638 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-05 23:30:51 +00:00
Nate Begeman
219f67f0a5 Remove an incorrect optimization that is performed correctly by
the target independent legalizer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45631 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-05 20:51:30 +00:00
Gordon Henriksen
86737665b8 Refactoring the x86 and x86-64 calling convention implementations,
unifying the copied algorithms and saving over 500 LOC. There should
be no functionality change, but please test on your favorite x86
target.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45627 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-05 16:56:59 +00:00
Bill Wendling
df303bd7f2 Chris and Evan noticed that this check was compleatly fubared. I was
checking that there was a from a global instead of a load from the stub
for a global, which is the one that's safe to hoist.

Consider this program:

volatile char G[100];
int B(char *F, int N) {
  for (; N > 0; --N)
    F[N] = G[N];
}

In static mode, we shouldn't be hoisting the load from G:

$ llc -relocation-model=static -o - a.bc -march=x86 -machine-licm

LBB1_1: # bb.preheader
        leal    -1(%eax), %edx
        testl   %edx, %edx
        movl    $1, %edx
        cmovns  %eax, %edx
        xorl    %esi, %esi
LBB1_2: # bb
        movb    _G(%eax), %bl
        movb    %bl, (%ecx,%eax)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45626 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-05 09:18:04 +00:00