This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Always emit functype directives for defined functions
ClosedPublic

Authored by asb on Mar 21 2022, 7:00 AM.

Details

Summary

This addresses bug https://github.com/llvm/llvm-project/issues/54022. For now this means that defined functions will have two .functype directives emitted. Given discussion in that bug has suggested interest
in moving towards using something other than .functype to mark the beginning of a function (which would, as a side-effect, solve this issue), this patch doesn't attempt to avoid that duplication.

Some test cases that used CHECK-LABEL: foo rather than CHECK-LABEL: foo: are broken by this change. This patch updates those test cases to always have a colon at the end of the CHECK-LABEL string.

Diff Detail

Event Timeline

asb created this revision.Mar 21 2022, 7:00 AM
asb requested review of this revision.Mar 21 2022, 7:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 21 2022, 7:00 AM
asb updated this revision to Diff 416919.Mar 21 2022, 7:07 AM

Fix whitespace+comment issues in the functype-emission test case update.

asb edited the summary of this revision. (Show Details)Mar 21 2022, 7:09 AM
sbc100 added inline comments.Mar 21 2022, 8:38 AM
llvm/test/CodeGen/WebAssembly/byval.ll
24

Can you just change this to byval_arg: instead? (i.e. add a colon)

llvm/test/CodeGen/WebAssembly/cfg-stackify-eh.ll
21

Ditto.. i hope this isn't actually needed.

asb updated this revision to Diff 416975.Mar 21 2022, 8:58 AM
asb marked 2 inline comments as done.
asb edited the summary of this revision. (Show Details)

Update CHECK-LABEL lines by adding a colon at the end, rather than awkwardly skipping over functype declarations with CHECK: .section.

llvm/test/CodeGen/WebAssembly/byval.ll
24

That is a much better solution to the problem - thanks!

aardappel accepted this revision.Mar 21 2022, 10:24 AM

Nice.. not sure why at the time I thought this was sufficient to do for external decls only..

This revision is now accepted and ready to land.Mar 21 2022, 10:24 AM
sbc100 accepted this revision.Mar 21 2022, 4:11 PM
This revision was landed with ongoing or failed builds.Mar 22 2022, 2:25 AM
This revision was automatically updated to reflect the committed changes.