[Codegen][X86] `LowerBUILD_VECTOR()`: improve lowering w/ multiple FREEZE-UNDEF ops
authorRoman Lebedev <lebedev.ri@gmail.com>
Wed, 4 Jan 2023 17:43:42 +0000 (20:43 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Wed, 4 Jan 2023 18:16:11 +0000 (21:16 +0300)
commite4b260efb2c8dca3035597d30ffd066ffb77daea
tree01a1a87fd0e1565f0b5e3eb7d8679362eb73157d
parent91f1c59fcdf5b7b2f023fa05c6fbd75ce0140a50
[Codegen][X86] `LowerBUILD_VECTOR()`: improve lowering w/ multiple FREEZE-UNDEF ops

While we have great handling for UNDEF operands,
FREEZE-UNDEF operands are effectively normal operands.

We are better off "interleaving" such BUILD_VECTORS into a blend
between a splat of FREEZE-UNDEF, and "thawed" source BUILD_VECTOR,
both of which are more natural for us to handle.

Refs. https://github.com/llvm/llvm-project/commit/f738ab9075f838dd4365adf3a92ca1acced114d7#r95017306
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/freeze-vector.ll