aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/NVPTX
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/NVPTX
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/NVPTX')
-rw-r--r--lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp b/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp
index 01fbdb3..68fa955 100644
--- a/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp
+++ b/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp
@@ -118,8 +118,10 @@ bool NVPTXDAGToDAGISel::useF32FTZ() const {
/// 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()) {