[PATCH] D140111: [lld][wasm] Split __wasm_apply_data_relocs when it exceeds the function size limit

Illia Malachyn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 20 06:25:16 PST 2022


k1nder10 added inline comments.


================
Comment at: lld/wasm/Driver.cpp:767
+
+    WasmSym::applyDataRelocsTail = symtab->addSyntheticFunction(
+        "__wasm_apply_data_relocs_tail",
----------------
sbc100 wrote:
> k1nder10 wrote:
> > I tried to move the creation of this function to Writer.cpp 1349 under 'else' statement, so that we don't have any changes in out .wasm files
> > unless we exceed the function size limit. However, I got some strange runtime errors. 
> > 
> > So, for now, we will have this function created even If we don't hit the limit (it just will be empty). Is it okay?
> I'd rather only emit the new function if needed.  
> 
> Also, it seems like we should splitting into N possible sub-functions, not just 1, otherwise we just push the problem down the road a little.
Speaking of splitting this into N functions, it looks unnecessary as it must be enough to have 2 functions actually.
We have a more than million lines of code and a plethora of class hierarchies and we exceed the limit only by 200k instructions. So, there's a big stock (>7 million) of instructions to hit the limit again.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140111/new/

https://reviews.llvm.org/D140111



More information about the llvm-commits mailing list