Skip to content

Reuse third-stage objects in release LowIR libraries - #173

Merged
vishvananda merged 1 commit into
mainfrom
perf/reuse-release-library-objects
Nov 16, 2026
Merged

vishvananda merged 1 commit into
mainfrom
perf/reuse-release-library-objects

Conversation

@vishvananda

Copy link
Copy Markdown
Owner

Release builds currently compile 175 common source files again for the LowIR library after compiling them in both self-host stages. Build those stages with the library's PIC, threading and visibility flags, then reuse the third-stage shared objects for both library variants. Only the six C API modules and the library boundary need another compilation: 182 library compilations become seven.

Use a separate obj/release/pic object root to avoid reusing older objects built without these flags. The reused objects were compiled by cppgm-self, preserving the library's release provenance. Normal library builds retain their independent objects, and second-stage/third-stage comparison still runs for all nine tools.

Validation:

  • Focused release package and source harness: seven tests passed. The new test links and runs static/shared libraries, checks object reuse and ordinary builds, verifies relinking across object roots, and rejects missing reused objects.
  • Actual library build plan: 175 reused objects and seven compilations, versus 182 without reuse.
  • Student export Makefile/library-rule smoke check passed.
  • Shell syntax and git diff --check passed.

The Release workflow will perform the full Linux and macOS package builds for this PR.

@vishvananda
vishvananda merged commit c504092 into main Nov 16, 2026
63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant