[ https://issues.apache.org/jira/browse/SYSTEMML-2040?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Matthias Boehm closed SYSTEMML-2040. ------------------------------------ Resolution: Fixed Assignee: Matthias Boehm Fix Version/s: SystemML 1.0 > Repeated IPA function inling leads to replicated prints > ------------------------------------------------------- > > Key: SYSTEMML-2040 > URL: https://issues.apache.org/jira/browse/SYSTEMML-2040 > Project: SystemML > Issue Type: Bug > Reporter: Matthias Boehm > Assignee: Matthias Boehm > Fix For: SystemML 1.0 > > > Due to multiple rounds of IPA with a reused function call graph, the same > function is inlined multiple times leading to replication of operations. For > most types of operations, common-subexpression elimination removes this > redundancy, but for prints and rand without seeds this leads to unnecessary > redundancy. For example, > {code} > s = "Debug info: " + sum(matrix(1,10,10)) > z = foo(s); > foo = function(String msg) return (boolean flag) { > is_debug = TRUE; > if( is_debug ) { > print(msg); flag = TRUE; > } > else { > flag = FALSE; > } > } > {code} > generates the following runtime plan with 3 replicated prints > {code} > PROGRAM > --MAIN PROGRAM > ----GENERIC (lines 1-2) [recompile=false] > ------(19) dg(rand) [10,10,1000,1000,100] [0,0,0 -> 0MB], CP > ------(20) ua(+RC) (19) [0,0,-1,-1,-1] [0,0,0 -> 0MB], CP > ------(21) b(+) (20) [0,0,-1,-1,-1] [0,0,0 -> 0MB], CP > ------(5) u(print) (21) [-1,-1,-1,-1,-1] [0,0,0 -> 0MB] > ------(7) TWrite z [0,0,-1,-1,-1] [0,0,0 -> 0MB], CP > ------(5) u(print) (21) [-1,-1,-1,-1,-1] [0,0,0 -> 0MB] > ------(7) TWrite z [0,0,-1,-1,-1] [0,0,0 -> 0MB], CP > ------(5) u(print) (21) [-1,-1,-1,-1,-1] [0,0,0 -> 0MB] > ------(7) TWrite z [0,0,-1,-1,-1] [0,0,0 -> 0MB], CP > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)