summaryrefslogtreecommitdiff
path: root/include/llvm
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2014-05-31 16:23:20 +0000
committerAdam Nemet <anemet@apple.com>2014-05-31 16:23:20 +0000
commit8fb9cfe141ea0ad6e8ec695273b2b8f901ea24c0 (patch)
tree3d4088eae9ae56896d255f6990aaf3eb169e7f37 /include/llvm
parentaa8deedcb2abd03ce312a240d6faa28c2733363d (diff)
downloadllvm-8fb9cfe141ea0ad6e8ec695273b2b8f901ea24c0.tar.gz
llvm-8fb9cfe141ea0ad6e8ec695273b2b8f901ea24c0.tar.bz2
llvm-8fb9cfe141ea0ad6e8ec695273b2b8f901ea24c0.tar.xz
[SelectionDAG] Force cycle detection in AssignTopologicalOrder before aborting
DAG cycle detection is only enabled with ENABLE_EXPENSIVE_CHECKS. However we can run it just before we would crash in order to provide more informative diagnostics. Now in addition to the "Overran sorted position" message we also get the Node printed if a cycle was detected. Tested by building several configs: Debug+Assert, Debug+Assert+Check (this is ENABLE_EXPENSIVE_CHECKS), Release+Assert and Release. Also tried that the AssignTopologicalOrder assert produces the expected results. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209977 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/CodeGen/SelectionDAG.h2
-rw-r--r--include/llvm/CodeGen/SelectionDAGNodes.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h
index 66473554d0..c6d716a535 100644
--- a/include/llvm/CodeGen/SelectionDAG.h
+++ b/include/llvm/CodeGen/SelectionDAG.h
@@ -151,7 +151,7 @@ public:
};
class SelectionDAG;
-void checkForCycles(const SelectionDAG *DAG);
+void checkForCycles(const SelectionDAG *DAG, bool force = false);
/// SelectionDAG class - This is used to represent a portion of an LLVM function
/// in a low-level Data Dependence DAG representation suitable for instruction
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h
index f281a06970..09cac42841 100644
--- a/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -49,7 +49,8 @@ template <typename T> struct DenseMapInfo;
template <typename T> struct simplify_type;
template <typename T> struct ilist_traits;
-void checkForCycles(const SDNode *N, const SelectionDAG *DAG = nullptr);
+void checkForCycles(const SDNode *N, const SelectionDAG *DAG = nullptr,
+ bool force = false);
/// SDVTList - This represents a list of ValueType's that has been intern'd by
/// a SelectionDAG. Instances of this simple value class are returned by