Search in sources :

Example 1 with RewriteRemoveUnnecessaryBranches

use of org.apache.sysml.hops.rewrite.RewriteRemoveUnnecessaryBranches in project incubator-systemml by apache.

the class OptimizationWrapper method createProgramRewriterWithRuleSets.

private static ProgramRewriter createProgramRewriterWithRuleSets() {
    //create hop rewrite set
    ArrayList<HopRewriteRule> hRewrites = new ArrayList<HopRewriteRule>();
    hRewrites.add(new RewriteConstantFolding());
    //create statementblock rewrite set
    ArrayList<StatementBlockRewriteRule> sbRewrites = new ArrayList<StatementBlockRewriteRule>();
    sbRewrites.add(new RewriteRemoveUnnecessaryBranches());
    ProgramRewriter rewriter = new ProgramRewriter(hRewrites, sbRewrites);
    return rewriter;
}
Also used : ProgramRewriter(org.apache.sysml.hops.rewrite.ProgramRewriter) StatementBlockRewriteRule(org.apache.sysml.hops.rewrite.StatementBlockRewriteRule) ArrayList(java.util.ArrayList) RewriteRemoveUnnecessaryBranches(org.apache.sysml.hops.rewrite.RewriteRemoveUnnecessaryBranches) RewriteConstantFolding(org.apache.sysml.hops.rewrite.RewriteConstantFolding) HopRewriteRule(org.apache.sysml.hops.rewrite.HopRewriteRule)

Aggregations

ArrayList (java.util.ArrayList)1 HopRewriteRule (org.apache.sysml.hops.rewrite.HopRewriteRule)1 ProgramRewriter (org.apache.sysml.hops.rewrite.ProgramRewriter)1 RewriteConstantFolding (org.apache.sysml.hops.rewrite.RewriteConstantFolding)1 RewriteRemoveUnnecessaryBranches (org.apache.sysml.hops.rewrite.RewriteRemoveUnnecessaryBranches)1 StatementBlockRewriteRule (org.apache.sysml.hops.rewrite.StatementBlockRewriteRule)1