Asama 6.3 — Implement Null/Type Check Elimination #54

Closed
opened 2026-05-26 19:52:48 +03:00 by saqut · 0 comments
Owner

Goal: Remove redundant null checks and type checks when provably unnecessary.

Files to create:

  • src/opt/null_check_elim.hpp (new)
  • src/opt/type_check_elim.hpp (new)

Requirements:

  • Track which variables have been checked for null in current path.
  • If variable already null-checked (and not reassigned), skip subsequent checks.
  • Similarly for type checks.

Success criteria:

  • Two consecutive if (x != null) -> second removed.
  • if (x is int) { if (x is int) } -> inner check removed.
**Goal:** Remove redundant null checks and type checks when provably unnecessary. **Files to create:** - src/opt/null_check_elim.hpp (new) - src/opt/type_check_elim.hpp (new) **Requirements:** - Track which variables have been checked for null in current path. - If variable already null-checked (and not reassigned), skip subsequent checks. - Similarly for type checks. **Success criteria:** - Two consecutive if (x != null) -> second removed. - if (x is int) { if (x is int) } -> inner check removed.
saqut closed this issue 2026-06-14 21:53:18 +03:00
Sign in to join this conversation.
No description provided.