[llvm-commits] [llvm] r139623 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp lib/CodeGen/SelectionDAG/SelectionDAG.cpp lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/sse2-blend.ll

Duncan Sands baldrick at free.fr
Thu Sep 15 00:21:46 PDT 2011


Hi Nadav,

> --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp (original)
> +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp Tue Sep 13 14:17:42 2011
> @@ -61,6 +61,9 @@
>     // Implements expansion for UINT_TO_FLOAT; falls back to UnrollVectorOp if
>     // SINT_TO_FLOAT and SHR on vectors isn't legal.
>     SDValue ExpandUINT_TO_FLOAT(SDValue Op);
> +  // Implement vselect in terms of XOR, AND,OR when blend is not supported

missing space after "AND,".

> +  //  by the target.

too many spaces before "by".

> -SDValue VectorLegalizer::ExpandUINT_TO_FLOAT(SDValue Op) {
> +SDValue VectorLegalizer::ExpandVSELECT(SDValue Op) {
> +  // Implement VSELECT in terms of XOR, AND, OR
> +  // on platforms which do not support blend natively.
> +  EVT VT =  Op.getOperand(0).getValueType();
> +  EVT OVT = Op.getOperand(0).getValueType();

These types are the same...

> +  DebugLoc DL = Op.getDebugLoc();
> +
> +  SDValue Mask = Op.getOperand(0);
> +  SDValue Op1 = Op.getOperand(1);
> +  SDValue Op2 = Op.getOperand(2);
> +
> +  // If we can't even use the basic vector operations of
> +  // AND,OR,XOR, we will have to scalarize the op.
> +  if (!TLI.isOperationLegalOrCustom(ISD::AND, VT) ||
> +      !TLI.isOperationLegalOrCustom(ISD::XOR, VT) ||
> +      !TLI.isOperationLegalOrCustom(ISD::OR, VT)) {
> +    return DAG.UnrollVectorOp(Op.getNode());
> +  }

No need for curly brackets { }.

Otherwise looks good!

Ciao, Duncan.



More information about the llvm-commits mailing list