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

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 14 09:03:06 PDT 2022


sbc100 added a comment.

In D121420#3379513 <https://reviews.llvm.org/D121420#3379513>, @sbc100 wrote:

> In D121420#3379498 <https://reviews.llvm.org/D121420#3379498>, @dschuff wrote:
>
>> Would there still be an advantage to combining the segments? e.g. would the library load faster if there were only one?
>
> We already combine segments of the same type/prefix unless `--no-merge-data-segments` is passed... so in the normal case there are just a fixed number or possible output segments: `.data` `.bss` `.tdata` `.tbss`, plus any user-defined segments.    This later-phase combining was always just a stop gap to handler the lack of extended const expressions.  See the description of https://reviews.llvm.org/D96453 for why we delay the merging in this case.

Even if we decided that this second level combining was a good idea more generally that isn't really related to this PR and could be an option for all build (unrelated to PIC or sharedMemory, or extendedConst).  But i think keeping the high level sections separate by default probably makes sense, given how few there are in most programs.  Also, binaryen can always combine them if folks want to micro-optimize.


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