Skip to content

Consider multi-width ops in IR or automatic strength-reduction in the optimizer #970

Open
@hongted

Description

Currently we primarily rely on the synthesis tool to optimize multi-width ops such as additions, multiplications, and comparators.

We should consider moving said optimizer earlier so our delay estimation can more accurately estimate the cost of a piece of code.

Consider the cost of a comparison

let x: u32 = <some computation>;
let y : u5 = <some computation>
let z = if x < y as u32 { u32:10 } else { u32:5 };

Our estimator will consider the cost of the comparsion as a 32-bit comparison (ie. u32 bit subtract). Rather than a a cheaper 5-bit subtract and a 27 bit or tree.

A wrinkle to this is that this may add to the work the synthesizer datapath optimizer will need to do -- we'll need to experiment with how much is done by XLS and how much is left to the backend tools.

Metadata

Assignees

No one assigned

    Labels

    delay modelPredicting/modeling delays of target (backend) processesdslxDSLX (domain specific language) implementation / front-endenhancementNew feature or requestoptimizerRelated to IR optimization or analysis

    Type

    No type

    Projects

    • Status

      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions