google / google/xls

[enhancement] User-specified `dead_if(predicate)` akin to `assume(predicate)` to enable clock gating

Open
#1,360 1 comment 0 reactions 0 assignees View on GitHub
codegen enhancement optimizer scheduler
Dominant language
C++
Stars
1.9k
Forks
283
Avg merge
2d 12h
Merged PRs (30d)
130

Description

### What's hard to do? (limit 100 words)

Related to #542 -- similar to an "assume(p)" which would conceptually forward-propagate the truth of predicate `p` for subsequent optimization, for clock gating purposes we may want to add something like a "dead_if(p, value)" so you could mark that output values could be clock gated off under certain conditions `p`. Notably this is a semantic change, not a hint. The benefit would be that liveness analysis could reverse-flow to clock gate out all dependent operations under that predicate.

### Current best alternative workaround (limit 100 words)

Right now the value is just always assumed live under all conditions (aside from explicit valid bit specification to XLS causing clock gating).

### Your view of the "best case XLS enhancement" (limit 100 words)

Users can specify dead_if predicates, and ideally it could be orthogonal to the functional block (instead of /having/ to be inline), and that would cause the complete frontier of possible clock gating under that predicate to occur.

Contributor guide

Open the contributing guide

Research direction

No file, test, or entry point is identified. Start by reading related issue #542 and locating XLS's liveness-analysis and clock-gating implementation; completion would require a settled design and tests demonstrating user-specified semantic dead_if predicates propagate to dependent clock gating.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.