Asama 6.3 — Implement Null/Type Check Elimination #54

Open
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.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
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: saqut/saqut-compiler#54
No description provided.