ir
ir copied to clipboard
Implement e-SSA PI nodes
This implements e-SSA PI constraint nodes, without range propagation.
This uses the folding engine to replace comparison ops into constants when possible, and in turn the SCCP engine can elide IF/SWITCH/GUARD. I only implemented folding for EQ
right now, but I will add other ops. I also did not add support for symbolic ranges.
PI node signature has the form PI(def, RANGE(min, max))
(op2 is a RANGE op). It should be possible to change this to PI(def, min, max)
, but the folding engine supports only two operands currently.
PI nodes must be added manually, like PHI nodes. They are replaced by COPY ops after SCCP so that other passes do not have to be aware of them.