[llvm-commits] [llvm] r52893 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAG.h lib/CodeGen/SelectionDAG/LegalizeDAG.cpp lib/CodeGen/SelectionDAG/SelectionDAG.cpp lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/Target/ARM/ARMISelLowering.cpp lib/Target/Alpha/AlphaISelLowering.cpp lib/Target/CellSPU/SPUISelLowering.cpp lib/Target/Mips/MipsISelLowering.cpp lib/Target/PIC16/PIC16ISelLowering.cpp lib/Target/PowerPC/PPCISelLowering.cpp lib/Target/Sparc/SparcISelLowering.cpp lib/Target/X86/X86ISelLowering.cpp

Dan Gohman gohman at apple.com
Mon Jun 30 10:56:56 PDT 2008


On Jun 30, 2008, at 3:19 AM, Duncan Sands wrote:

> Author: baldrick
> Date: Mon Jun 30 05:19:09 2008
> New Revision: 52893
>
> URL: http://llvm.org/viewvc/llvm-project?rev=52893&view=rev
> Log:
> Revert the SelectionDAG optimization that makes
> it impossible to create a MERGE_VALUES node with
> only one result: sometimes it is useful to be able
> to create a node with only one result out of one of
> the results of a node with more than one result, for
> example because the new node will eventually be used
> to replace a one-result node using ReplaceAllUsesWith,
> cf X86TargetLowering::ExpandFP_TO_SINT.  On the other
> hand, most users of MERGE_VALUES don't need this and
> for them the optimization was valuable.  So add a new
> utility method getMergeValues for creating MERGE_VALUES
> nodes which by default performs the optimization.
> Change almost everywhere to use getMergeValues (and
> tidy some stuff up at the same time).

Thanks Duncan!

>   // Use a MERGE_VALUES node to drop the chain result value.
> -  return DAG.getNode(ISD::MERGE_VALUES, MVT::i64, Res).Val;
> -}
> +  return DAG.getMergeValues(DAG.getVTList(VT), &Res, 1, false).Val;
> +}

As this is the one place currently that needs to pass false to
getMergeValues, could you put a comment about it here? Something
like "note that we need to pass false to getMergeValues to tell
it not to just return back Res verbatim, which won't work here
because we specifically need a node with exactly one result."

Thanks,

Dan




More information about the llvm-commits mailing list