[PATCH] [AArch64 NEON] Invalid constant is used in vselect condition.
Andrea Di Biagio
Andrea_DiBiagio at sn.scee.net
Sat Jan 4 03:16:41 PST 2014
Hi Kevin,
your patch looks good to me.
My original code worked under the wrong assumption that the vector element type and the type of each ConstantSDNode in the build_vector were the same.
However, when promoting the integer operand of a legally typed build_vector, the operand type and the vector element type do not need to be the same (See method 'DAGTypeLegalizer::PromoteIntOp_BUILD_VECTOR' in LegalizeIntegerTypes.cpp).
in AArch64 backend, the following dag sequence:
C0: i1 = Constant<0>
C1: i1 = Constant<-1>
V: v8i1 = BUILD_VECTOR C1, C1, C0, C0, C0, C0, C0, C0
is type-legalized into:
NewC0: i32 = Constant<0>
NewC1: i32 = Constant<1>
V: v8i8 = BUILD_VECTOR NewC1, NewC1, NewC0, NewC0, NewC0, NewC0, NewC0, NewC0
Forcing a getZeroExtend to VTBits to ensure that the new constant is correctly generated looks good to me!
Thanks,
Andrea Di Biagio
http://llvm-reviews.chandlerc.com/D2503
More information about the llvm-commits
mailing list