[PATCH] Fix vselect when getSetCCResultType returns a different type from the operands

Nadav Rotem nrotem at apple.com
Tue May 7 12:16:15 PDT 2013


Hi Matt, 


> +  // If the mask and the type do not match and Select is legal,
> +  // go ahead and unroll the vector op.
> +  // This occurs when getSetCCResultType returns something that
> +  // is different than the operand types. For example,
> +  // v4i8 = select v4i32, v4i8, v4i8.
> +  if (VT.isVector() &&

You don't need to check if this VT is a vector because we are inside LegalizeVectorOps::ExpandVSELECT. 

> +      Op1.getValueType().getSizeInBits() != VT.getSizeInBits() &&

> +      TLI.getTypeAction(*DAG.getContext(), VT.getScalarType())
> +        == TargetLowering::TypeLegal) {

You don't need to check if the scalar select is legal. The scalar type legalizer will handle this later. 

> +    return DAG.UnrollVectorOp(Op.getNode());
> +  }
> +


Thanks,
Nadav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130507/cfc4a1eb/attachment.html>


More information about the llvm-commits mailing list