nir: add divergence analysis pass.