[GlobalISel] Do not crash on widening vector result
authorSerge Pavlov <sepavloff@gmail.com>
Fri, 24 Jun 2022 17:17:22 +0000 (00:17 +0700)
committerSerge Pavlov <sepavloff@gmail.com>
Fri, 30 Sep 2022 14:30:55 +0000 (21:30 +0700)
commitb3913a9cdf49102589e7dd31ff979bfaf958a720
treec5e41fd367cd2cbcb7d1b29c58c632281537973c
parent9a4e52ebeb6dd8527bc1ee944a9466d68a95b6f1
[GlobalISel] Do not crash on widening vector result

Function buildCopyToRegs did not handle properly the case when it should
make wider vector result. It happened, for example, in a function that
returns value of type <2 x f32>, which should be widen to <4 x f32> to
fit XMM register. The function eventually calls
MachineIRBuilder.buildUnmerge, which does not expect that only one
destination register is specified.

Now this case is treated specifically in buildCopyToRegs.

Differential Revision: https://reviews.llvm.org/D128546
llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
llvm/test/CodeGen/X86/GlobalISel/x86_64-irtranslator.ll