Skip to content

LATX: remove overwritten intermediate 32-bit zero extensions - #455

Draft
luzeng87 wants to merge 1 commit into
lat-opensource:masterfrom
luzeng87:ir2-intermediate-zext32
Draft

LATX: remove overwritten intermediate 32-bit zero extensions#455
luzeng87 wants to merge 1 commit into
lat-opensource:masterfrom
luzeng87:ir2-intermediate-zext32

Conversation

@luzeng87

@luzeng87 luzeng87 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • identify self zero-extension sequences generated for 32-bit x86 results
  • remove an intermediate extension when only low-32-bit read-modify-write operations follow and a later extension overwrites it
  • stop at branches, labels, memory operations, faults, or any wide use of the register

Validation

  • clean 3A6000 build: passed
  • chained 32-bit arithmetic with a final 64-bit architectural-state check: passed
  • JIT, cold AOT, and hot AOT: passed with a non-empty AOT file
  • git diff --check: passed

Signed-off-by: Lu Zeng <luzeng87@gmail.com>
@luzeng87

luzeng87 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

This optimizer crosses LISA_X86_INST markers while temporarily leaving an architectural 32-bit result with stale upper bits. An asynchronous guest signal may materialize register state at such an instruction boundary. Without signal-aware state reconstruction or a proof that the transformation stays inside one guest instruction, this is a correctness risk. Closing it for redesign.

@luzeng87 luzeng87 closed this Sep 3, 2026
@luzeng87 luzeng87 reopened this Sep 3, 2026
@luzeng87
luzeng87 marked this pull request as draft September 3, 2026 03:10
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