This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Don't duplicate functions in table output
ClosedPublic

Authored by ncw on Jan 24 2018, 6:15 AM.

Details

Summary

Previously, we were ensuring that the "output index" for InputFunctions was unique across all symbols that referenced a function body, but allowing the same function body to have multiple table indexes.

Now, we use the same mechanism for table indexes as we already do for output indexes, ensuring that each InputFunction is only placed in the table once.

This makes the LLD output table denser and smaller, but with identical behaviour.

Note that we still need the Symbol::TableIndex member, to store the table index for function Symbols that don't have an InputFunction, ie for address-taken imports.


Split out from D41955. Please merge after D42096 and before D41955, otherwise you'll have to update the tests to merge in another order.

Diff Detail

Repository
rL LLVM

Event Timeline

ncw created this revision.Jan 24 2018, 6:15 AM
sbc100 accepted this revision.Jan 24 2018, 11:50 AM
This revision is now accepted and ready to land.Jan 24 2018, 11:50 AM

Can you change the title something simpler like. e.g: "[WebAssembly] Don't duplicate functions in table output"?

ncw retitled this revision from [WebAssembly] Symbol changes #4f: Don't duplicate functions in LLD table output to [WebAssembly] Don't duplicate functions in table output.Jan 24 2018, 1:11 PM
ncw edited the summary of this revision. (Show Details)

No problem! I'd noticed your commit style was rather terser than mine, I'll adjust to it. I tend to err on the side of being rather verbose, to help distributed communication - apologies and thank you.

This revision was automatically updated to reflect the committed changes.