[Beignet] [PATCH] check the predication in case of endless loop.

xionghu.luo at intel.com xionghu.luo at intel.com
Tue Jan 27 17:23:33 PST 2015


From: Luo <xionghu.luo at intel.com>

Signed-off-by: Luo <xionghu.luo at intel.com>
---
 backend/src/ir/structural_analysis.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/backend/src/ir/structural_analysis.cpp b/backend/src/ir/structural_analysis.cpp
index 4c7e3d2..101570a 100644
--- a/backend/src/ir/structural_analysis.cpp
+++ b/backend/src/ir/structural_analysis.cpp
@@ -67,6 +67,11 @@ namespace analysis
     if (pbb->hasExtraBra)
       it--;
     ir::BranchInstruction* pinsn = static_cast<ir::BranchInstruction *>(&*it);
+
+    if(!pinsn->isPredicated()){
+      std::cout << "WARNING:" << "endless loop detected!" << std::endl;
+      return;
+    }
     ir::Register reg = pinsn->getPredicateIndex();
     /* since this node is an while node, so we remove the BRA instruction at the bottom of the exit BB of 'node',
      * and insert WHILE instead
-- 
1.9.1



More information about the Beignet mailing list