|
This PR adds a validator based on dataflow analysis to ZJIT. It checks that all uses are dominated by a GEN-DEF prior.
See issue https://github.com/Shopify/ruby/issues/591
This is especially useful in validating optimizations don't zap away instructions that are actually needed, e.g. DCE.
Also included: a slight refactor of the DCE code to its own function, so I can reuse it.
Note: the algorithm uses the worklist algorithm rather than the iterative version for faster convergence.
Co-Authored-By: Max Bernstein <ruby@bernsteinbear.com>
|