[llvm-commits] Patch to add support for WidenVecRes_MERGE_VALUES

Tobias Grosser tobias at grosser.es
Tue Aug 30 00:11:42 PDT 2011


On 08/30/2011 01:07 AM, Villmow, Micah wrote:
> [Villmow, Micah] Here is an updated patch. This version merges the common
> code between SplitRes_MERGE_VALUES and WidenVecRes_MERGE_VALUES into a
> seperate function and has them call this function and then modify the
> resulting value.

Two comments inline, otherwise it looks good to me.
(Review by official reviewer still necessary).

Cheers
Tobi


> Index: lib/CodeGen/SelectionDAG/LegalizeTypes.h
> ===================================================================
> --- lib/CodeGen/SelectionDAG/LegalizeTypes.h	(revision 138781)
> +++ lib/CodeGen/SelectionDAG/LegalizeTypes.h	(working copy)
> @@ -148,12 +148,20 @@
>     SDValue CreateStackStoreLoad(SDValue Op, EVT DestVT);
>     bool CustomLowerNode(SDNode *N, EVT VT, bool LegalizeResult);
>     bool CustomWidenLowerNode(SDNode *N, EVT VT);
> +
> +  // DecomposeMERGE_VALUES  takes a SDNode and returns the first
> +  // operand that illegal operand that needs to be modified.
Is this correct grammar? What do you mean?
  - DecomposeMERGE_VALUES takes a SDNode and returns the first
    operand that needs to be modified.
  - DecomposeMERGE_VALUES takes a SDNode and returns the first
    illegal operand.
  - DecomposeMERGE_VALUES takes a SDNode and returns the first
    illegal operand which needs to be modified.

> +  // All other nodes are legalized, whether they are legal or not.
> +  // The resulting SDValue needs to be modified to make it legal.
> +  SDValue DecomposeMERGE_VALUES(SDNode *N);
> +
>     SDValue GetVectorElementPointer(SDValue VecPtr, EVT EltVT, SDValue Index);
>     SDValue JoinIntegers(SDValue Lo, SDValue Hi);
>     SDValue LibCallify(RTLIB::Libcall LC, SDNode *N, bool isSigned);
>     SDValue MakeLibCall(RTLIB::Libcall LC, EVT RetVT,
>                         const SDValue *Ops, unsigned NumOps, bool isSigned,
>                         DebugLoc dl);
> +
>   	std::pair<SDValue, SDValue>  ExpandChainLibCall(RTLIB::Libcall LC,
>   									                               SDNode *Node, bool isSigned);
>   	std::pair<SDValue, SDValue>  ExpandAtomic(SDNode *Node);
>   void DAGTypeLegalizer::SplitRes_SELECT(SDNode *N, SDValue&Lo,
> Index: lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
> ===================================================================
> --- lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp	(revision 138781)
> +++ lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp	(working copy)
> @@ -1557,6 +1558,12 @@
>                        WidenVT, WidenLHS, DAG.getValueType(ExtVT));
>   }
>
> +SDValue DAGTypeLegalizer::WidenVecRes_MERGE_VALUES(SDNode *N)
> +{
The '{' should be in the previous line to match coding standards in this 
file.

> +  SDValue WidenVec = DecomposeMERGE_VALUES(N);
> +  return GetWidenedVector(WidenVec);
> +}
> +
>   SDValue DAGTypeLegalizer::WidenVecRes_BITCAST(SDNode *N) {
>     SDValue InOp = N->getOperand(0);
>     EVT InVT = InOp.getValueType();



More information about the llvm-commits mailing list