[DAGCombiner][TLI] Do not fuse bitcast to <1 x ?> into a load/store of a vector
authorRoman Lebedev <lebedev.ri@gmail.com>
Sat, 31 Dec 2022 00:23:54 +0000 (03:23 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Sat, 31 Dec 2022 00:49:43 +0000 (03:49 +0300)
commit16facf1ca60c5f1118e32bca4219d9c233dfaf28
tree97f2166d1ac02b9c23d9c3198a7726296d167bfd
parent2480164247c970e130f3f59c9d8498c12a078deb
[DAGCombiner][TLI] Do not fuse bitcast to <1 x ?> into a load/store of a vector

Single-element vectors are legalized by splitting,
so the the memory operations would also get scalarized.
While we do have some support to reconstruct scalarized loads,
we clearly don't catch everything.

The comment for the affected AArch64 store suggests that
having two stores was the desired outcome in the first place.

This was showing as a source of *many* regressions
with more aggressive ZERO_EXTEND_VECTOR_INREG recognition.
llvm/lib/CodeGen/TargetLoweringBase.cpp
llvm/test/CodeGen/AArch64/merge-store.ll
llvm/test/CodeGen/X86/single_elt_vector_memory_operation.ll
llvm/test/CodeGen/X86/widen_load-0.ll