Commit Graph

14985 Commits

Author SHA1 Message Date
Devang Patel 0142cd129e Untabify.
llvm-svn: 30168
2006-09-07 23:29:19 +00:00
Devang Patel b8164e6131 Use iterative do-while loop instead of recursive DFSPass calls to
reduce amount of stack space used at runtime.

llvm-svn: 30167
2006-09-07 23:22:37 +00:00
Chris Lattner 2785d55446 add a new value for the command line optn
llvm-svn: 30165
2006-09-07 22:32:28 +00:00
Chris Lattner b9e0a9e82f Fix a cross-build issue. The asmsyntax shouldn't be affected by the build
host, it should be affected by the target.  Allow the command line option to
override in either case.

llvm-svn: 30164
2006-09-07 22:29:41 +00:00
Jim Laskey 261779bb45 Make target asm info a property of the target machine.
llvm-svn: 30162
2006-09-07 22:06:40 +00:00
Jim Laskey 0e83541f8b Break out target asm info into separate files.
llvm-svn: 30161
2006-09-07 22:05:02 +00:00
Chris Lattner c465046e65 Throttle back tail duplication to avoid creating really ugly sequences of code.
For Transforms/TailDup/if-tail-dup.ll, f.e., it produces:

_foo:
        movl 8(%esp), %eax
        movl 4(%esp), %ecx
        testl $1, %ecx
        je LBB1_2       #cond_next
LBB1_1: #cond_true
        movl $1, (%eax)
LBB1_2: #cond_next
        testl $2, %ecx
        je LBB1_4       #cond_next10
LBB1_3: #cond_true6
        movl $1, 4(%eax)
LBB1_4: #cond_next10
        testl $4, %ecx
        je LBB1_6       #cond_next18
LBB1_5: #cond_true14
        movl $1, 8(%eax)
LBB1_6: #cond_next18
        testl $8, %ecx
        je LBB1_8       #return
LBB1_7: #cond_true22
        movl $1, 12(%eax)
        ret
LBB1_8: #return
        ret

instead of:

_foo:
        movl 4(%esp), %eax
        testl $2, %eax
        sete %cl
        movl 8(%esp), %edx
        testl $1, %eax
        je LBB1_2       #cond_next
LBB1_1: #cond_true
        movl $1, (%edx)
        testb %cl, %cl
        jne LBB1_4      #cond_next10
        jmp LBB1_3      #cond_true6
LBB1_2: #cond_next
        testb %cl, %cl
        jne LBB1_4      #cond_next10
LBB1_3: #cond_true6
        movl $1, 4(%edx)
        testl $4, %eax
        je LBB1_6       #cond_next18
        jmp LBB1_5      #cond_true14
LBB1_4: #cond_next10
        testl $4, %eax
        je LBB1_6       #cond_next18
LBB1_5: #cond_true14
        movl $1, 8(%edx)
        testl $8, %eax
        je LBB1_8       #return
        jmp LBB1_7      #cond_true22
LBB1_6: #cond_next18
        testl $8, %eax
        je LBB1_8       #return
LBB1_7: #cond_true22
        movl $1, 12(%edx)
        ret
LBB1_8: #return
        ret

llvm-svn: 30158
2006-09-07 21:30:15 +00:00
Chris Lattner dc4ff5311f Eliminate X86ISD::TEST, using X86ISD::CMP instead. Match X86ISD::CMP patterns
using test, which provides nice simplifications like:

-       movl %edi, %ecx
-       andl $2, %ecx
-       cmpl $0, %ecx
+       testl $2, %edi
        je LBB1_11      #cond_next90

There are a couple of dagiselemitter deficiencies that this exposes, they will
be handled later.

