Page MenuHomePhabricator

[WebAssembly] Allow multivalue signatures in object files
ClosedPublic

Authored by tlively on Thu, Oct 17, 9:22 PM.

Details

Summary

Also changes the wasm YAML format to reflect the possibility of having
multiple return types and to put the returns after the params for
consistency with the binary encoding.

Diff Detail

Event Timeline

tlively created this revision.Thu, Oct 17, 9:22 PM
aheejin accepted this revision.Fri, Oct 18, 5:22 AM
aheejin added inline comments.
llvm/test/CodeGen/WebAssembly/multivalue.ll
11

Unrelated question to this CL: Do we treat pair and packed pair in the same way?

This revision is now accepted and ready to land.Fri, Oct 18, 5:22 AM
sbc100 accepted this revision.Fri, Oct 18, 10:26 AM

Great!

llvm/lib/Object/WasmObjectFile.cpp
887

Do we want to error out somehow if the feature flags of the object file don't include multi-value?

tlively marked 2 inline comments as done.Fri, Oct 18, 10:48 AM
tlively added inline comments.
llvm/lib/Object/WasmObjectFile.cpp
887

That's an interesting idea! I don't think we have a precedent for that kind of validation in the object file parser. It would also be somewhat intrusive, since the target features section is one of the last sections to be parsed, so there would have to be a separate step at the end where feature invariants are checked. The invariants we could check in such a step would also be limited since individual instructions are not exposed in the object file abstraction.

llvm/test/CodeGen/WebAssembly/multivalue.ll
11

Hmm, I guess this isn't a great test because there wouldn't be any padding in this struct anyway, so in this case it literally is the same. I'm not sure what would happen with a packed struct that should contain padding. I'll add a better test in a follow up CL.

This revision was automatically updated to reflect the committed changes.