[Strings] Add a string-builtins feature, and lift/lower automatically when enabled
This makes string optimizations happen automatically when
--enable-string-builtins (or -all).
The lifting/lowering happen globally, at optimal times in the
pipeline, so even -O3 -O3 -O3 will only lift once and lower once,
avoiding overhead as in #7540 which this replaces.
TODO: document in optimizer cookbook
Hmm, this PR fails many tests because of these TODOs for typed continuations:
https://github.com/WebAssembly/binaryen/blob/f8531ef56e61cb68815c835b294777fbd97f3b0a/src/ir/subtype-exprs.h#L415-L423
This problem becomes noticeable in this PR because we have tests that use -all on continuations code, and now we run StringLowering, which uses SubtypingDiscoverer, so we try to operate on those instructions.
So this PR is blocked on those TODOs.
I can take a look at those TODOs later today, unless you plan on working on them first.
Thanks, I don't think I'd have time today myself.