Theoretically, yes. Practically, I think that’s a “sufficiently smart compiler” class of problems, insanely hard to solve. Especially given that WASM is a JIT compiler, it simply doesn’t have time for expensive optimizations.
Integer SIMD is weird on AMD64. Even state of the art C++ compilers fail to emit optimal code for rather simple use cases. A trivial example is computing sum of bytes: I’m yet to see a compiler which would optimize that code into _mm[256]_sad_epu8 / _mm[256]_add_epi64 instructions.