aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86/select.ll
Commit message (Collapse)AuthorAgeFilesLines
* X86: Lower a select directly to a setcc_carry if possible.Benjamin Kramer2010-12-221-2/+19
| | | | | | | | | | | | | | | | | | | int test(unsigned long a, unsigned long b) { return -(a < b); } compiles to _test: ## @test cmpq %rsi, %rdi ## encoding: [0x48,0x39,0xf7] sbbl %eax, %eax ## encoding: [0x19,0xc0] ret ## encoding: [0xc3] instead of _test: ## @test xorl %ecx, %ecx ## encoding: [0x31,0xc9] cmpq %rsi, %rdi ## encoding: [0x48,0x39,0xf7] movl $-1, %eax ## encoding: [0xb8,0xff,0xff,0xff,0xff] cmovael %ecx, %eax ## encoding: [0x0f,0x43,0xc1] ret ## encoding: [0xc3] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122451 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach X86ISelLowering that the second result of X86ISD::UMUL is a flagsChris Lattner2010-12-051-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | result. This allows us to compile: void *test12(long count) { return new int[count]; } into: test12: movl $4, %ecx movq %rdi, %rax mulq %rcx movq $-1, %rdi cmovnoq %rax, %rdi jmp __Znam ## TAILCALL instead of: test12: movl $4, %ecx movq %rdi, %rax mulq %rcx seto %cl testb %cl, %cl movq $-1, %rdi cmoveq %rax, %rdi jmp __Znam Of course it would be even better if the regalloc inverted the cmov to 'cmovoq', which would eliminate the need for the 'movq %rdi, %rax'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120936 91177308-0d34-0410-b5e6-96231b3b80d8
* fix the rest of the linux miscompares :)Chris Lattner2010-12-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120933 91177308-0d34-0410-b5e6-96231b3b80d8
* generalize the previous check to handle -1 on either side of the Chris Lattner2010-12-051-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | select, inserting a not to compensate. Add a missing isZero check that I lost somehow. This improves codegen of: void *func(long count) { return new int[count]; } from: __Z4funcl: ## @_Z4funcl movl $4, %ecx ## encoding: [0xb9,0x04,0x00,0x00,0x00] movq %rdi, %rax ## encoding: [0x48,0x89,0xf8] mulq %rcx ## encoding: [0x48,0xf7,0xe1] testq %rdx, %rdx ## encoding: [0x48,0x85,0xd2] movq $-1, %rdi ## encoding: [0x48,0xc7,0xc7,0xff,0xff,0xff,0xff] cmoveq %rax, %rdi ## encoding: [0x48,0x0f,0x44,0xf8] jmp __Znam ## TAILCALL ## encoding: [0xeb,A] to: __Z4funcl: ## @_Z4funcl movl $4, %ecx ## encoding: [0xb9,0x04,0x00,0x00,0x00] movq %rdi, %rax ## encoding: [0x48,0x89,0xf8] mulq %rcx ## encoding: [0x48,0xf7,0xe1] cmpq $1, %rdx ## encoding: [0x48,0x83,0xfa,0x01] sbbq %rdi, %rdi ## encoding: [0x48,0x19,0xff] notq %rdi ## encoding: [0x48,0xf7,0xd7] orq %rax, %rdi ## encoding: [0x48,0x09,0xc7] jmp __Znam ## TAILCALL ## encoding: [0xeb,A] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120932 91177308-0d34-0410-b5e6-96231b3b80d8
* relax this to handle linux defaulting to -static.Chris Lattner2010-12-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120930 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve an integer select optimization in two ways:Chris Lattner2010-12-051-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. generalize (select (x == 0), -1, 0) -> (sign_bit (x - 1)) to: (select (x == 0), -1, y) -> (sign_bit (x - 1)) | y 2. Handle the identical pattern that happens with !=: (select (x != 0), y, -1) -> (sign_bit (x - 1)) | y cmov is often high latency and can't fold immediates or memory operands. For example for (x == 0) ? -1 : 1, before we got: < testb %sil, %sil < movl $-1, %ecx < movl $1, %eax < cmovel %ecx, %eax now we get: > cmpb $1, %sil > sbbl %eax, %eax > orl $1, %eax git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120929 91177308-0d34-0410-b5e6-96231b3b80d8
* merge some tests into select.ll and make them more specific.Chris Lattner2010-12-051-4/+88
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120928 91177308-0d34-0410-b5e6-96231b3b80d8
* rename testChris Lattner2010-12-051-0/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120927 91177308-0d34-0410-b5e6-96231b3b80d8
* remove two tests that aren't really testing anything.Chris Lattner2010-12-051-63/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120926 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate more uses of llvm-as and llvm-dis.Dan Gohman2009-09-081-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81290 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove -unwind-tables-optional everywhere, sinceDale Johannesen2008-04-141-3/+3
| | | | | | | | this is now the default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49667 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename -disable-required-unwind-tables to -unwind-tables-optional.Dale Johannesen2008-04-081-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49391 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -disable-required-unwind-tables to testsDale Johannesen2008-04-081-3/+3
| | | | | | | | | that need it (usually, grepping for some string found in unwind info) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49364 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark functions in some tests as 'nounwind'. GeneratingDale Johannesen2008-03-311-11/+11
| | | | | | | | | | EH info for these functions causes the tests to fail for random reasons (e.g. looking for 'or' or counting lines with asm-printer; labels count as lines.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49003 91177308-0d34-0410-b5e6-96231b3b80d8
* Update test.Evan Cheng2007-10-081-41/+40
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42775 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1319:Reid Spencer2007-04-161-1/+1
| | | | | | | | | Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36142 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR411:Reid Spencer2007-01-301-1/+1
| | | | | | | | | Update these tests to not use the same name even though the type of the value differs. After PR411 hits, type planes will be gone and it will be illegal for a name to be used twice, regardless of type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33660 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the llvm-upgrade program to upgrade llvm assembly.Reid Spencer2006-12-021-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32115 91177308-0d34-0410-b5e6-96231b3b80d8
* make this harderChris Lattner2006-09-051-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30120 91177308-0d34-0410-b5e6-96231b3b80d8
* Tests for fp cmov's that I forgot to check in earlierChris Lattner2004-04-011-0/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12585 91177308-0d34-0410-b5e6-96231b3b80d8
* Test folding comparisons into select instructionsChris Lattner2004-03-301-0/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12559 91177308-0d34-0410-b5e6-96231b3b80d8
* New testcase for select instructionsChris Lattner2004-03-301-0/+32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12552 91177308-0d34-0410-b5e6-96231b3b80d8