Commit Graph

15152 Commits

Author SHA1 Message Date
Anton Korobeynikov d61d39ec53 Adding dllimport, dllexport and external weak linkage types.
DLL* linkages got full (I hope) codegeneration support in C & both x86
assembler backends.
External weak linkage added for future use, we don't provide any
codegeneration, etc. support for it.

llvm-svn: 30374
2006-09-14 18:23:27 +00:00
Evan Cheng 616aa548b2 Use getOffset() instead.
llvm-svn: 30327
2006-09-14 07:41:12 +00:00
Evan Cheng 2ad050fb3e Use MachineConstantPoolEntry getOffset() and getType() accessors.
llvm-svn: 30326
2006-09-14 07:35:00 +00:00
Chris Lattner a4f1e8f6b8 Use new config.h macro
llvm-svn: 30321
2006-09-14 06:21:59 +00:00
Chris Lattner 2f107cfc0d On Mac OS/X, make Process::PreventCoreFiles disable crash reporter for
the process in addition to disabling core file emission.  This speeds up
bugpoint on default-configured macs by several orders of magnitude.

llvm-svn: 30317
2006-09-14 06:01:41 +00:00
Evan Cheng 4f9299552b A MachineConstantPool may have mixed Constant* and MachineConstantPoolValue* values.
llvm-svn: 30316
2006-09-14 05:50:57 +00:00
Devang Patel 23d855b40d Avoid recursion in assignDFSNumber(). Move def from ET-Forest.h
to Dominators.h

llvm-svn: 30309
2006-09-14 01:27:42 +00:00
Chris Lattner 1463377ddb add note about switch lowering
llvm-svn: 30308
2006-09-13 23:37:16 +00:00
Chris Lattner 237ccf2a51 Second half of the fix for Transforms/Inline/inline_cleanup.ll
This folds unconditional branches that are often produced by code
specialization.

