[llvm-commits] [llvm] r143177 - in /llvm/trunk: lib/CodeGen/SelectionDAG/ lib/Target/ARM/ lib/Target/X86/ lib/Target/XCore/ test/CodeGen/CellSPU/ test/CodeGen/Mips/ test/CodeGen/Thumb/ test/CodeGen/X86/

Chandler Carruth chandlerc at google.com
Thu Oct 27 18:40:29 PDT 2011


On Thu, Oct 27, 2011 at 6:29 PM, Dan Gohman <gohman at apple.com> wrote:

> Author: djg
> Date: Thu Oct 27 20:29:32 2011
> New Revision: 143177
>
> URL: http://llvm.org/viewvc/llvm-project?rev=143177&view=rev
> Log:
> Eliminate LegalizeOps' LegalizedNodes map and have it just call RAUW
> on every node as it legalizes them. This makes it easier to use
> hasOneUse() heuristics, since unneeded nodes can be removed from the
> DAG earlier.
>
> Make LegalizeOps visit the DAG in an operands-last order. It previously
> used operands-first, because LegalizeTypes has to go operands-first, and
> LegalizeTypes used to be part of LegalizeOps, but they're now split.
> The operands-last order is more natural for several legalization tasks.
> For example, it allows lowering code for nodes with floating-point or
> vector constants to see those constants directly instead of seeing the
> lowered form (often constant-pool loads). This makes some things
> somewhat more complicated today, though it ought to allow things to be
> simpler in the future. It also fixes some bugs exposed by Legalizing
> using RAUW aggressively.
>
> Remove the part of LegalizeOps that attempted to patch up invalid chain
> operands on libcalls generated by LegalizeTypes, since it doesn't work
> with the new LegalizeOps traversal order. Instead, define what
> LegalizeTypes is doing to be correct, and transfer the responsibility
> of keeping calls from having overlapping calling sequences into the
> scheduler.
>
> Teach the scheduler to model callseq_begin/end pairs as having a
> physical register definition/use to prevent calls from having
> overlapping calling sequences. This is also somewhat complicated, though
> there are ways it might be simplified in the future.
>
> This addresses rdar://9816668, rdar://10043614, rdar://8434668, and others.
> Please direct high-level questions about this patch to management.
>
> Removed:
>    llvm/trunk/test/CodeGen/X86/2009-02-05-CoalescerBug.ll
>    llvm/trunk/test/CodeGen/X86/dbg-inline.ll
> Modified:
>    llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
>    llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
>    llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
>    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
>    llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
>    llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
>    llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
>    llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp
>    llvm/trunk/test/CodeGen/CellSPU/and_ops.ll
>    llvm/trunk/test/CodeGen/CellSPU/call_indirect.ll
>    llvm/trunk/test/CodeGen/CellSPU/nand.ll
>    llvm/trunk/test/CodeGen/CellSPU/or_ops.ll
>    llvm/trunk/test/CodeGen/CellSPU/select_bits.ll
>    llvm/trunk/test/CodeGen/CellSPU/struct_1.ll
>    llvm/trunk/test/CodeGen/Mips/cprestore.ll
>    llvm/trunk/test/CodeGen/Mips/largeimmprinting.ll
>    llvm/trunk/test/CodeGen/Thumb/2011-05-11-DAGLegalizer.ll
>    llvm/trunk/test/CodeGen/X86/sse3.ll
>
> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=143177&r1=143176&r2=143177&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
> +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Thu Oct 27 20:29:32
> 2011
>

<snip>


> +#if 0
> +  SDValue LastChain = DAG.getEntryNode();
> +  for (SelectionDAG::allnodes_iterator I = DAG.allnodes_begin(),
> +       E = DAG.allnodes_end(); I != E; ++I) {
> +    SDNode *N = I;
> +    if (N->getOpcode() == ISD::CALLSEQ_START) {
> +      SmallVector<SDValue, 4> Ops(N->op_begin(), N->op_end());
> +      Ops[0] = LastChain;
> +      SDNode *New = DAG.UpdateNodeOperands(N, Ops.data(), Ops.size());
> +      assert(New == N && "CALLSEQ_START got CSE'd!");
> +    }
> +    for (unsigned i = 0, e = N->getNumValues(); i != e; ++i)
> +      if (N->getValueType(i) == MVT::Other)
> +        LastChain = SDValue(N, i);
>   }
> +#endif
>

FYI, was leaving this #if 0-ed code intentional?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20111027/bed5856f/attachment.html>


More information about the llvm-commits mailing list