Depgraph: use has_loop algorithm to spot data flow loops; fix reg test

This commit is contained in:
Fabrice Desclaux
2016-03-23 16:38:34 +01:00
parent 359357f4c5
commit 8c436da764
3 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -252,10 +252,10 @@ class DependencyResult(DependencyState):
@property
def has_loop(self):
"""True if current dictionary has a loop"""
"""True iff there is at least one data dependencies cycle (regarding
the associated depgraph)"""
if self._has_loop is None:
self._has_loop = (len(self.relevant_labels) !=
len(set(self.relevant_labels)))
self._has_loop = self.graph.has_loop()
return self._has_loop
def irblock_slice(self, irb):
+1 -1
View File
@@ -1 +1 @@
[{"EAX": "0x1", "has_loop": false}, {"EAX": "0x2", "has_loop": true}]
[{"EAX": "0x1", "has_loop": false}, {"EAX": "0x2", "has_loop": false}]
@@ -1 +1 @@
[{"has_loop": false, "EAX": "0x1", "satisfiability": true, "constraints": {"EAX_init": "0xffffffff"}}, {"has_loop": true, "EAX": "0x2", "satisfiability": false, "constraints": {}}]
[{"has_loop": false, "EAX": "0x1", "satisfiability": true, "constraints": {"EAX_init": "0xffffffff"}}, {"has_loop": false, "EAX": "0x2", "satisfiability": false, "constraints": {}}]