[Beignet] [PATCH] structuralize bug fix: check the loop successor before merge.

Yang, Rong R rong.r.yang at intel.com
Mon Jul 6 06:57:40 PDT 2015


LGTM, pushed, thanks.

> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> xionghu.luo at intel.com
> Sent: Monday, July 6, 2015 14:52
> To: beignet at lists.freedesktop.org
> Cc: Luo, Xionghu
> Subject: [Beignet] [PATCH] structuralize bug fix: check the loop successor
> before merge.
> 
> 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
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list