This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Serialize params/results in MachineFunctionInfo
ClosedPublic

Authored by aheejin on Apr 22 2021, 1:38 AM.

Details

Summary

This adds support for YAML serialization of Params and Results
fields in WebAssemblyMachineFunctionInfo. Types are printed as MVT's
string representation. This is for writing MIR tests easier.

The tests added are testing simple parsing and printing of params /
results fields under machineFunctionInfo.

Diff Detail

Event Timeline

aheejin created this revision.Apr 22 2021, 1:38 AM
aheejin requested review of this revision.Apr 22 2021, 1:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 22 2021, 1:38 AM
tlively added inline comments.Apr 22 2021, 10:27 AM
llvm/test/CodeGen/WebAssembly/function-info.mir
109

Does MIR use MVTs for its types? I thought it would be using WebAssembly register classes instead. If it uses register classes, then these would all be represented by V128.

aheejin added inline comments.Apr 22 2021, 12:03 PM
llvm/test/CodeGen/WebAssembly/function-info.mir
109

WebAssemblyMachineFunctionInfo uses them: https://github.com/llvm/llvm-project/blob/007158ac42c785cd59aab8bc4b4b39085b960a58/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h#L36-L37

So it's not an MIR thing, but how we store the info. Come to think of it, I'm not sure if there is any compelling reason we should store them as MVTs though. We just happen to do that in ISelLowering.

tlively accepted this revision.Apr 22 2021, 12:26 PM

Thanks for the context links! This LGTM 👍

This revision is now accepted and ready to land.Apr 22 2021, 12:26 PM
This revision was landed with ongoing or failed builds.Apr 22 2021, 3:31 PM
This revision was automatically updated to reflect the committed changes.