[all-commits] [llvm/llvm-project] 4690bf: [lld][WebAssembly] Take advantage of extended cons...

Sam Clegg via All-commits all-commits at lists.llvm.org
Tue Mar 15 17:50:42 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4690bf2ed31b06e8403a1e7790e9739becabd4f6
      https://github.com/llvm/llvm-project/commit/4690bf2ed31b06e8403a1e7790e9739becabd4f6
  Author: Sam Clegg <sbc at chromium.org>
  Date:   2022-03-15 (Tue, 15 Mar 2022)

  Changed paths:
    M lld/test/wasm/pie.ll
    M lld/test/wasm/tls-non-shared-memory.s
    M lld/wasm/Config.h
    M lld/wasm/OutputSections.cpp
    M lld/wasm/SyntheticSections.cpp
    M lld/wasm/SyntheticSections.h
    M lld/wasm/Writer.cpp

  Log Message:
  -----------
  [lld][WebAssembly] Take advantage of extended const expressions when available

In particular we use these in two places:

1. When building PIC code we no longer need to combine output segments
   into a single segment that can be initialized at `__memory_base`.
   Instead each segment can encode its offset from `__memory_base` in
   its initializer.  e.g.

```
(i32.add (global.get __memory_base) (i32.const offset)
```

2. When building PIC code we no longer need to relocation internalized
   global addresses.  We can just initialize them with their correct
   offsets.

Differential Revision: https://reviews.llvm.org/D121420




More information about the All-commits mailing list