implement InstCombine/shift-trunc-shift.ll. This allows
authorChris Lattner <sabre@nondot.org>
Sat, 22 Dec 2007 09:07:47 +0000 (09:07 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 22 Dec 2007 09:07:47 +0000 (09:07 +0000)
commit8999dd3c6862046cfd0b45b0c5101d3266975010
tree39b697983ee1b891ecb0fba486042b5240ccfdeb
parentcae8d8d4bebd0517c16145cf3bc3304e8eadad6b
implement InstCombine/shift-trunc-shift.ll.  This allows
us to compile:
#include <math.h>
int t1(double d) { return signbit(d); }

into:

_t1:
movd %xmm0, %rax
shrq $63, %rax
ret

instead of:

_t1:
movd %xmm0, %rax
shrq $32, %rax
shrl $31, %eax
ret

on x86-64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45311 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/InstructionCombining.cpp
test/Transforms/InstCombine/shift-trunc-shift.ll [new file with mode: 0644]