This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Add prototype relaxed swizzle instructions
ClosedPublic

Authored by ngzhian on Oct 18 2021, 10:52 AM.

Details

Summary

Add i8x16 relaxed_swizzle instructions. These are only
exposed as builtins, and require user opt-in.

Diff Detail

Event Timeline

ngzhian created this revision.Oct 18 2021, 10:52 AM
ngzhian requested review of this revision.Oct 18 2021, 10:52 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 18 2021, 10:52 AM
ngzhian added inline comments.Oct 18 2021, 10:53 AM
llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
1365

@tlively i'm not 100% sure if this is needed or the right thing to do, i looked at what i8x16.swizzle currently does and just replaced the name and opcode. LMK if this needs to be changed.

ngzhian updated this revision to Diff 380542.Oct 18 2021, 4:16 PM

Add title for relaxed swizzle instruction

ngzhian updated this revision to Diff 380779.Oct 19 2021, 2:27 PM

Wrong commits

tlively added inline comments.Oct 19 2021, 2:42 PM
llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
1365

HANDLE_NODETYPE(RELAXED_SWIZZLE)

and

def wasm_relaxed_swizzle : SDNode<"WebAssemblyISD::RELAXED_SWIZZLE", wasm_swizzle_t>;

Are both necessary when we do more interesting codegen optimizations from the C++, but in this case we want to just directly select the intrinsic, so they aren't necessary. For the pattern inside the definition of RELAXED_SWIZZLE below, you can just use int_wasm_relaxed_swizzle rather than defining and using the separate wasm_relaxed_swizzle. That will let you get rid of the separate Pat below as well.

ngzhian updated this revision to Diff 380783.Oct 19 2021, 3:02 PM
  • Remove RELAXED_SWIZZLE sdnode
tlively accepted this revision.Oct 19 2021, 5:39 PM

Thanks! I'll go ahead and land this.

This revision is now accepted and ready to land.Oct 19 2021, 5:39 PM
This revision was automatically updated to reflect the committed changes.