[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

Chris Lattner clattner at apple.com
Mon Jun 30 10:18:00 PDT 2008


On Jun 30, 2008, at 3:19 AM, Duncan Sands wrote:
> 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

Ok

>
> +  /// getMergeValues - Create a MERGE_VALUES node from the given  
> types and ops.
> +  /// Allowed to return something different (and simpler) if  
> Simplify is true.
> +  SDOperand getMergeValues(SDVTList VTs, SDOperandPtr Ops, unsigned  
> NumOps,
> +                           bool Simplify = true) {
> +    if (Simplify && NumOps == 1)
> +      return Ops[0];
> +    return getNode(ISD::MERGE_VALUES, VTs, Ops, NumOps);
> +  }

Why require clients to pass in the VTlist?  Can it be inferred from  
the operands?  Since 'getMergeValues' is specific to the MERGE_VALUES  
node, it seems like a nicety to do that.

-Chris



More information about the llvm-commits mailing list