This is an archive of the discontinued LLVM Phabricator instance.

[lld][WebAssembly] Use llvm-objdump to test __wasm_init_memory
ClosedPublic

Authored by tlively on Sep 13 2021, 5:43 PM.

Details

Summary

Rather than depending on the hex dump from obj2yaml. Now the test shows the
expected function body in a human readable format.

Diff Detail

Event Timeline

tlively created this revision.Sep 13 2021, 5:43 PM
tlively requested review of this revision.Sep 13 2021, 5:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 13 2021, 5:43 PM
sbc100 added inline comments.Sep 13 2021, 5:52 PM
lld/test/wasm/data-segments.ll
33

It looks like most of the tests in test/ELF use -d --no-show-raw-insn .. but I guess --no-leading-addr is good too. Maybe both ?

tlively updated this revision to Diff 372379.Sep 13 2021, 6:38 PM
  • Add --no-show-raw-insn
lld/test/wasm/data-segments.ll
33

Oh nice, I had missed that option. This is much better now.

sbc100 added inline comments.Sep 14 2021, 5:31 AM
lld/test/wasm/data-segments.ll
171

Kind of shame there are so many differences here between the PIC/no-PIC and 64/32-bit.

Do you think this more useful than just having completely separate blocks (with duplication)?

I wonder if you could do -DINT=i32 / -DINT=i64 to remove at least one level of splitting here?

227

We weren’t able to create the releas

sbc100 added inline comments.Sep 14 2021, 5:38 AM
lld/test/wasm/data-segments.ll
227

Oops, somehow this much have been in my paste buffer.. please ignore.

tlively updated this revision to Diff 372575.Sep 14 2021, 3:15 PM
  • Remove i32/i64 duplication
tlively added inline comments.Sep 14 2021, 3:16 PM
lld/test/wasm/data-segments.ll
171

I removed one level of splitting, as you suggested. Let me know if you think it looks reasonable, otherwise I can fully duplicate the function between PIC and non-PIC code as well.

sbc100 accepted this revision.Sep 14 2021, 3:31 PM

Nice. I wonder how much of the yaml output is still useful to include here?

This revision is now accepted and ready to land.Sep 14 2021, 3:31 PM

Nice. I wonder how much of the yaml output is still useful to include here?

It looks like llvm-objdump doesn't yet handle --disassemble-all (it seems to think all the different sections contain functions), so the YAML still seems good for making sure the rest of the file structure is correct.