This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Set LoadExt and TruncStore actions for SIMD types
ClosedPublic

Authored by tlively on Oct 22 2018, 5:40 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

tlively created this revision.Oct 22 2018, 5:40 PM
aheejin added inline comments.Oct 24 2018, 4:30 PM
lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
177 ↗(On Diff #170540)

Real nit: Maybe we don't need 'any'

186 ↗(On Diff #170540)
  • What happens if T and MVT have different number of elements? (v16i8 vs. v64i2)
  • What happens if they have the same number of elements but the size of vectors are different? (v16i8 vs. v16i16)
  • What if both of these are true? (v16i8 vs. v64i16)
191 ↗(On Diff #170540)

Style nit: add {} to the outer for loops too in case an inner block has {} aleady?

tlively updated this revision to Diff 171024.Oct 24 2018, 4:42 PM
tlively marked 2 inline comments as done.
  • Address comments
tlively added inline comments.Oct 24 2018, 4:43 PM
lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
186 ↗(On Diff #170540)

I believe nothing changes if T and MVT have different numbers of elements. It should not be possible for a DAG to get into that state. Writing the code this way is just shorter than finding the minimum set of actions that need to be set.

The extending loads and truncating stores are for exactly the case when the in-memory vector has smaller lane sizes than the in-register vector. This code expands those cases to load or store the vectors one lane at a time. I believe it is not possible to have in-memory lanes that are larger than the in-register lanes.

aheejin accepted this revision.Oct 24 2018, 5:34 PM
This revision is now accepted and ready to land.Oct 24 2018, 5:34 PM
This revision was automatically updated to reflect the committed changes.