[PATCH] D56633: [WebAssembly] Optimize BUILD_VECTOR lowering for size

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 29 17:24:59 PST 2019


aheejin added a comment.

> I assume (for a lack of better information) that all dynamic values are already on the stack, but all constants need to be materialized immediately before they are used. That means that for constant replace_lanes I count the replace_lane instruction and also the constant lane value.

I guess for dynamic splats and consts we should add bytes for opcode for `local.get` and local number immediate? Because whatever that value is, most likely that value would not be on the top of the stack. For example, for dynamic `replace_lane`s, no matter what register contains the dynamic value, we start the code sequence with `splat` for `v128.const`, and by the time we need `replace_lane`, not the dynamic value but the result of `v128.const` or `splat` will be on the top of the stack. Also when you begin the sequence with a `splat` with dynamic value, that value might be on top of the stack, but more likely it's not.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56633/new/

https://reviews.llvm.org/D56633





More information about the llvm-commits mailing list