An apparatus for automatically converting a control flow program into a data flow program comprises a non-transitory machine-readable medium and a translator stored in the machine-readable medium. The translator, when executed by a data processing system, enables the data processing system to (a) automatically generate a control dependency graph for a control flow program, (b) automatically generate a data flow graph based at least in part on the control dependency graph, and (c) automatically generate a data flow program based at least in part on the data flow graph. In one embodiment or scenario, the translator may also automatically insert a switch instruction into the data flow program, in response to a determination that a variable of the control flow program is defined in one control dependency region and used in a different control dependency region. Other embodiments are described and claimed.
展开▼