Repository: incubator-systemml Updated Branches: refs/heads/master f8e3b5162 -> cfc561eec
Fix simplification rewrite 'simplify reverse op' w/ multiple consumers In case the rewrite was applied to a pattern rooted by multiple consumers, the first instance destroyed the existing sub-dag (which was still in temporary use). This patch simply does a conditional cleanup. Project: http://git-wip-us.apache.org/repos/asf/incubator-systemml/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-systemml/commit/63a56b09 Tree: http://git-wip-us.apache.org/repos/asf/incubator-systemml/tree/63a56b09 Diff: http://git-wip-us.apache.org/repos/asf/incubator-systemml/diff/63a56b09 Branch: refs/heads/master Commit: 63a56b0923d797ec6d8c52a5a88e27f6d16e59db Parents: f8e3b51 Author: Matthias Boehm <[email protected]> Authored: Tue Mar 8 19:07:34 2016 -0800 Committer: Matthias Boehm <[email protected]> Committed: Tue Mar 8 19:07:34 2016 -0800 ---------------------------------------------------------------------- .../sysml/hops/rewrite/RewriteAlgebraicSimplificationStatic.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/63a56b09/src/main/java/org/apache/sysml/hops/rewrite/RewriteAlgebraicSimplificationStatic.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/hops/rewrite/RewriteAlgebraicSimplificationStatic.java b/src/main/java/org/apache/sysml/hops/rewrite/RewriteAlgebraicSimplificationStatic.java index 77b2e5e..2e2ec79 100644 --- a/src/main/java/org/apache/sysml/hops/rewrite/RewriteAlgebraicSimplificationStatic.java +++ b/src/main/java/org/apache/sysml/hops/rewrite/RewriteAlgebraicSimplificationStatic.java @@ -571,8 +571,9 @@ public class RewriteAlgebraicSimplificationStatic extends HopRewriteRule ReorgOp rop = HopRewriteUtils.createReorg(hi.getInput().get(1), ReOrgOp.REV); HopRewriteUtils.removeChildReferenceByPos(parent, hi, pos); - HopRewriteUtils.removeAllChildReferences(hi); HopRewriteUtils.addChildReference(parent, rop, pos); + if( hi.getParent().isEmpty() ) + HopRewriteUtils.removeAllChildReferences(hi); if( top.getParent().isEmpty() ) HopRewriteUtils.removeAllChildReferences(top);
