[GISel][CombinerHelper] Combine shuffle_vector scalar to build_vector
authorQuentin Colombet <qcolombet@apple.com>
Thu, 31 Oct 2019 00:16:55 +0000 (17:16 -0700)
committerQuentin Colombet <qcolombet@apple.com>
Thu, 31 Oct 2019 01:20:37 +0000 (18:20 -0700)
commitf0eeb3c7a7136dd043b792ff2d321ad492db203a
treeadad48222bbbabf95a4a3a0d5909729772e50ed9
parent9baf4958cda4cb7857c62681a5f50200de0a662a
[GISel][CombinerHelper] Combine shuffle_vector scalar to build_vector

Teach the combiner helper how to replace shuffle_vector of scalars
into build_vector.
I am not particularly happy about having to add this combine, but we
currently get those from <1 x iN> from the IR.

Bonus: This fixes an assert in the shuffle_vector combines since before
this patch, we were expecting vector types.
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
llvm/test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-shuffle-vector.mir