Skip to content

Refactor IPE initialization

Ben Gamari requested to merge wip/T22077 into master

Here we refactor the representation of info table provenance information in object code to significantly reduce its size and link-time impact. Specifically, we deduplicate strings and represent them as 32-bit offsets into a common string table.

In addition, we rework the registration logic to eliminate allocation from the registration path, which is run from a static initializer where things like allocation are technically undefined behavior (although it did previously seem to work, this was likely only be sheer luck). For similar reasons we eliminate lock usage from registration path, instead relying on atomic CAS.

After these changes the size of the object file for the nofib/shootout/n-body/Main.hs module shrinks from 228kbytes to 110kbytes when compiled with -O0 -finfo-table-map.

Closes #22077 (closed). Closes #22080 (closed).

Todo

  • separate the source file name from the source span, since the former can be shared across many IPE entries.
  • reintroduce eventlog support
Edited by Ben Gamari

Merge request reports