This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Avoid scalarizing vector shifts in more cases
ClosedPublic

Authored by tlively on Jul 6 2020, 10:44 PM.

Details

Summary

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.

Diff Detail

Event Timeline

tlively created this revision.Jul 6 2020, 10:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2020, 10:44 PM
dschuff accepted this revision.Jul 7 2020, 10:32 AM

This is a nice simplification.

This revision is now accepted and ready to land.Jul 7 2020, 10:32 AM
This revision was automatically updated to reflect the committed changes.
llvm/test/CodeGen/WebAssembly/simd-shift-complex-splats.ll