[PATCH] D56633: [WebAssembly] Optimize BUILD_VECTOR lowering for size
Heejin Ahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 26 16:54:43 PST 2019
aheejin added inline comments.
================
Comment at: test/CodeGen/WebAssembly/simd-build-vector.ll:116
+; CHECK-NEXT: .functype all_undef_i8x16 () -> (v128)
+; CHECK-NEXT: return $0
+define <16 x i8> @all_undef_i8x16() {
----------------
aheejin wrote:
> Looking at the code above, I wonder how we ended up with a `local.get` from an unassigned local here for all undef case. Actually it works beautifully, given that unassigned locals are zero-initialized by default and it is even less space than `splat 0`. Maybe this can be an optimization in which we try to replace all `v128.const 0, ..., 0` and `splat 0` with `local.get n` where n being an assigned local. Just a thought and not relevant to this CL.
Hmm, it seems ExplicitLocals pass turns all unstackified registers to locals in which undefined registers become `local.get` from unassigned locals. And I don't think the current SIMD backend would prefer `v128.const 0, ..., 0` over `splat 0` anyway, right? So sorry, nevermind. :)
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56633/new/
https://reviews.llvm.org/D56633
More information about the llvm-commits
mailing list