Optimize zero-splats inside of loops in SkVMCodeGenerator.

Previously, we had various loops which would synthesize a `splat(0)`
instruction on every iteration of the loop. This was harmless and was
already deduplicated by SkVM internally, but in a long loop, this
deduplication process could occur many many times in a row. This hurts
performance needlessly. In particular, for-loops can run for thousands
of iterations in a row, so the savings here can be substantial.

This was inspired by investigation into oss-fuzz:37837.

Change-Id: I247d9ec397418a65219930e2f2b8cf977354bddd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448837
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
1 file changed