As suggested by Henri, the latest revision doesn't touch the SPIR-V generator, but removes dead code (or, rather, sets it to NOP, but that's enough) as a normalisation pass. Now my (admittedly simple) tests pass SPIR-V validation and the two relevant shader runner tests pass on macOS.