optimize the case of cond ? 42 : 41 and friends. This compiles the
authorChris Lattner <sabre@nondot.org>
Fri, 13 Mar 2009 05:22:11 +0000 (05:22 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 13 Mar 2009 05:22:11 +0000 (05:22 +0000)
commit97a29a5fee209769c52d78564ffe9dde514d5f03
treefaf14ba7ea8ee696b7a08aa3537cf772357e751c
parent0582ae99ba75a556d6ff63b254da327d32ba036f
optimize the case of cond ? 42 : 41 and friends.  This compiles the
example to:

_test:
movl 4(%esp), %eax
cmpl $41, (%eax)
setg %al
movzbl %al, %eax
orl $4294967294, %eax
ret

instead of:

        movl    4(%esp), %eax
        cmpl    $41, (%eax)
movl $4294967294, %ecx
movl $4294967295, %eax
cmova %ecx, %eax
ret

which is smaller in code size and faster. rdar://6668608

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66868 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/select-no-cmov.ll [new file with mode: 0644]