This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Support select and block for reference types
ClosedPublic

Authored by aheejin on Nov 30 2020, 5:54 PM.

Details

Summary

This adds missing select instruction support and block return type
support for reference types. Also refactors WebAssemblyInstrRef.td and
rearranges tests in reference-types.s. Tests don't include exnref
types, because we currently don't support exnref for ref.null and
the type will be removed soon anyway.

Diff Detail

Event Timeline

aheejin created this revision.Nov 30 2020, 5:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 30 2020, 5:54 PM
aheejin requested review of this revision.Nov 30 2020, 5:54 PM
aheejin updated this revision to Diff 308513.Nov 30 2020, 6:27 PM

Add missing reference types in utility functions

aheejin updated this revision to Diff 308514.Nov 30 2020, 6:28 PM

Fix a typo

sbc100 added inline comments.Nov 30 2020, 7:46 PM
llvm/test/MC/WebAssembly/reference-types.s
8

Isn't it useful to continue to test externref and funcref as function return types? Or is that tested elsewhere?

aheejin added inline comments.Nov 30 2020, 8:09 PM
llvm/test/MC/WebAssembly/reference-types.s
8

llvm-mc cannot check the correctness of that. We can put any signature here and the test will pass anyway.

sbc100 added inline comments.Nov 30 2020, 8:31 PM
llvm/test/MC/WebAssembly/reference-types.s
8

But it must be at least checked for valid type?

You can write (foo) -> (bar) can you? It might be good to check that these types are accepted in this position?

tlively accepted this revision.Nov 30 2020, 8:40 PM
This revision is now accepted and ready to land.Nov 30 2020, 8:40 PM
aheejin updated this revision to Diff 308539.Nov 30 2020, 9:59 PM

Add tests to test reference types in params and results

This comment was removed by aheejin.
aheejin updated this revision to Diff 308546.Nov 30 2020, 10:34 PM

Fix signature

aheejin updated this revision to Diff 308549.Nov 30 2020, 11:09 PM

Add missing COPY opcode handling in Peephole

aheejin marked 2 inline comments as done.Nov 30 2020, 11:16 PM
aheejin added inline comments.
llvm/test/MC/WebAssembly/reference-types.s
8

I added two more tests to test reference type signatures.

wingo added inline comments.Dec 1 2020, 12:18 AM
llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
343

See also https://reviews.llvm.org/D92323, which contains this. Happy for this to land though!

sbc100 accepted this revision.Dec 1 2020, 1:04 AM
This revision was automatically updated to reflect the committed changes.
aheejin marked an inline comment as done.