[Beignet] [PATCH] structuralize bug fix: check the loop successor before merge.
xionghu.luo at intel.com
xionghu.luo at intel.com
Sun Jul 5 23:51:39 PDT 2015
From: Luo Xionghu <xionghu.luo at intel.com>
self loop header should have a successor to itself, check this before merge.
this could fix Opencv case opencv_perf_imgproc/OCL_CvtColorFixture_CvtColor causes GPU hang.
Signed-off-by: Luo Xionghu <xionghu.luo at intel.com>
---
backend/src/ir/structurizer.cpp | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/backend/src/ir/structurizer.cpp b/backend/src/ir/structurizer.cpp
index 82bb56b..6c4e455 100644
--- a/backend/src/ir/structurizer.cpp
+++ b/backend/src/ir/structurizer.cpp
@@ -812,6 +812,13 @@ namespace ir {
if(loopBBs.empty())
return 0;
+ if(loopSets.size() == 1) {
+ //self loop header should have a successor to itself, check this before merged.
+ Block* lblock = *loopSets.begin();
+ if(lblock->successors().find(lblock) == lblock->successors().end())
+ return 0;
+ }
+
Block* mergedBB = mergeLoopBlock(loopBBs);
if(mergedBB == NULL)
return 0;
--
1.9.1
More information about the Beignet
mailing list