llvm-svn: 30307
2006-09-13 21:27:00 +00:00
Nick Lewycky 12efffc96b Add some more consistency checks.
llvm-svn: 30305
2006-09-13 19:32:53 +00:00
Nick Lewycky 51ce8d6b46 Fix unionSets so that it can merge correctly.
llvm-svn: 30304
2006-09-13 19:24:01 +00:00
Chris Lattner 6ef6d06d21 Implement the first half of Transforms/Inline/inline_cleanup.ll
llvm-svn: 30303
2006-09-13 19:23:57 +00:00
Evan Cheng 92e5113d48 Skip over first operand when determining REX prefix for two-address code.
llvm-svn: 30300
2006-09-13 19:07:28 +00:00
Nick Lewycky 3a4dc7b489 Erase dead instructions.
llvm-svn: 30298
2006-09-13 18:55:37 +00:00
Chris Lattner 971e33930d Turn X < 0 -> TEST X,X js
llvm-svn: 30294
2006-09-13 17:04:54 +00:00
Chris Lattner 0c9ae46c5f The sense of this branch was inverted :(
llvm-svn: 30293
2006-09-13 16:56:12 +00:00
Chris Lattner cd34779ef6 Fix a ton of jit failures
llvm-svn: 30292
2006-09-13 16:21:10 +00:00
Rafael Espindola 3130a756ef add shifts to addressing mode 1
llvm-svn: 30291
2006-09-13 12:09:43 +00:00
Chris Lattner 84cc1f7cb8 If LSR went through a lot of trouble to put constants (e.g. the addr of a global
in a specific BB, don't undo this!).  This allows us to compile
CodeGen/X86/loop-hoist.ll into:

_foo:
        xorl %eax, %eax
***     movl L_Arr$non_lazy_ptr, %ecx
        movl 4(%esp), %edx
LBB1_1: #cond_true
        movl %eax, (%ecx,%eax,4)
        incl %eax
        cmpl %edx, %eax
        jne LBB1_1      #cond_true
LBB1_2: #return
        ret

instead of:

_foo:
        xorl %eax, %eax
        movl 4(%esp), %ecx
LBB1_1: #cond_true
***     movl L_Arr$non_lazy_ptr, %edx
        movl %eax, (%edx,%eax,4)
        incl %eax
        cmpl %ecx, %eax
        jne LBB1_1      #cond_true
LBB1_2: #return
        ret

This was noticed in 464.h264ref.  This doesn't usually affect PPC,
but strikes X86 all the time.

llvm-svn: 30290
2006-09-13 06:02:42 +00:00
Chris Lattner 706dd3e0d4 Fix a regression in the 32-bit port from the 64-bit port landing.
We now compile CodeGen/X86/lea-2.ll into:

_test:
        movl 4(%esp), %eax
        movl 8(%esp), %ecx
        leal -5(%ecx,%eax,4), %eax
        ret

instead of:

_test:
        movl 4(%esp), %eax
        leal (,%eax,4), %eax
        addl 8(%esp), %eax
        addl $4294967291, %eax
        ret

llvm-svn: 30288
2006-09-13 04:45:25 +00:00
Chris Lattner e413fea6ac new note
llvm-svn: 30286
2006-09-13 04:19:50 +00:00
Chris Lattner 3496710f25 new note
llvm-svn: 30285
2006-09-13 03:54:54 +00:00
Chris Lattner 72b503bcad Compile X << 1 (where X is a long-long) to:
addl %ecx, %ecx
        adcl %eax, %eax

instead of:

        movl %ecx, %edx
        addl %edx, %edx
        shrl $31, %ecx
        addl %eax, %eax
        orl %ecx, %eax

and to:

        addc r5, r5, r5
        adde r4, r4, r4

instead of:

        slwi r2,r9,1
        srwi r0,r11,31
        slwi r3,r11,1
        or r2,r0,r2

on PPC.

llvm-svn: 30284
2006-09-13 03:50:39 +00:00
Chris Lattner 7a627676be Compile X > -1 -> text X,X; js dest
This implements CodeGen/X86/jump_sign.ll.

llvm-svn: 30283
2006-09-13 03:22:10 +00:00
Devang Patel fab4972a6e Initialize DontInternalize.
llvm-svn: 30281
2006-09-13 01:02:26 +00:00
Evan Cheng 9a083a4121 Reflects MachineConstantPoolEntry changes.
llvm-svn: 30279
2006-09-12 21:04:05 +00:00
Evan Cheng 45fe3bc72c Added support for machine specific constantpool values. These are useful for
representing expressions that can only be resolved at link time, etc.

llvm-svn: 30278
2006-09-12 21:00:35 +00:00
Evan Cheng 3228e750be Reflect MachineConstantPoolEntry changes.
llvm-svn: 30277
2006-09-12 20:59:59 +00:00
Chris Lattner 1d7ec20a4d An sinkable instruction may exist with uses, if those uses are in dead blocks.
Handle this.  This fixes PR908 and Transforms/LICM/2006-09-12-DeadUserOfSunkInstr.ll

llvm-svn: 30275
2006-09-12 19:17:09 +00:00
Chris Lattner cfb2c32724 add a note
llvm-svn: 30271
2006-09-12 06:36:01 +00:00
Chris Lattner 8b4de218d9 Testcase noticed from PR906
llvm-svn: 30269
2006-09-11 23:00:56 +00:00
Chris Lattner 6e7286f72a add compilable testcase
llvm-svn: 30268
2006-09-11 22:57:51 +00:00
Chris Lattner d28627009a Fix PR905 and InstCombine/2006-09-11-EmptyStructCrash.ll
llvm-svn: 30266
2006-09-11 21:43:16 +00:00
Rafael Espindola c7829d62c0 implement SRL and MUL
llvm-svn: 30262
2006-09-11 19:24:19 +00:00
Rafael Espindola bccf9c2f1b add the correct fallback for ARMDAGToDAGISel::SelectAddrMode1
llvm-svn: 30261
2006-09-11 19:23:32 +00:00
Rafael Espindola e45a79a9e2 partial implementation of the ARM Addressing Mode 1
llvm-svn: 30252
2006-09-11 17:25:40 +00:00
Nick Lewycky e94f42a740 Skip the linear search if the answer is already known.
llvm-svn: 30251
2006-09-11 17:23:34 +00:00
Rafael Espindola ecb0d686f8 call AsmPrinter::doInitialization in ARMAsmPrinter::doInitialization
llvm-svn: 30246
2006-09-11 12:49:38 +00:00
Evan Cheng 21a75acc3e Updates.
llvm-svn: 30245
2006-09-11 05:35:17 +00:00
Evan Cheng 9e77d9a96b Update README file.
llvm-svn: 30244
2006-09-11 05:25:15 +00:00
Evan Cheng 4259a0f654 X86ISD::CMP now produces a chain as well as a flag. Make that the chain
operand of a conditional branch to allow load folding into CMP / TEST
instructions.

llvm-svn: 30241
2006-09-11 02:19:56 +00:00
Nate Begeman a0d95a8da9 Behold, more work on relocations. Things are looking pretty good now.
llvm-svn: 30240
2006-09-10 23:03:44 +00:00
Anton Korobeynikov fbee8bfe48 Removed unnecessary Mangler creation.
llvm-svn: 30239
2006-09-10 21:17:03 +00:00
Chris Lattner d1f8e07808 Allow tail duplication in more cases, relaxing the previous restriction a
bit.  This fixes Regression/Transforms/TailDup/MergeTest.ll

llvm-svn: 30237
2006-09-10 18:17:58 +00:00
Chris Lattner 2e0dfb0b16 This code was trying too hard. By eliminating redundant edges in the CFG
due to switch cases going to the same place, it make #pred != #phi entries,
breaking live interval analysis.

This fixes 458.sjeng on x86 with llc.

llvm-svn: 30236
2006-09-10 06:36:57 +00:00
Nick Lewycky 9a22d7b60f Replace EquivalenceClasses with a custom-built data structure. Many common
operations (like findProperties) should be faster, at the expense of
unionSets being slower in cases that are rare in practise.

Don't erase a dead Instruction. This fixes a memory corruption issue.

llvm-svn: 30235
2006-09-10 02:27:07 +00:00
Chris Lattner 0468987592 Implement Transforms/InstCombine/hoist_instr.ll
llvm-svn: 30234
2006-09-09 22:02:56 +00:00
Chris Lattner 27ff96d87a Make inlining costs more accurate.
llvm-svn: 30231
2006-09-09 20:40:44 +00:00
Chris Lattner d79dc79831 Turn div X, (Cond ? Y : 0) -> div X, Y
This implements select.ll::test18.

llvm-svn: 30230
2006-09-09 20:26:32 +00:00
Chris Lattner fdb3a75942 Add cbe support for powi
llvm-svn: 30226
2006-09-09 06:17:12 +00:00
Chris Lattner f0359b343a Implement the fpowi now by lowering to a libcall
llvm-svn: 30225
2006-09-09 06:03:30 +00:00
Chris Lattner e4bbb6c341 Allow targets to custom lower expanded BIT_CONVERT's
llvm-svn: 30217
2006-09-09 00:20:27 +00:00
Nate Begeman 69df6132d7 First pass at supporting relocations. Relocations are written correctly to
the file now, however the relocated address is currently wrong.  Fixing
that will require some deep pondering.

llvm-svn: 30207
2006-09-08 22:42:09 +00:00
Evan Cheng de33f66286 Fixed a FuseTwoAddrInst() bug: consider GlobalAddress and JumpTableIndex
in addition to immediate operands.

llvm-svn: 30205
2006-09-08 21:08:13 +00:00
Chris Lattner b2e7316b2d Non-allocatable physregs can be killed and dead, but don't treat them as
safe for later allocation.  This fixes McCat/18-imp with llc-beta.

llvm-svn: 30204
2006-09-08 20:21:31 +00:00
Chris Lattner 050c64c51d This fixes Benchmarks/Prolangs-C/unix-smail
llvm-svn: 30198
2006-09-08 19:11:11 +00:00
Chris Lattner 9b1a6ebf20 Fix a bunch of llc-beta failures on x86 yesterday. Don't allow selection
of unallocatable registers, just because an alias is allocatable.  We were
picking registers like SIL just because ESI was being used.

llvm-svn: 30197
2006-09-08 19:03:30 +00:00
Rafael Espindola d11fb5d13b implement shl and sra
llvm-svn: 30191
2006-09-08 17:36:23 +00:00
Chris Lattner 6c003a7c2d Use __USER_LABEL_PREFIX__ to get the prefix added by the current host.
llvm-svn: 30190
2006-09-08 17:03:56 +00:00
Rafael Espindola 4443c7d60a add the eor (xor) instruction
llvm-svn: 30189
2006-09-08 16:59:47 +00:00
Jim Laskey 177405376c Missing tab
llvm-svn: 30188
2006-09-08 13:06:56 +00:00
Rafael Espindola 778769aafb implement unconditional branches
fix select.ll

llvm-svn: 30186
2006-09-08 12:47:03 +00:00
Evan Cheng 7348403d42 Remove TEST64mr. It's same as TEST64rm since and is commutative.
llvm-svn: 30178
2006-09-08 06:56:55 +00:00
Evan Cheng 11b0a5dbd4 Committing X86-64 support.
llvm-svn: 30177
2006-09-08 06:48:29 +00:00
Nate Begeman c9db83306f We actually do support object file writing, so don't return true (error)
llvm-svn: 30173
2006-09-08 03:42:15 +00:00
Evan Cheng 89c5d04b9b - Identify a vector_shuffle that can be turned into an undef, e.g.
shuffle V1, <undef>, <undef, undef, 4, 5>
- Fix some suspicious logic into LowerVectorShuffle that cause less than
  optimal code by failing to identify MOVL (move to lowest element of a
  vector).

llvm-svn: 30171
2006-09-08 01:50:06 +00:00
Jim Laskey ae92ce8798 1. Remove condition on delete.
2. Protect and outline createTargetAsmInfo.

3. Misc. kruft.

llvm-svn: 30169
2006-09-07 23:39:26 +00:00
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
Chris Lattner bd79458b0e When deleting a machine instruction, make sure to remove it from the
livevariables information.  This fixes several regalloc=local failures on x86

llvm-svn: 30062
2006-09-03 00:06:08 +00:00
Chris Lattner f8f724a2b1 Move two methods out of line, make them work when the record for a machine
instruction includes physregs.

llvm-svn: 30061
2006-09-03 00:05:09 +00:00
Chris Lattner 5e02f4e141 Count the time for a pass to ReleaseMemory against that pass. Not doing this
was under accounting for the time that livevariables cost

llvm-svn: 30060
2006-09-02 23:09:24 +00:00
Owen Anderson 19b80e76df Make ArgumentPromotion handle recursive functions that pass pointers in their recursive calls.
llvm-svn: 30057
2006-09-02 21:19:44 +00:00
Rafael Espindola c585b6919b add more condition codes
llvm-svn: 30056
2006-09-02 20:24:25 +00:00
Nick Lewycky 8e5599354a Improve handling of SelectInst.
Reorder operations to remove duplicated work.
Fix to leave floating-point types out of the optimization.
Add tests to predsimplify.ll for SwitchInst and SelectInst handling.

llvm-svn: 30055
2006-09-02 19:40:38 +00:00
Chris Lattner f2ce949ae9 improve compat with certain versions of GCC (on cygwin?)
llvm-svn: 30054
2006-09-02 17:37:30 +00:00
Chris Lattner 75742e532a Iteration is required for some cases, even if they don't occur in crafty.
Restore it, which re-fixes X86/2006-08-21-ExtraMovInst.ll

llvm-svn: 30050
2006-09-02 05:32:53 +00:00
Chris Lattner 5a56d30906 When joining two intervals where the RHS is really simple, use a light-weight
method for joining the live ranges instead of the fully-general one.

llvm-svn: 30049
2006-09-02 05:26:59 +00:00
Evan Cheng 2c4e0f120f Oops. Bad typo. Without the check of N1.hasOneUse() bad things can happen.
Suppose the TokenFactor can reach the Op:

       [Load chain]
           ^
           |
         [Load]
         ^    ^
         |    |
        /      \-
       /         |
      /          [Op]
     /          ^ ^
     |        ..  |
     |       /    |
   [TokenFactor]  |
       ^          |
       |          |
        \        /
         \      /
         [Store]

If we move the Load below the TokenFactor, we would have created a cycle in
the DAG.

llvm-svn: 30040
2006-09-01 22:52:28 +00:00
Chris Lattner bad9d2ee49 Use a couple of multiclass patterns to factor some integer ops.
llvm-svn: 30039
2006-09-01 22:28:02 +00:00
Chris Lattner 38e6d1d5af remove a bunch of comments
llvm-svn: 30038
2006-09-01 22:16:22 +00:00
Anton Korobeynikov 6c6a70f999 - Fixed broken Win32 build
- Removed warning about clobbered parameter in Bytecode/Reader

llvm-svn: 30026
2006-09-01 20:35:17 +00:00
Evan Cheng 88c268b621 Remove extra spaces.
llvm-svn: 30025
2006-09-01 18:45:22 +00:00
Evan Cheng 31c99969a9 Last check-in was a mistake...
I've been told apple gcc version number is not guaranteed to increase
monotonically. Change the preprocess condition to make it less risky.

The configuration change is done during the middle 10.4 life cycle so we have
to check __APPLE_CC. For future OS X release, we should be able to assume
-fenable-cxa-atexit is the default.

llvm-svn: 30024
2006-09-01 18:42:59 +00:00
Evan Cheng d176cdf76d *** empty log message ***
llvm-svn: 30023
2006-09-01 18:40:46 +00:00
Evan Cheng e93762d36e Allow legalizer to expand ISD::MUL using only MULHS in the rare case that is
possible and the target only supports MULHS.

llvm-svn: 30022
2006-09-01 18:17:58 +00:00
Jim Laskey 5352d0cc4d Corrections.
llvm-svn: 30021
2006-09-01 12:55:05 +00:00
Evan Cheng 4b8b6ae924 Better comments.
llvm-svn: 30017
2006-09-01 07:09:56 +00:00
Evan Cheng c5fddc566c Yikes. This requires checking apple gcc version.
llvm-svn: 30016
2006-09-01 07:00:46 +00:00
Chris Lattner 93c067dc2d Pull some code out of a hot recursive function because the common case doesn't
need recursion.

llvm-svn: 30015
2006-09-01 07:00:23 +00:00
Chris Lattner 3eac2c87aa Reserve space in the ValueNumberInfo vector. This speeds up live interval
analysis 16% on crafty.

Wrap long lines.

llvm-svn: 30012
2006-09-01 06:10:18 +00:00
Chris Lattner f765351978 Iterative coallescing doesn't buy us anything (we get identical results on
crafty with and without it).  Removing it speeds up live intervals 6%.

llvm-svn: 30010
2006-09-01 04:02:42 +00:00
Nick Lewycky f6f529d008 Don't confuse canonicalize and lookup. Fixes predsimplify.reg4.ll. Also
corrects missing optimization opportunity removing cases from a switch.

llvm-svn: 30009
2006-09-01 03:26:35 +00:00
Evan Cheng 31305c45da DAG combiner fix for rotates. Previously the outer-most condition checks
for ROTL availability. This prevents it from forming ROTR for targets that
has ROTR only.

llvm-svn: 29997
2006-08-31 07:41:12 +00:00
Chris Lattner a700a19d04 Add a special case that speeds up coallescing a bit, but not enough.
llvm-svn: 29996
2006-08-31 06:48:26 +00:00
Chris Lattner 78cca7243c Delete copies as they are coallesced instead of waiting until the end.
llvm-svn: 29995
2006-08-31 05:58:59 +00:00
Chris Lattner aa36808fd3 avoid calling the virtual isMoveInstr method endlessly by caching its results.
llvm-svn: 29994
2006-08-31 05:54:43 +00:00
Nick Lewycky 08674ab707 Properties where both Values weren't in the union (as being equal to
another Value) weren't being found by findProperties.

This fixes predsimplify.ll test6, a missed optimization opportunity.

llvm-svn: 29991
2006-08-31 00:39:16 +00:00
Chris Lattner cb74860cce Fix a compiler crash bootstrapping llvm-gcc.
llvm-svn: 29989
2006-08-30 23:02:29 +00:00
Chris Lattner 9543866c27 Guess what happens when asserts are disabled. :(
Also, the assert could never fire due to || instead of &&.

llvm-svn: 29977
2006-08-30 20:37:06 +00:00
Chris Lattner f5bed76353 Instantiate Statistic<> in one place, not in every .o file that uses it.
llvm-svn: 29971
2006-08-30 04:17:00 +00:00
Nick Lewycky 5f8f9af65c Move to using the EquivalenceClass ADT. Removes SynSets.
If a branch's condition has become a ConstantBool, simplify it immediately.
Removing the edge saves work and exposes up more optimization opportunities
in the pass.
Add support for SelectInst.

llvm-svn: 29970
2006-08-30 02:46:48 +00:00