OSDN Git Service

[WebAssembly] Avoid scalarizing vector shifts in more cases
authorThomas Lively <tlively@google.com>
Tue, 7 Jul 2020 17:45:26 +0000 (10:45 -0700)
committerThomas Lively <tlively@google.com>
Tue, 7 Jul 2020 17:45:26 +0000 (10:45 -0700)
commit0d7286a652371bca460357348f3b4828cd4ca214
treed9624dd45d409c6d8b413a92d4e9a2c84845d5ea
parent83158cf95dd7fd9fa8a1eb515f16bf47856601ef
[WebAssembly] Avoid scalarizing vector shifts in more cases

Since WebAssembly's vector shift instructions take a scalar shift
amount rather than a vector shift amount, we have to check in ISel
that the vector shift amount is a splat. Previously, we were checking
explicitly for splat BUILD_VECTOR nodes, but this change uses the
standard utilities for detecting splat values that can handle more
complex splat patterns. Since the C++ ISel lowering is now more
general than the ISel patterns, this change also simplifies shift
lowering by using the C++ lowering for all SIMD shifts rather than
mixing C++ and normal pattern-based lowering.

This change improves ISel for shifts to the point that the
simd-shift-unroll.ll regression test no longer tests the code path it
was originally meant to test. The bug corresponding to that regression
test is no longer reproducible with its original reported reproducer,
so rather than try to fix the regression test, this change just
removes it.

Differential Revision: https://reviews.llvm.org/D83278
llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
llvm/test/CodeGen/WebAssembly/simd-shift-complex-splats.ll [new file with mode: 0644]
llvm/test/CodeGen/WebAssembly/simd-shift-unroll.ll [deleted file]