llvm-svn: 30156
2006-09-07 20:33:45 +00:00
Chris Lattner 1b7f09cdf7 Some notes on better load folding we could do
llvm-svn: 30155
2006-09-07 20:32:01 +00:00
Evan Cheng a9411c0977 Consistency.
llvm-svn: 30152
2006-09-07 19:03:48 +00:00
Evan Cheng 95b3dde8bb Fix pasto that was breaking x86 tests.
llvm-svn: 30151
2006-09-07 18:50:20 +00:00
Chris Lattner 721fc38342 Add new option to leave asm names alone
llvm-svn: 30149
2006-09-07 18:20:41 +00:00
Jim Laskey c7abe471fe Make the x86 asm flavor part of the subtarget info.
llvm-svn: 30146
2006-09-07 12:23:47 +00:00
Chris Lattner 707339a57b Fix CodeGen/Generic/2006-09-06-SwitchLowering.ll, a bug where SDIsel inserted
too many phi operands when lowering a switch to branches in some cases.

llvm-svn: 30142
2006-09-07 01:59:34 +00:00
Evan Cheng 7f3f0973e6 Clean up.
llvm-svn: 30140
2006-09-07 01:17:57 +00:00
Evan Cheng 4c7a3fbdea Watch out for variable_ops instructions.
llvm-svn: 30135
2006-09-06 20:32:45 +00:00
Evan Cheng ac22e54131 Variable ops instructions may ignore the last few operands for code emission.
llvm-svn: 30134
2006-09-06 20:24:14 +00:00
Jim Laskey ef94ebb666 Oops - forgot to update banner.
llvm-svn: 30131
2006-09-06 19:21:41 +00:00
Jim Laskey 681ecbb3b3 Separate target specifc asm properties from asm printers.
llvm-svn: 30127
2006-09-06 18:35:33 +00:00
Jim Laskey a6211dcdad Separate target specific asm properties from the asm printers.
llvm-svn: 30126
2006-09-06 18:34:40 +00:00
Rafael Espindola abd8bcbe5e add the orr instruction
llvm-svn: 30125
2006-09-06 18:03:12 +00:00
Evan Cheng ddfb10b5af Only call isUse/isDef on register operands
llvm-svn: 30122
2006-09-05 20:32:06 +00:00
Chris Lattner 2656932979 Bugfix to work with the two-addr changes that have been made in the tree recently
llvm-svn: 30121
2006-09-05 20:27:32 +00:00
Chris Lattner 2cb238320d Only call isUse/isDef on register operands
llvm-svn: 30118
2006-09-05 20:19:27 +00:00
Chris Lattner 45456d44e3 Don't call isDef on non-registers
llvm-svn: 30117
2006-09-05 20:02:51 +00:00
Chris Lattner 845b223da4 Fix Duraid's changes to work when TLI is null. This fixes the failing
lowerinvoke regtests.

llvm-svn: 30115
2006-09-05 17:48:07 +00:00
Chris Lattner 0dce3311c4 Change the default to 0, which means 'default'.
llvm-svn: 30114
2006-09-05 17:39:15 +00:00
Evan Cheng 7a150d3113 Fix a few dejagnu failures. e.g. fast-cc-merge-stack-adj.ll
llvm-svn: 30113
2006-09-05 08:32:49 +00:00
Evan Cheng 17c28b2e0e JIT encoding bug.
llvm-svn: 30112
2006-09-05 05:59:25 +00:00
Chris Lattner e3d2e1e41e Update the X86 JIT to make it work with the new two-addr changes. This also
adds assertions that check to make sure every operand gets emitted.

llvm-svn: 30110
2006-09-05 02:52:35 +00:00
Chris Lattner af23f9b5f6 Completely eliminate def&use operands. Now a register operand is EITHER a
def operand or a use operand.

llvm-svn: 30109
2006-09-05 02:31:13 +00:00
Chris Lattner 13a5dcddce Fix a long-standing wart in the code generator: two-address instruction lowering
actually *removes* one of the operands, instead of just assigning both operands
the same register.  This make reasoning about instructions unnecessarily complex,
because you need to know if you are before or after register allocation to match
up operand #'s with the target description file.

Changing this also gets rid of a bunch of hacky code in various places.

This patch also includes changes to fold loads into cmp/test instructions in
the X86 backend, along with a significant simplification to the X86 spill
folding code.

