diff options
author | Luo <xionghu.luo@intel.com> | 2015-01-28 09:23:33 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@intel.com> | 2015-01-28 12:45:54 +0800 |
commit | f4371db8800c41dd38249b1fc17b823656f7d3e9 (patch) | |
tree | b353b61fbb4966575c9b238de87b6dc1c7438360 | |
parent | 4340b304132ce36cb62069794135016a9135db5d (diff) |
check the predication in case of endless loop.
v2:
Add comment from ruiling:
or dead loop, it has an unconditional branch at its end.
Simply do not treat it as a loop is also acceptable.
I ran into this problem when I execute
./opencv_test_imgproc --gtest_filter=OCL_Imgproc/HoughLines.RealImage/0
And it fix the problem.
Signed-off-by: Luo <xionghu.luo@intel.com>
Reviewed-by: Ruiling Song <ruiling.song@intel.com>
-rw-r--r-- | backend/src/ir/structural_analysis.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/backend/src/ir/structural_analysis.cpp b/backend/src/ir/structural_analysis.cpp index 4c7e3d21..101570a3 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 |