Skip to content

Timeout due to infinite optimization loop between Strength Reduction and Array Simplification Pass (crasher_2026-07-04_500f) #4545

Description

@NL02

Summary

The crasher causes opt_main to time out after 1500 seconds due to an infinite optimization loop between Strength Reduction (strength_reduction_pass.cc) and Array Simplification (array_simplification_pass.cc).

Root Cause

  1. Strength Reduction (SinkSingleUserSelect in strength_reduction_pass.cc) sees array_update(array_literal, sel_val, indices=[sel_val]) where sel_val's cases are known constants and the array is constant. It sinks array_update into sel_val, creating sel(cases=[array_update(const0), array_update(const1)]).
  2. Array Simplification (array_simplification_pass.cc) detects a select whose cases are all array_update on the same array/index and hoists the select back out, producing array_update(sel(...)).
  3. The two passes endlessly undo each other in a loop until timeout.

Reproduction Steps

Run opt_main on the unoptimized converted IR from crasher_2026-07-04_500fx:

Minimized IR Reproduction

package test_package
top fn main(s: bits[1]) -> bits[8][2] {
  a: bits[8][2] = literal(value=[1, 2])
  c0: bits[8] = literal(value=0)
  c1: bits[8] = literal(value=1)
  sel_val: bits[8] = sel(s, cases=[c0, c1])
  ret array_update.1: bits[8][2] = array_update(a, sel_val, indices=[sel_val])
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working or is incorrectfuzz

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions