[X86][SSE] Improve recognition of uitofp conversions that can be performed as sitofp
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 18 Sep 2016 12:45:23 +0000 (12:45 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 18 Sep 2016 12:45:23 +0000 (12:45 +0000)
commit6c21e6a54e7aa2eb9878b1075eade08d4fdb9f32
treefb1aeaa228fc4be70e9cd8a5e11bf54ef36a59ea
parenta1a0e7ddbec054373876b61fa680049385cb6cf9
[X86][SSE] Improve recognition of uitofp conversions that can be performed as sitofp

With D24253 we can now use SelectionDAG::SignBitIsZero with vector operations.

This patch uses SelectionDAG::SignBitIsZero to recognise that a zero sign bit means that we can use a sitofp instead of a uitofp (which is not directly support on pre-AVX512 hardware).

While AVX512 does provide support for uitofp, the conversion to sitofp should not cause any regressions.

Differential Revision: https://reviews.llvm.org/D24343

llvm-svn: 281852
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/avx512-cvt.ll
llvm/test/CodeGen/X86/i64-to-float.ll
llvm/test/CodeGen/X86/uint_to_fp-3.ll
llvm/test/CodeGen/X86/vec_int_to_fp.ll