[X86][FP16] Fix vector_shuffle and lowering without f16c feature problems
authorPhoebe Wang <phoebe.wang@intel.com>
Tue, 2 Aug 2022 13:58:15 +0000 (21:58 +0800)
committerPhoebe Wang <phoebe.wang@intel.com>
Tue, 2 Aug 2022 14:26:41 +0000 (22:26 +0800)
commit23021d4d8c6b2c7cbb3ebe1be61cface0c52f80a
treea2d413cf25e37849eacbe829cf414ad32f821915
parent6093a77caf44aad1bc62056295988d08e13cd421
[X86][FP16] Fix vector_shuffle and lowering without f16c feature problems

The problem Alexander reported on D127982 was caused by an optimization
for AVX512-FP16 instruction. We must limit it to the feature enabled only.

During the investigation, I found we didn't expand for fp_round/fp_extend
without F16C. This may result runtime crash, so change them too.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D130817
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/half.ll
llvm/test/CodeGen/X86/vector-half-conversions.ll