[llvm-commits] [llvm] r140464 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp

Duncan Sands baldrick at free.fr
Mon Sep 26 02:07:27 PDT 2011


Hi Nadav,

> Implement Duncan's suggestion to use the result of getSetCCResultType if it is legal
> (this is always the case for scalars), otherwise use the promoted result type.

> --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (original)
> +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Sat Sep 24 14:48:19 2011
> @@ -503,8 +503,15 @@
>
>   SDValue DAGTypeLegalizer::PromoteIntRes_SETCC(SDNode *N) {
>     EVT SVT = TLI.getSetCCResultType(N->getOperand(0).getValueType());
> -  // Vector setcc result types need to be leglized.
> -  SVT = TLI.getTypeToTransformTo(*DAG.getContext(), SVT);
> +
> +  // Convert to the expected type.

This comment doesn't make any sense here.  Better to have left it where it was.

> +  EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), N->getValueType(0));
> +
> +  // Only use the result of getSetCCResultType if it is legal,
> +  // otherwise just use the promoted result type (NVT).
> +  if (getTypeAction(SVT) != TargetLowering::TypeLegal) {

Simpler: TLI.isTypeLegal(SVT)

> +    SVT = NVT;
> +  }

No need for curly brackets {}.

Ciao, Duncan.



More information about the llvm-commits mailing list