[PATCH] D46416: [WebAssembly] Optionally compress relocation sites in the code section

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 18 15:22:02 PDT 2018


ruiu added a comment.

I'm sorry, I missed your ping.



================
Comment at: wasm/Driver.cpp:292
   Config->ImportTable = Args.hasArg(OPT_import_table);
+  Config->Optimize = args::getInteger(Args, OPT_O, 1);
   Config->OutputFile = Args.getLastArgValue(OPT_o);
----------------
I think 0 should be default. For example, if you don't pass -O to gcc or clang, they emit a non-optimized code.


================
Comment at: wasm/InputChunks.cpp:184
+// witten.
+static unsigned writeCompressedReloc(const WasmRelocation &Rel, uint8_t *Buf,
+                                     uint32_t Value) {
----------------
When a buffer is given, it is usually the first argument. It is better to follow the convention for readability.


================
Comment at: wasm/InputChunks.cpp:232
+// relocation.  At best we end up saving 4 bytes for each relocation entry.
+void InputFunction::calculateSize() {
+  if (!File || !Config->CompressRelocTargets)
----------------
Can you also mention that this function only computes the length of the compressed section and doesn't actually write anything?


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D46416





More information about the llvm-commits mailing list