Date: Sun, 29 Sep 2013 20:35:39 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r255946 - in stable/9/contrib/llvm/lib: CodeGen/SelectionDAG Target/AArch64 Target/ARM Target/Hexagon Target/MSP430 Target/Mips Target/NVPTX Target/PowerPC Target/R600 Target/Sparc Targ... Message-ID: <201309292035.r8TKZdOQ035322@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Sun Sep 29 20:35:38 2013 New Revision: 255946 URL: http://svnweb.freebsd.org/changeset/base/255946 Log: MFC r255804: Pull in r191165 from upstream llvm trunk: ISelDAG: spot chain cycles involving MachineNodes Previously, the DAGISel function WalkChainUsers was spotting that it had entered already-selected territory by whether a node was a MachineNode (amongst other things). Since it's fairly common practice to insert MachineNodes during ISelLowering, this was not the correct check. Looking around, it seems that other nodes get their NodeId set to -1 upon selection, so this makes sure the same thing happens to all MachineNodes and uses that characteristic to determine whether we should stop looking for a loop during selection. This should fix PR15840. Specifically, this fixes the long-standing assertion failure when compiling the multimedia/gstreamer port on i386. Thanks to Tijl Coosemans for his help in getting upstream to fix it. Modified: stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp stable/9/contrib/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/R600/AMDILISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) Modified: stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp ============================================================================== --- stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -1736,15 +1736,15 @@ WalkChainUsers(const SDNode *ChainedNode SDNode *User = *UI; + if (User->getOpcode() == ISD::HANDLENODE) // Root of the graph. + continue; + // If we see an already-selected machine node, then we've gone beyond the // pattern that we're selecting down into the already selected chunk of the // DAG. - if (User->isMachineOpcode() || - User->getOpcode() == ISD::HANDLENODE) // Root of the graph. - continue; - unsigned UserOpcode = User->getOpcode(); - if (UserOpcode == ISD::CopyToReg || + if (User->isMachineOpcode() || + UserOpcode == ISD::CopyToReg || UserOpcode == ISD::CopyFromReg || UserOpcode == ISD::INLINEASM || UserOpcode == ISD::EH_LABEL || Modified: stable/9/contrib/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -395,6 +395,7 @@ SDNode *AArch64DAGToDAGISel::Select(SDNo if (Node->isMachineOpcode()) { DEBUG(dbgs() << "== "; Node->dump(CurDAG); dbgs() << "\n"); + Node->setNodeId(-1); return NULL; } Modified: stable/9/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -2546,8 +2546,10 @@ SDNode *ARMDAGToDAGISel::SelectAtomic64( SDNode *ARMDAGToDAGISel::Select(SDNode *N) { DebugLoc dl = N->getDebugLoc(); - if (N->isMachineOpcode()) + if (N->isMachineOpcode()) { + N->setNodeId(-1); return NULL; // Already selected. + } switch (N->getOpcode()) { default: break; Modified: stable/9/contrib/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -1334,8 +1334,10 @@ SDNode *HexagonDAGToDAGISel::SelectAdd(S SDNode *HexagonDAGToDAGISel::Select(SDNode *N) { - if (N->isMachineOpcode()) + if (N->isMachineOpcode()) { + N->setNodeId(-1); return NULL; // Already selected. + } switch (N->getOpcode()) { Modified: stable/9/contrib/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -394,6 +394,7 @@ SDNode *MSP430DAGToDAGISel::Select(SDNod DEBUG(errs() << "== "; Node->dump(CurDAG); errs() << "\n"); + Node->setNodeId(-1); return NULL; } Modified: stable/9/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -97,6 +97,7 @@ SDNode* MipsDAGToDAGISel::Select(SDNode // If we have a custom node, we already have selected! if (Node->isMachineOpcode()) { DEBUG(errs() << "== "; Node->dump(CurDAG); errs() << "\n"); + Node->setNodeId(-1); return NULL; } Modified: stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -91,8 +91,10 @@ NVPTXDAGToDAGISel::NVPTXDAGToDAGISel(NVP /// expanded, promoted and normal instructions. SDNode *NVPTXDAGToDAGISel::Select(SDNode *N) { - if (N->isMachineOpcode()) + if (N->isMachineOpcode()) { + N->setNodeId(-1); return NULL; // Already selected. + } SDNode *ResNode = NULL; switch (N->getOpcode()) { Modified: stable/9/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -895,8 +895,10 @@ SDNode *PPCDAGToDAGISel::SelectSETCC(SDN // target-specific node if it hasn't already been changed. SDNode *PPCDAGToDAGISel::Select(SDNode *N) { DebugLoc dl = N->getDebugLoc(); - if (N->isMachineOpcode()) + if (N->isMachineOpcode()) { + N->setNodeId(-1); return NULL; // Already selected. + } switch (N->getOpcode()) { default: break; Modified: stable/9/contrib/llvm/lib/Target/R600/AMDILISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/R600/AMDILISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/R600/AMDILISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -158,6 +158,7 @@ bool AMDGPUDAGToDAGISel::SelectADDR64(SD SDNode *AMDGPUDAGToDAGISel::Select(SDNode *N) { unsigned int Opc = N->getOpcode(); if (N->isMachineOpcode()) { + N->setNodeId(-1); return NULL; // Already selected. } switch (Opc) { Modified: stable/9/contrib/llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -137,8 +137,10 @@ bool SparcDAGToDAGISel::SelectADDRrr(SDV SDNode *SparcDAGToDAGISel::Select(SDNode *N) { DebugLoc dl = N->getDebugLoc(); - if (N->isMachineOpcode()) + if (N->isMachineOpcode()) { + N->setNodeId(-1); return NULL; // Already selected. + } switch (N->getOpcode()) { default: break; Modified: stable/9/contrib/llvm/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -540,6 +540,7 @@ SDNode *SystemZDAGToDAGISel::Select(SDNo // If we have a custom node, we already have selected! if (Node->isMachineOpcode()) { DEBUG(errs() << "== "; Node->dump(CurDAG); errs() << "\n"); + Node->setNodeId(-1); return 0; } Modified: stable/9/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -1988,6 +1988,7 @@ SDNode *X86DAGToDAGISel::Select(SDNode * if (Node->isMachineOpcode()) { DEBUG(dbgs() << "== "; Node->dump(CurDAG); dbgs() << '\n'); + Node->setNodeId(-1); return NULL; // Already selected. }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309292035.r8TKZdOQ035322>