Skip to content

aco/ra: Refactor handling of register intervals

Tony Wasserka requested to merge neobrain/mesa:refactor_ra into master

This changeset unifies RA's handling of register windows with a new PhysRegInterval abstraction, along with an iterator type that allows for range-for iteration over all registers in an interval.


  • Make bounds checks more readable:
    • all intervals are uniformly half-open now
    • added helpers for common checks (e.g. containment: reg_lb >= lb && reg_lb < ub becomes win.contains(reg))
  • Reduce code complexity of iteration:
    • Use range-for for iterating over register windows
    • Reduce nested looping via iterators and <algorithm>s (see get_reg_simple)
  • Make code more strongly-typed:
    • The new version has about 27 fewer instances of PhysReg{...}, and fewer implicit PhysReg->unsigned conversions

Codegen is unchanged. I'll squash together patches into smaller chunks at a later point.

Edited by Tony Wasserka

Merge request reports