aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/R600/AMDGPUISelDAGToDAG.cpp
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2013-09-22 08:21:56 +0000
committerTim Northover <tnorthover@apple.com>2013-09-22 08:21:56 +0000
commit3e84ad28d4d3ceee25771b1e30315c20b7608c39 (patch)
tree8c7736799f6055bce7c663d2865140c69015356e /lib/Target/R600/AMDGPUISelDAGToDAG.cpp
parent7d052f272d3f9ad0acdebf6811e29d529f70c1e1 (diff)
downloadexternal_llvm-3e84ad28d4d3ceee25771b1e30315c20b7608c39.zip
external_llvm-3e84ad28d4d3ceee25771b1e30315c20b7608c39.tar.gz
external_llvm-3e84ad28d4d3ceee25771b1e30315c20b7608c39.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191165 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/R600/AMDGPUISelDAGToDAG.cpp')
-rw-r--r--lib/Target/R600/AMDGPUISelDAGToDAG.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Target/R600/AMDGPUISelDAGToDAG.cpp b/lib/Target/R600/AMDGPUISelDAGToDAG.cpp
index a008c96..88b375b 100644
--- a/lib/Target/R600/AMDGPUISelDAGToDAG.cpp
+++ b/lib/Target/R600/AMDGPUISelDAGToDAG.cpp
@@ -195,6 +195,7 @@ bool AMDGPUDAGToDAGISel::SelectADDR64(SDValue Addr, SDValue& R1, SDValue& R2) {
SDNode *AMDGPUDAGToDAGISel::Select(SDNode *N) {
unsigned int Opc = N->getOpcode();
if (N->isMachineOpcode()) {
+ N->setNodeId(-1);
return NULL; // Already selected.
}
switch (Opc) {