[X86] Use 128-bit vector instructions for f32/f64->i64 conversions on 32-bit targets...
authorCraig Topper <craig.topper@intel.com>
Tue, 24 Dec 2019 19:08:06 +0000 (11:08 -0800)
committerCraig Topper <craig.topper@intel.com>
Tue, 24 Dec 2019 19:20:10 +0000 (11:20 -0800)
commitc06e53119b1f04696fbcf710aaa0818cbfc99600
tree100ada107505940ab28967dbe3ff70a1987768e5
parent020ca0cf2f1470db24fe0e194467a66fdea73795
[X86] Use 128-bit vector instructions for f32/f64->i64 conversions on 32-bit targets with avx512dq and avx512vl instructions.

On 32-bit targets we can't use the scalar instruction so we
insert the scalar into a vector and use packed conversions.
Previously we used either v4f32->v4i64 or v4f64->v4i64 to avoid
some complexity creating target specific ISD opcodes for
v4f32->v2i64. But this causes extra vzeroupper instructions and
possibly frequency throttling on Intel CPUs.

This patch changes this to create a 128-bit vector and uses a
target specific ISD opcode if needed.
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/scalar-fp-to-i64.ll