llvm-svn: 30108
2006-09-05 02:12:02 +00:00
Andrew Lenharth 3852b2ce7e jmp_bufs are this big on alpha.
llvm-svn: 30107
2006-09-05 00:22:25 +00:00
Rafael Espindola 8386105f3f add support for returning 64bit values
llvm-svn: 30103
2006-09-04 19:05:01 +00:00
Chris Lattner 49c45d3a13 Fix some X86 JIT failures. This should really come from TargetJITInfo.
llvm-svn: 30102
2006-09-04 18:48:41 +00:00
Chris Lattner 1eed04d1fb Correct fix for a crasher on functions with live in values
llvm-svn: 30099
2006-09-04 18:27:40 +00:00
Chris Lattner bff0b5969f Hack around a regression I introduced yesterday
llvm-svn: 30098
2006-09-04 18:20:15 +00:00
Duraid Madina 373be1d1a2 forgot this
llvm-svn: 30097
2006-09-04 07:44:11 +00:00
Duraid Madina cf6749e4c0 add setJumpBufSize() and setJumpBufAlignment() to target-lowering.
Call these from your backend to enjoy setjmp/longjmp goodness, see
lib/Target/IA64/IA64ISelLowering.cpp for an example

llvm-svn: 30095
2006-09-04 06:21:35 +00:00
Chris Lattner a916db12e4 new file
llvm-svn: 30082
2006-09-04 04:16:09 +00:00
Chris Lattner 12e97307a1 Completely rearchitect the interface between targets and the pass manager.
This pass:

1. Splits TargetMachine into TargetMachine (generic targets, can be implemented
any way, like the CBE) and LLVMTargetMachine (subclass of TM that is used by
things using libcodegen and other support).
2. Instead of having each target fully populate the passmgr for file or JIT
   output, move all this to common code, and give targets hooks they can
   implement.
3. Commonalize the target population stuff between file emission and JIT
   emission.
4. All (native code) codegen stuff now happens in a FunctionPassManager, which
   paves the way for "fast -O0" stuff in the CFE later, and now LLC could
   lazily stream .bc files from disk to use less memory.
5. There are now many fewer #includes and the targets don't depend on the
   scalar xforms or libanalysis anymore (but codegen does).
6. Changing common code generator pass ordering stuff no longer requires
   touching all targets.
7. The JIT now has the option of "-fast" codegen or normal optimized codegen,
   which is now orthogonal to the fact that JIT'ing is being done.

llvm-svn: 30081
2006-09-04 04:14:57 +00:00
Chris Lattner e8ce162969 Add accessor
llvm-svn: 30080
2006-09-04 04:08:58 +00:00
Chris Lattner 2f77922d30 Add explicit doInitialization/doFinalization methods instead of making
the FunctionPassManager redo this for each function.

llvm-svn: 30079
2006-09-04 04:07:39 +00:00
Chris Lattner 2f93c0fd33 remove #include
llvm-svn: 30078
2006-09-04 04:06:01 +00:00
Chris Lattner 0fc4541c67 Simplify target construction.
llvm-svn: 30070
2006-09-03 18:44:02 +00:00
Chris Lattner ad36544457 eliminate use of TM.getName()
llvm-svn: 30068
2006-09-03 18:37:12 +00:00
Rafael Espindola 5328ba96e1 add the SETULT condition code
llvm-svn: 30067
2006-09-03 13:19:16 +00:00
Chris Lattner 8584e940b8 Avoid beating on the mi2i map when we know the answer already.
llvm-svn: 30066
2006-09-03 08:07:11 +00:00
Chris Lattner 774785a79d minor speedup
llvm-svn: 30065
2006-09-03 07:53:50 +00:00
Chris Lattner 7cc20d418b Fix Regression/CodeGen/Generic/2006-09-02-LocalAllocCrash.ll on X86.
Just because an alias of a register is available, it doesn't mean that we
can arbitrarily evict the register.

llvm-svn: 30064
2006-09-03 07:15:37 +00:00