This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Implement truncating vector stores
ClosedPublic

Authored by tlively on Jul 22 2020, 6:20 PM.

Details

Summary

Rather than expanding truncating stores so that vectors are stored one
lane at a time, lower them to a sequence of instructions using
narrowing operations instead, when possible. Since the narrowing
operations have saturating semantics, but truncating stores require
truncation, mask the stored value to manually truncate it before
narrowing. Also, since narrowing is a binary operation, pass in the
original vector as the unused second argument.

Diff Detail

Event Timeline

tlively created this revision.Jul 22 2020, 6:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 22 2020, 6:20 PM
srj added a subscriber: srj.Jul 23 2020, 10:35 AM
tlively updated this revision to Diff 280279.Jul 23 2020, 3:52 PM
  • Improve codegen: use faster i32x4.splats and reuse the existing vector as the second narrowing argument
tlively edited the summary of this revision. (Show Details)Jul 23 2020, 9:13 PM
aheejin accepted this revision.Jul 24 2020, 12:56 AM

It looks like very smart transformation!

llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
939

This is dummy and not actually used, right? I think adding comment on this dummy would make reading a little easier.

This revision is now accepted and ready to land.Jul 24 2020, 12:56 AM
This revision was landed with ongoing or failed builds.Jul 28 2020, 5:46 PM
This revision was automatically updated to reflect the committed changes.