Commit eaca025e by Aditya Kumar Committed by Sebastian Pop

fix memory leak in scop-detection

        * graphite-scop-detection.c
        (scop_detection::harmful_loop_in_region): Free dom and loops.
        (scop_detection::loop_body_is_valid_scop): Free bbs.

Co-Authored-By: Sebastian Pop <s.pop@samsung.com>

From-SVN: r232655
parent 5431c9ea
2016-01-21 Aditya Kumar <aditya.k7@samsung.com> 2016-01-21 Aditya Kumar <aditya.k7@samsung.com>
Sebastian Pop <s.pop@samsung.com> Sebastian Pop <s.pop@samsung.com>
* graphite-scop-detection.c
(scop_detection::harmful_loop_in_region): Free dom and loops.
(scop_detection::loop_body_is_valid_scop): Free bbs.
2016-01-21 Aditya Kumar <aditya.k7@samsung.com>
Sebastian Pop <s.pop@samsung.com>
* graphite-scop-detection.c (record_loop_in_sese): New. * graphite-scop-detection.c (record_loop_in_sese): New.
(gather_bbs::before_dom_children): Call record_loop_in_sese. (gather_bbs::before_dom_children): Call record_loop_in_sese.
(build_scops): Remove call to build_sese_loop_nests. (build_scops): Remove call to build_sese_loop_nests.
......
...@@ -1088,7 +1088,11 @@ scop_detection::harmful_loop_in_region (sese_l scop) const ...@@ -1088,7 +1088,11 @@ scop_detection::harmful_loop_in_region (sese_l scop) const
any loop fully contained in the scop: other bbs are checked below any loop fully contained in the scop: other bbs are checked below
in loop_is_valid_in_scop. */ in loop_is_valid_in_scop. */
if (harmful_stmt_in_bb (scop, bb)) if (harmful_stmt_in_bb (scop, bb))
return true; {
dom.release ();
BITMAP_FREE (loops);
return true;
}
} }
} }
...@@ -1104,13 +1108,14 @@ scop_detection::harmful_loop_in_region (sese_l scop) const ...@@ -1104,13 +1108,14 @@ scop_detection::harmful_loop_in_region (sese_l scop) const
if (!loop_is_valid_in_scop (loop, scop)) if (!loop_is_valid_in_scop (loop, scop))
{ {
dom.release ();
BITMAP_FREE (loops); BITMAP_FREE (loops);
return true; return true;
} }
} }
BITMAP_FREE (loops);
dom.release (); dom.release ();
BITMAP_FREE (loops);
return false; return false;
} }
...@@ -1503,7 +1508,10 @@ scop_detection::loop_body_is_valid_scop (loop_p loop, sese_l scop) const ...@@ -1503,7 +1508,10 @@ scop_detection::loop_body_is_valid_scop (loop_p loop, sese_l scop) const
basic_block bb = bbs[i]; basic_block bb = bbs[i];
if (harmful_stmt_in_bb (scop, bb)) if (harmful_stmt_in_bb (scop, bb))
return false; {
free (bbs);
return false;
}
} }
free (bbs); free (bbs);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment