llvm / llvm/circt

[StaticLogic] Consider removing `when` condition attribute

Open
#2,559 1 comment 1 reaction 0 assignees View on GitHub
StaticLogic
Dominant language
C++
Stars
2.2k
Forks
524
Avg merge
3d 2h
Merged PRs (30d)
46

Description

When this op was originally designed, we imagined we would supported predicated execution within pipelines using this `when` condition to mark when certain stages are enabled. However, after looking at actually scheduling programs with `if`s in them, @jopperm and I have handled this differently. The `if`s are scheduled such that the if and else branches execute concurrently in the same stage, and the next stage selects the appropriate value with `scf.if` in the next stage. This maintains the design principle that the staticlogic pipeline represents dataflow through stages explicitly, but control (i.e. concerns like stalling a specific stage) is implicit. I believe we should be able to remove the `when` condition, and update the round-trip tests according to the pattern described above. Nothing thus far has made use of the `when` condition.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the StaticLogic operation definition and its round-trip tests, locating the `when` condition and every test that serializes it. Remove the unused condition, update the tests to represent concurrent `if` and `else` stages with the next-stage `scf.if` selection, and run the affected round-trip tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.