They were only correct in the simplest case. Some of the optimisations are certainly possible but should be introduced carefully and only when the whole pattern codegen infrastructure is in a better shape. Fixes #16648.