Skip to content

Eliminate proven array bounds checks - #4

Merged
FuryBaM merged 3 commits into
masterfrom
agent/eliminate-proven-array-bounds
Jul 20, 2026
Merged

Eliminate proven array bounds checks#4
FuryBaM merged 3 commits into
masterfrom
agent/eliminate-proven-array-bounds

Conversation

@FuryBaM

@FuryBaM FuryBaM commented Jul 20, 2026

Copy link
Copy Markdown
Owner

What changed

Adds a conservative LLVM pass after the existing -O3 pipeline. The pass recognizes Absolute's generated array.bounds.failure edges and removes a conditional branch only when LLVM proves that execution must take the success edge at that exact instruction.

Proofs use both:

  • LazyValueInfo for path-local constant and comparison facts;
  • ScalarEvolution for induction variables and loop relations such as position + 1 < index < size.

After a successful proof, SimplifyCFG and DCE remove the unreachable failure block and dead comparisons.

Safety

  • Frontend-generated runtime bounds checks are unchanged.
  • Unknown conditions are left untouched.
  • A candidate failure block must have the generated array.bounds.failure prefix and terminate with unreachable.
  • Only branches with exactly one failure successor are candidates.
  • LLVM verifies the complete optimized module before object emission.

Validation status

The source change is isolated to Absolute-CodeGen/src/codegen.cpp. GitHub Actions currently rejects all Windows and Ubuntu jobs before the first workflow step (steps: null), so compilation, checksum validation, and benchmark comparison are pending runner availability rather than reporting a compiler/test failure.

@FuryBaM FuryBaM closed this Jul 20, 2026
@FuryBaM
FuryBaM force-pushed the agent/eliminate-proven-array-bounds branch from e8ca1c8 to 688bd5c Compare July 20, 2026 11:09
@FuryBaM FuryBaM reopened this Jul 20, 2026
@FuryBaM
FuryBaM marked this pull request as ready for review July 20, 2026 13:55
@FuryBaM
FuryBaM merged commit db76bd4 into master Jul 20, 2026
0 of 17 checks passed
@FuryBaM
FuryBaM deleted the agent/eliminate-proven-array-bounds branch July 25, 2026 04:53
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