[PATCH] D43966: [WebAssembly] Simplify COMDAT handling.

Nicholas Wilson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 1 14:08:56 PST 2018


ncw accepted this revision.
ncw added a comment.
This revision is now accepted and ready to land.

In my queue of about ~20 patches still to submit, I have got one similar to this! In fact it was discussed a while back in some comments on another issue; I've just built up a big backlog while the symbol table stuff was being worked on.

It's actually possible to optimise it even more; my patch involves editing the BinaryFormat/Wasm.h structures to go from `struct Function { ... StringRef Comdat }` to `struct Function { int Comdat; }`.

Then change the loop to `for (Comdat : File->Comdats()) { if (add(Comdat)) markComdatIndex(Comdat); }`. Then, you only do a hashtable lookup once per Comdat, rather than (in your case) once per symbol, which should be a bit of a saving for a typical inline function comdat that might have some strings or other data in the comdat as well.

I'm happy for this to go in, it's in the right direction I think.


https://reviews.llvm.org/D43966





More information about the llvm-commits mailing list