[Mips] R3000A size tuning: Os inlining threshold and tail merging #24

Merged
techwritescode merged 2 commits from r3000a-size-tuning into r5900-ee 2026-10-16 20:17:52 +00:00

Two R3000A-gated changes that reduce IOP code size without slowing any measured kernel.

  • Lower the -Os inlining threshold to the -Oz value when targeting the R3000A (MipsTTIImpl::adjustInliningThreshold).
  • Enable tail merging for the R3000A, with isLegalToSplitMBBAt refusing splits that strand a %lo user from its lui, and MipsSinkHi16 run in late machine optimization. Enabling a pipeline option is outside the fork's usual "gated edits only" rule; this is an exception justified by the size and decode-speed gain below.

Size over the 89 sdk-core IRXs (GCC 1,478,905 B):

build bytes vs GCC
#22+#23 1,594,156 +7.79%
this PR 1,526,350 +3.21%

Rig ticks (minimum over boots), #22+#23 vs this PR: crc 79375 / 79132, sort 153696 / 153696, decode 84630 / 81768, div 38650 / 38650, state 69029 / 69029, str 135796 / 135796, lba 96122 / 95952. Checksums match on every kernel.

Not covered: the Mips lit suite has not been re-run on this branch.

🤖 Generated with Claude Code

Two R3000A-gated changes that reduce IOP code size without slowing any measured kernel. - Lower the -Os inlining threshold to the -Oz value when targeting the R3000A (`MipsTTIImpl::adjustInliningThreshold`). - Enable tail merging for the R3000A, with `isLegalToSplitMBBAt` refusing splits that strand a `%lo` user from its `lui`, and `MipsSinkHi16` run in late machine optimization. Enabling a pipeline option is outside the fork's usual "gated edits only" rule; this is an exception justified by the size and decode-speed gain below. Size over the 89 sdk-core IRXs (GCC 1,478,905 B): | build | bytes | vs GCC | |---|---|---| | #22+#23 | 1,594,156 | +7.79% | | this PR | 1,526,350 | +3.21% | Rig ticks (minimum over boots), #22+#23 vs this PR: crc 79375 / 79132, sort 153696 / 153696, decode 84630 / 81768, div 38650 / 38650, state 69029 / 69029, str 135796 / 135796, lba 96122 / 95952. Checksums match on every kernel. Not covered: the Mips lit suite has not been re-run on this branch. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
[Mips] Enable tail merging for the R3000A without splitting HI16/LO16 pairs
Some checks failed
action.yml / [Mips] Enable tail merging for the R3000A without splitting HI16/LO16 pairs (push) Failing after 0s
release-binaries-all.yml / [Mips] Enable tail merging for the R3000A without splitting HI16/LO16 pairs (push) Failing after 0s
release-binaries.yml / [Mips] Enable tail merging for the R3000A without splitting HI16/LO16 pairs (push) Failing after 0s
release-documentation.yml / [Mips] Enable tail merging for the R3000A without splitting HI16/LO16 pairs (push) Failing after 0s
release-sources.yml / [Mips] Enable tail merging for the R3000A without splitting HI16/LO16 pairs (push) Failing after 0s
Check for private emails used in PRs / validate_email (pull_request) Has been skipped
action.yml / [Mips] Enable tail merging for the R3000A without splitting HI16/LO16 pairs (pull_request) Failing after 0s
Check LLVM ABI annotations / Check LLVM_ABI annotations with ids (pull_request) Has been skipped
CI Checks / Build and Test Linux (pull_request) Has been skipped
CI Checks / Build and Test Windows (pull_request) Has been skipped
CI Checks / Compute macOS Projects (pull_request) Has been skipped
CI Checks / Build and Test macOS arm64 (pull_request) Has been skipped
release-binaries-all.yml / [Mips] Enable tail merging for the R3000A without splitting HI16/LO16 pairs (pull_request) Failing after 0s
release-binaries.yml / [Mips] Enable tail merging for the R3000A without splitting HI16/LO16 pairs (pull_request) Failing after 0s
release-documentation.yml / [Mips] Enable tail merging for the R3000A without splitting HI16/LO16 pairs (pull_request) Failing after 0s
release-sources.yml / [Mips] Enable tail merging for the R3000A without splitting HI16/LO16 pairs (pull_request) Failing after 0s
Add buildbot information to first PRs from new contributors / buildbot_comment (pull_request_target) Has been skipped
Labelling new pull requests / greeter (pull_request_target) Has been cancelled
Labelling new pull requests / automate-prs-labels (pull_request_target) Has been cancelled
a820e0f0a5
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
techwritescode deleted branch r3000a-size-tuning 2026-10-16 20:17:54 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ps2/llvm!24
No description provided.