2024 Volume 32 Pages 552-564
We present bidirectional data flow analysis for constant propagation in the concurrent reversible intermediate language, CRIL, proposed by the authors. A CRIL program consists of basic blocks, each with one instruction enclosed by entry and exit labels. In CRIL, basic blocks are executed concurrently in forward and backward directions, keeping causal safety and causal liveness as the fundamental correctness for reversibility. To optimize CRIL programs, we focus on bidirectional data flow among basic blocks. We propose data flow analysis among basic blocks to reveal data flow conflicts in both directions. The bidirectional data flow analysis enables the backward constant propagation in addition to the forward one. We define directed edges labeled variables among basic blocks for possible forward data flows and give directed edges for possible backward data flows using the edges of foward data flows. It is shown that the forward and backward data flow edges cover all the data flows in executing the program in either direction. Based on this soundness property, if a constant propagates by the data flow edges, then it propagates in all concurrent executions of both directions. We show bidirectional constant propagation in a CRIL example by the data flow analysis.