[InstCombine] refactor optimizeIntToFloatBitCast() ; NFCI
authorSanjay Patel <spatel@rotateright.com>
Wed, 18 Nov 2015 00:00:04 +0000 (00:00 +0000)
committerSanjay Patel <spatel@rotateright.com>
Wed, 18 Nov 2015 00:00:04 +0000 (00:00 +0000)
commitbc9ba1275b15b4efe62aac05a94cc4b1e83ff61f
treeb88abffce48666e09c1b58746f679758b9edc4dc
parent3d2c6fc38ee4db4b1755d49413876a00ca948ac8
[InstCombine] refactor optimizeIntToFloatBitCast() ; NFCI

The logic for handling the pattern without a shift is identical
to the logic for handling the pattern with a shift if you set
the shift amount to zero for the former.

This should make it easier to see that we probably don't even need
optimizeIntToFloatBitCast().

If we call something like foldVecTruncToExtElt() from visitTrunc(),
we'll solve PR25543:
https://llvm.org/bugs/show_bug.cgi?id=25543

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253403 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCasts.cpp