[llvm-commits] [PATCH] Codegen failure for vmull with small vectors

David Peixotto dpeixott at codeaurora.org
Tue Sep 18 14:03:22 PDT 2012


Please review the attached patch. It fixes PR12281
(http://llvm.org/bugs/show_bug.cgi?id=12281)

Codegen was failing with an assertion because of unexpected vector
operands when legalizing the selection DAG for a MUL instruction.

The asserting code was legalizing multiplies for vectors of size 128
bits. It uses a custom lowering to try and detect cases where it can
use a VMULL instruction instead of a VMOVL + VMUL.  The code was
looking for input operands to the MUL that had been sign or zero
extended. If it found the extended operands it would drop the
sign/zero extension and use the original vector size as input to a
VMULL instruction.

The code assumed that the original input vector was 64 bits so that
after dropping the extension it would fit directly into a D register
and could be used as an operand of a VMULL instruction. The input
code that trigger the failure used a vector of <4 x i8> that was
sign extended to <4 x i32>. It was not safe to drop the sign
extension in this case because the original vector is only 32 bits
wide. The fix is to insert a sign extension for the vector to reach
the required 64 bit size. In this particular example, the vector would
need to be sign extended to a <4 x i16>.

-- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted
by The Linux Foundation



-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Codegen-failure-for-vmull-with-small-vectors.patch
Type: application/octet-stream
Size: 10502 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120918/39ca1702/attachment.obj>


More information about the llvm-commits mailing list