summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* simplifyAndrew Lenharth2006-09-201-12/+8
| | | | llvm-svn: 30535
* catch constants more oftenAndrew Lenharth2006-09-202-16/+14
| | | | llvm-svn: 30534
* clarify with test caseAndrew Lenharth2006-09-201-0/+13
| | | | llvm-svn: 30531
* Add NoteAndrew Lenharth2006-09-201-0/+3
| | | | llvm-svn: 30530
* item doneChris Lattner2006-09-201-6/+0
| | | | llvm-svn: 30518
* 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
* add a noteChris Lattner2006-09-201-0/+16
| | | | llvm-svn: 30515
* 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
* This is already doneChris Lattner2006-09-201-8/+0
| | | | llvm-svn: 30512
* We went through all that trouble to compute whether it was safe to transformChris Lattner2006-09-201-6/+46
| | | | | | | this comparison, but never checked it. Whoops, no wonder we miscompiled 177.mesa! llvm-svn: 30511
* Improve PPC64 equality comparisons like PPC32 comparisons.Chris Lattner2006-09-201-3/+31
| | | | llvm-svn: 30510
* Two improvements:Chris Lattner2006-09-202-22/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Codegen this comparison: if (X == 0x8000) as: cmplwi cr0, r3, 32768 bne cr0, LBB1_2 ;cond_next instead of: lis r2, 0 ori r2, r2, 32768 cmpw cr0, r3, r2 bne cr0, LBB1_2 ;cond_next 2. Codegen this comparison: if (X == 0x12345678) as: xoris r2, r3, 4660 cmplwi cr0, r2, 22136 bne cr0, LBB1_2 ;cond_next instead of: lis r2, 4660 ori r2, r2, 22136 cmpw cr0, r3, r2 bne cr0, LBB1_2 ;cond_next llvm-svn: 30509
* Add a note that we should match rlwnm betterChris Lattner2006-09-201-0/+34
| | | | llvm-svn: 30508
* Legalize is no longer limited to cleverness with just constant shift amounts.Chris Lattner2006-09-201-41/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow it to be clever when possible and fall back to the gross code when needed. This allows us to compile: long long foo1(long long X, int C) { return X << (C|32); } long long foo2(long long X, int C) { return X << (C&~32); } to: _foo1: rlwinm r2, r5, 0, 27, 31 slw r3, r4, r2 li r4, 0 blr .globl _foo2 .align 4 _foo2: rlwinm r2, r5, 0, 27, 25 subfic r5, r2, 32 slw r3, r3, r2 srw r5, r4, r5 or r3, r3, r5 slw r4, r4, r2 blr instead of: _foo1: ori r2, r5, 32 subfic r5, r2, 32 addi r6, r2, -32 srw r5, r4, r5 slw r3, r3, r2 slw r6, r4, r6 or r3, r3, r5 slw r4, r4, r2 or r3, r3, r6 blr .globl _foo2 .align 4 _foo2: rlwinm r2, r5, 0, 27, 25 subfic r5, r2, 32 addi r6, r2, -32 srw r5, r4, r5 slw r3, r3, r2 slw r6, r4, r6 or r3, r3, r5 slw r4, r4, r2 or r3, r3, r6 blr llvm-svn: 30507
* 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
* Back out Chris' last set of changes. This breaks 177.mesa and povray somehow.Evan Cheng2006-09-201-43/+6
| | | | llvm-svn: 30505
* 80 col.Evan Cheng2006-09-201-1/+2
| | | | llvm-svn: 30504
* If we have an add, do it in the pointer realm, not the int realm. This is ↵Andrew Lenharth2006-09-191-0/+22
| | | | | | critical in the linux kernel for pointer analysis correctness llvm-svn: 30496
* 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
* fix headerRafael Espindola2006-09-191-18/+21
| | | | | | | add comments untabify llvm-svn: 30486
* Implement a MachineFunctionPass to fix the mul instructionRafael Espindola2006-09-194-1/+74
| | | | llvm-svn: 30485
* item doneChris Lattner2006-09-191-11/+0
| | | | llvm-svn: 30483
* implement select.ll:test19-22Chris Lattner2006-09-191-6/+43
| | | | llvm-svn: 30482
* Fold the PPCISD shifts when presented with 0 inputs. This occurs for codeChris Lattner2006-09-191-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | like: long long test(long long X, int Y) { return 1ULL << Y; } long long test2(long long X, int Y) { return -1LL << Y; } which we used to compile to: _test: li r2, 1 subfic r3, r5, 32 li r4, 0 addi r6, r5, -32 srw r3, r2, r3 slw r4, r4, r5 slw r6, r2, r6 or r3, r4, r3 slw r4, r2, r5 or r3, r3, r6 blr _test2: li r2, -1 subfic r3, r5, 32 addi r6, r5, -32 srw r3, r2, r3 slw r4, r2, r5 slw r2, r2, r6 or r3, r4, r3 or r3, r3, r2 blr Now we produce: _test: li r2, 1 addi r3, r5, -32 subfic r4, r5, 32 slw r3, r2, r3 srw r4, r2, r4 or r3, r4, r3 slw r4, r2, r5 blr _test2: li r2, -1 subfic r3, r5, 32 addi r6, r5, -32 srw r3, r2, r3 slw r4, r2, r5 slw r2, r2, r6 or r3, r4, r3 or r3, r3, r2 blr llvm-svn: 30479
* 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
* Walk down the dominator tree instead of the control flow graph. That meansNick Lewycky2006-09-181-150/+90
| | | | | | | that we can't modify the CFG any more, at least not until it's possible to update the dominator tree (PR217). llvm-svn: 30469
* A pass to remove the worst of the replay trap offenders, and as a bonus, ↵Andrew Lenharth2006-09-183-0/+146
| | | | | | align basic blocks when it is free to do so llvm-svn: 30467
* Fix an infinite loop building the CFEChris Lattner2006-09-181-1/+2
| | | | llvm-svn: 30465
* Jump tables on AlphaAndrew Lenharth2006-09-183-2/+38
| | | | llvm-svn: 30463
* 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
* Implement a trivial optzn: of vastart is never called in a function that takesChris Lattner2006-09-181-2/+113
| | | | | | | | ... args, remove the '...'. This is Transforms/DeadArgElim/dead_vaargs.ll llvm-svn: 30459
* add a note. Our 64-bit shifts are ~30% slower than gcc'sChris Lattner2006-09-181-1/+2
| | | | llvm-svn: 30457
* Implement InstCombine/cast.ll:test31. This speeds up 462.libquantum by 26%.Chris Lattner2006-09-181-4/+39
| | | | llvm-svn: 30456
* add a helper methodChris Lattner2006-09-181-0/+16
| | | | llvm-svn: 30452
* This is closer to what we really want.Chris Lattner2006-09-181-2/+3
| | | | llvm-svn: 30451
* Implement Transforms/InstCombine/shift-sra.ll:test0Chris Lattner2006-09-181-0/+20
| | | | llvm-svn: 30450
* Rewrite shift/and/compare sequences to promote better licm of the RHS.Chris Lattner2006-09-181-28/+48
| | | | | | Use isLogicalShift/isArithmeticShift to simplify code. llvm-svn: 30448
* Added some eye-candy for Subtarget type checkingAnton Korobeynikov2006-09-1715-1615/+1727
| | | | | | Added X86 StdCall & FastCall calling conventions. Codegen will follow. llvm-svn: 30446
* Add ShiftInst::isLogical/ArithmeticShift methods.Chris Lattner2006-09-171-0/+11
| | | | llvm-svn: 30445
* Add new SetCondInst::isRelational/isEquality methods. RenameChris Lattner2006-09-173-5/+5
| | | | | | Instruction::isRelational to Instruction::isComparison. llvm-svn: 30444
* Explain change with a comment.Nick Lewycky2006-09-171-2/+2
| | | | llvm-svn: 30443
* Fix PR912. The input to erase() must not be a reference to the dataNick Lewycky2006-09-171-1/+2
| | | | | | being erased. llvm-svn: 30442
* Small fixes for supporting dll* linkage typesAnton Korobeynikov2006-09-175-112/+110
| | | | llvm-svn: 30441
* add a note noticed through source inspectionChris Lattner2006-09-161-3/+30
| | | | llvm-svn: 30418
OpenPOWER on IntegriCloud