[PATCH] D121420: [lld][WebAssembly] Take advantage of extended const expression when available

Derek Schuff via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 15 17:28:28 PDT 2022


dschuff accepted this revision.
dschuff added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lld/test/wasm/pie.ll:119
+; EXTENDED-CONST-NEXT:          Extended:        true
+; EXTENDED-CONST-NEXT:          Body:            230141046A0B
+; EXTENDED-CONST-NEXT:      - Index:           6
----------------
maybe write what instructions these encoding correspond to?


================
Comment at: lld/wasm/Writer.cpp:930
   // combines all data segments into a single .data segment.
-  // This restructions can be relaxed once we have extended constant
-  // expressions available:
-  // https://github.com/WebAssembly/extended-const
+  // This restruction does not apply when the extended const extension is
+  // available: https://github.com/WebAssembly/extended-const
----------------



================
Comment at: lld/wasm/Writer.cpp:1567
+  // When outputing PIC code each segment lives at at fixes offset from the
+  // `__memory_base` import.  Unless we support the extended const epression we
+  // can't do addition inside the constant expression, so we much combine the
----------------



================
Comment at: lld/wasm/Writer.cpp:1569
+  // can't do addition inside the constant expression, so we much combine the
+  // segment into a single one that can live at `__memory_base`.
+  if (config->isPic && !config->extendedConst && !config->sharedMemory) {
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121420



More information about the llvm-commits mailing list