summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Wrong size for loadJim Laskey2006-09-261-2/+8
| | | | llvm-svn: 30610
* Can't move a load node if it's chain is not used.Jim Laskey2006-09-261-1/+22
| | | | llvm-svn: 30609
* print the preds of each MBBChris Lattner2006-09-261-0/+8
| | | | llvm-svn: 30606
* Add support for targets that want to do something with the llvm.used list,Chris Lattner2006-09-261-2/+21
| | | | | | because they have an aggressive linker that does dead code stripping. llvm-svn: 30604
* Accidental enable of bad codeJim Laskey2006-09-251-1/+1
| | | | llvm-svn: 30601
* Fix chain dropping in load and drop unused stores in ret blocks.Jim Laskey2006-09-251-7/+14
| | | | llvm-svn: 30600
* Core antialiasing for load and store.Jim Laskey2006-09-251-53/+282
| | | | llvm-svn: 30597
* Add support for other relocation bases to jump tables, as well as custom asm ↵Andrew Lenharth2006-09-243-4/+21
| | | | | | directives llvm-svn: 30593
* PIC jump table entries are always 32-bit. This fixes PIC jump table support ↵Evan Cheng2006-09-241-5/+4
| | | | | | on X86-64. llvm-svn: 30590
* Make it work for DAG combine of multi-value nodes.Evan Cheng2006-09-211-2/+7
| | | | llvm-svn: 30573
* core correctionsJim Laskey2006-09-211-10/+4
| | | | llvm-svn: 30570
* Basic "in frame" alias analysis.Jim Laskey2006-09-211-2/+50
| | | | llvm-svn: 30568
* fold (aext (and (trunc x), cst)) -> (and x, cst).Chris Lattner2006-09-211-0/+15
| | | | llvm-svn: 30561
* Check the right value type. This fixes 186.crafty on x86Chris Lattner2006-09-211-1/+2
| | | | llvm-svn: 30560
* Compile:Chris Lattner2006-09-211-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | int %test(ulong *%tmp) { %tmp = load ulong* %tmp ; <ulong> [#uses=1] %tmp.mask = shr ulong %tmp, ubyte 50 ; <ulong> [#uses=1] %tmp.mask = cast ulong %tmp.mask to ubyte %tmp2 = and ubyte %tmp.mask, 3 ; <ubyte> [#uses=1] %tmp2 = cast ubyte %tmp2 to int ; <int> [#uses=1] ret int %tmp2 } to: _test: movl 4(%esp), %eax movl 4(%eax), %eax shrl $18, %eax andl $3, %eax ret instead of: _test: movl 4(%esp), %eax movl 4(%eax), %eax shrl $18, %eax # TRUNCATE movb %al, %al andb $3, %al movzbl %al, %eax ret llvm-svn: 30558
* Generalize (zext (truncate x)) and (sext (truncate x)) folding to work whenChris Lattner2006-09-211-9/+24
| | | | | | | the src/dst are not the same size. This catches things like "truncate 32-bit X to 8 bits, then zext to 16", which happens a bit on X86. llvm-svn: 30557
* Compile:Chris Lattner2006-09-201-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | int test3(int a, int b) { return (a < 0) ? a : 0; } to: _test3: srawi r2, r3, 31 and r3, r2, r3 blr instead of: _test3: cmpwi cr0, r3, 1 li r2, 0 blt cr0, LBB2_2 ;entry LBB2_1: ;entry mr r3, r2 LBB2_2: ;entry blr This implements: PowerPC/select_lt0.ll:seli32_a_a llvm-svn: 30517
* Fold the full generality of (any_extend (truncate x))Chris Lattner2006-09-201-3/+9
| | | | llvm-svn: 30514
* Two things:Chris Lattner2006-09-201-5/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. teach SimplifySetCC that '(srl (ctlz x), 5) == 0' is really x != 0. 2. Teach visitSELECT_CC to use SimplifySetCC instead of calling it and ignoring the result. This allows us to compile: bool %test(ulong %x) { %tmp = setlt ulong %x, 4294967296 ret bool %tmp } to: _test: cntlzw r2, r3 cmplwi cr0, r3, 1 srwi r2, r2, 5 li r3, 0 beq cr0, LBB1_2 ; LBB1_1: ; mr r3, r2 LBB1_2: ; blr instead of: _test: addi r2, r3, -1 cntlzw r2, r2 cntlzw r3, r3 srwi r2, r2, 5 cmplwi cr0, r2, 0 srwi r2, r3, 5 li r3, 0 bne cr0, LBB1_2 ; LBB1_1: ; mr r3, r2 LBB1_2: ; blr This isn't wonderful, but it's an improvement. llvm-svn: 30513
* Expand 64-bit shifts more optimally if we know that the high bit of theChris Lattner2006-09-201-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | shift amount is one or zero. For example, for: long long foo1(long long X, int C) { return X << (C|32); } long long foo2(long long X, int C) { return X << (C&~32); } we get: _foo1: movb $31, %cl movl 4(%esp), %edx andb 12(%esp), %cl shll %cl, %edx xorl %eax, %eax ret _foo2: movb $223, %cl movl 4(%esp), %eax movl 8(%esp), %edx andb 12(%esp), %cl shldl %cl, %eax, %edx shll %cl, %eax ret instead of: _foo1: subl $4, %esp movl %ebx, (%esp) movb $32, %bl movl 8(%esp), %eax movl 12(%esp), %edx movb %bl, %cl orb 16(%esp), %cl shldl %cl, %eax, %edx shll %cl, %eax xorl %ecx, %ecx testb %bl, %bl cmovne %eax, %edx cmovne %ecx, %eax movl (%esp), %ebx addl $4, %esp ret _foo2: subl $4, %esp movl %ebx, (%esp) movb $223, %cl movl 8(%esp), %eax movl 12(%esp), %edx andb 16(%esp), %cl shldl %cl, %eax, %edx shll %cl, %eax xorl %ecx, %ecx xorb %bl, %bl testb %bl, %bl cmovne %eax, %edx cmovne %ecx, %eax movl (%esp), %ebx addl $4, %esp ret llvm-svn: 30506
* Fix UnitTests/2005-05-12-Int64ToFP.c with llc-beta. In particular, do notChris Lattner2006-09-191-7/+10
| | | | | | allow it to go into an infinite loop, filling up the disk! llvm-svn: 30494
* Fold extract_element(cst) to cstChris Lattner2006-09-191-2/+8
| | | | llvm-svn: 30478
* Minor speedup for legalize by avoiding some malloc trafficChris Lattner2006-09-191-0/+9
| | | | llvm-svn: 30477
* Fix a typo.Evan Cheng2006-09-181-3/+2
| | | | llvm-svn: 30474
* Allow i32 UDIV, SDIV, UREM, SREM to be expanded into libcalls.Evan Cheng2006-09-181-6/+30
| | | | llvm-svn: 30470
* oopsAndrew Lenharth2006-09-181-1/+0
| | | | llvm-svn: 30462
* absolute addresses must match pointer sizeAndrew Lenharth2006-09-182-1/+2
| | | | llvm-svn: 30461
* Sort out mangled names for globalsJim Laskey2006-09-181-13/+23
| | | | llvm-svn: 30460
* Oh yeah, this is needed tooChris Lattner2006-09-161-3/+3
| | | | llvm-svn: 30407
* simplify control flow, no functionality changeChris Lattner2006-09-161-6/+12
| | | | llvm-svn: 30403
* Allow custom expand of mulChris Lattner2006-09-161-0/+9
| | | | llvm-svn: 30402
* Keep track of the start of MBB's in a separate map from instructions. ThisChris Lattner2006-09-151-38/+45
| | | | | | is faster and is needed for future improvements. llvm-svn: 30383
* Fold (X & C1) | (Y & C2) -> (X|Y) & C3 when possible.Chris Lattner2006-09-141-0/+20
| | | | | | This implements CodeGen/X86/and-or-fold.ll llvm-svn: 30379
* Split rotate matching code out to its own function. Make it stronger, byChris Lattner2006-09-141-53/+142
| | | | | | matching things like ((x >> c1) & c2) | ((x << c3) & c4) to (rot x, c5) & c6 llvm-svn: 30376
* Use getOffset() instead.Evan Cheng2006-09-141-2/+2
| | | | llvm-svn: 30327
* Use MachineConstantPoolEntry getOffset() and getType() accessors.Evan Cheng2006-09-141-13/+7
| | | | llvm-svn: 30326
* A MachineConstantPool may have mixed Constant* and MachineConstantPoolValue* ↵Evan Cheng2006-09-141-2/+8
| | | | | | values. llvm-svn: 30316
* If LSR went through a lot of trouble to put constants (e.g. the addr of a globalChris Lattner2006-09-131-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Compile X << 1 (where X is a long-long) to:Chris Lattner2006-09-131-7/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Added support for machine specific constantpool values. These are useful forEvan Cheng2006-09-126-51/+152
| | | | | | representing expressions that can only be resolved at link time, etc. llvm-svn: 30278
* Behold, more work on relocations. Things are looking pretty good now.Nate Begeman2006-09-101-38/+106
| | | | llvm-svn: 30240
* This code was trying too hard. By eliminating redundant edges in the CFGChris Lattner2006-09-101-6/+3
| | | | | | | | | 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
* Implement the fpowi now by lowering to a libcallChris Lattner2006-09-093-1/+16
| | | | llvm-svn: 30225
* Allow targets to custom lower expanded BIT_CONVERT'sChris Lattner2006-09-091-2/+15
| | | | llvm-svn: 30217
* First pass at supporting relocations. Relocations are written correctly toNate Begeman2006-09-081-43/+75
| | | | | | | the file now, however the relocated address is currently wrong. Fixing that will require some deep pondering. llvm-svn: 30207
* Non-allocatable physregs can be killed and dead, but don't treat them asChris Lattner2006-09-081-0/+6
| | | | | | safe for later allocation. This fixes McCat/18-imp with llc-beta. llvm-svn: 30204
* This fixes Benchmarks/Prolangs-C/unix-smailChris Lattner2006-09-081-0/+2
| | | | llvm-svn: 30198
* Fix a bunch of llc-beta failures on x86 yesterday. Don't allow selectionChris Lattner2006-09-081-17/+42
| | | | | | | of unallocatable registers, just because an alias is allocatable. We were picking registers like SIL just because ESI was being used. llvm-svn: 30197
* Make target asm info a property of the target machine.Jim Laskey2006-09-072-18/+20
| | | | llvm-svn: 30162
* Fix pasto that was breaking x86 tests.Evan Cheng2006-09-071-2/+2
| | | | llvm-svn: 30151
OpenPOWER on IntegriCloud