[llvm] r301002 - ARM: don't try to create an i8 -> i32 vpaddl.
Friedman, Eli via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 21 11:29:47 PDT 2017
On 4/21/2017 10:21 AM, Tim Northover via llvm-commits wrote:
> Author: tnorthover
> Date: Fri Apr 21 12:21:59 2017
> New Revision: 301002
>
> URL: http://llvm.org/viewvc/llvm-project?rev=301002&view=rev
> Log:
> ARM: don't try to create an i8 -> i32 vpaddl.
>
> DAG combine was mistakenly assuming that the step-up it was looking at was
> always a doubling, but it can sometimes be a larger extension in which case
> we'd crash.
>
> Modified:
> llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
> llvm/trunk/test/CodeGen/ARM/vpadd.ll
>
> Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=301002&r1=301001&r2=301002&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
> +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Fri Apr 21 12:21:59 2017
> @@ -9480,8 +9480,11 @@ AddCombineBUILD_VECTORToVPADDL(SDNode *N
> return SDValue();
> }
>
> - // Don't generate vpaddl+vmovn; we'll match it to vpadd later.
> - if (Vec.getValueType().getVectorElementType() == VT.getVectorElementType())
> + // Don't generate vpaddl+vmovn; we'll match it to vpadd later. Also don't try
> + // to handle an i8 -> i32 situation (or similar). vpaddl can only double the
> + // size.
> + if (2 * Vec.getValueType().getVectorElementType().getSizeInBits() !=
> + VT.getVectorElementType().getSizeInBits())
> return SDValue();
Related testcase:
define <2 x i16> @fromExtendingExtractVectorElt_2i16(<8 x i16> %in) {
; CHECK-LABEL: fromExtendingExtractVectorElt_2i8:
; CHECK: vadd.i32
%tmp1 = shufflevector <8 x i16> %in, <8 x i16> undef, <2 x i32> <i32
0, i32 2>
%tmp2 = shufflevector <8 x i16> %in, <8 x i16> undef, <2 x i32> <i32
1, i32 3>
%x = add <2 x i16> %tmp2, %tmp1
ret <2 x i16> %x
}
-Eli
--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
More information about the llvm-commits
mailing list