This is an archive of the discontinued LLVM Phabricator instance.

[clang][Webassembly] Implement builtins for tables
AbandonedPublic

Authored by asb on Apr 21 2022, 5:45 AM.

Details

Summary

Implements table.size, table.grow, table.fill and table.copy.

table.init and elem.drop are intentionally not implemented because they require manipulation of element segments, which aren't directly exposed in the current WebAssembly Clang/LLVM toolchain.

This is ready for a first-pass review, though will need an update for coverage of funcref tables once D122215 funcrefs are finalised.

Diff Detail

Event Timeline

asb created this revision.Apr 21 2022, 5:45 AM
asb requested review of this revision.Apr 21 2022, 5:45 AM
sbc100 added inline comments.Apr 21 2022, 10:11 AM
clang/include/clang/AST/Type.h
1912

Can you explain the distinction here? Maybe a comment would be good?

asb added inline comments.Apr 21 2022, 10:51 AM
clang/include/clang/AST/Type.h
1912

Sorry for the confusion - this particular change makes less sense in the absence of funcref support. We need to differentiate between extenref and funcref types in order to choose the appropriate intrinsic for those which are type-dependent (table.grow and table.fill). I'll revisit documentation comments etc when adding in funcref support.

asb updated this revision to Diff 424472.Apr 22 2022, 7:28 AM

Rebase.

asb updated this revision to Diff 429720.May 16 2022, 8:09 AM

Rebase and fix missing CHECK lines for table copy.

asb updated this revision to Diff 446071.Jul 20 2022, 1:18 AM

Rebase (partial - rebases my patch stack on top of latest LLVM, but still needs a rebase on to Paulo's patch introducing funcref support).

asb updated this revision to Diff 446165.Jul 20 2022, 8:13 AM

Rebase.

asb updated this revision to Diff 446501.Jul 21 2022, 7:48 AM

Rebase again.

@asb This can be closed since table support landed.

asb abandoned this revision.Jun 22 2023, 6:44 AM

Abandoning as this was superseded by @pmatos' patch that incorported this and other work.