Package org.apache.sysds.hops.rewrite
Class RewriteConstantFolding
- java.lang.Object
-
- org.apache.sysds.hops.rewrite.HopRewriteRule
-
- org.apache.sysds.hops.rewrite.RewriteConstantFolding
-
public class RewriteConstantFolding extends HopRewriteRule
Rule: Constant Folding. For all statement blocks, eliminate simple binary expressions of literals within dags by computing them and replacing them with a new Literal op once. For the moment, this only applies within a dag, later this should be extended across statements block (global, inter-procedure).
-
-
Constructor Summary
Constructors Constructor Description RewriteConstantFolding()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Hop
rewriteHopDAG(Hop root, ProgramRewriteStatus state)
Handle a predicate hop DAG with exactly one root.ArrayList<Hop>
rewriteHopDAGs(ArrayList<Hop> roots, ProgramRewriteStatus state)
Handle a generic (last-level) hop DAG with multiple roots.
-
-
-
Method Detail
-
rewriteHopDAGs
public ArrayList<Hop> rewriteHopDAGs(ArrayList<Hop> roots, ProgramRewriteStatus state)
Description copied from class:HopRewriteRule
Handle a generic (last-level) hop DAG with multiple roots.- Specified by:
rewriteHopDAGs
in classHopRewriteRule
- Parameters:
roots
- high-level operator rootsstate
- program rewrite status- Returns:
- list of high-level operators
-
rewriteHopDAG
public Hop rewriteHopDAG(Hop root, ProgramRewriteStatus state)
Description copied from class:HopRewriteRule
Handle a predicate hop DAG with exactly one root.- Specified by:
rewriteHopDAG
in classHopRewriteRule
- Parameters:
root
- high-level operator rootstate
- program rewrite status- Returns:
- high-level operator
-
-