Replaces {kv -> expr(kv) | kv < ub}[jv] with expr(jv).
Four tests still fail.
test-emr.sac gives the correct output, but the optimised code looks different so this is probably a problem in the test itself.
For test-type-pattern-matmul and test-wlur-modarray the DBUG_ASSERT on jv_avis fails
For test-fold-accu-mmv there is a type error on an array