llvm / llvm/circt

[SV] Sink `IndexedPartSelectOp` to comb and rename Inout version

Open
#2,181 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.2k
Forks
524
Avg merge
3d 2h
Merged PRs (30d)
46

Description

Please sink `IndexedPartSelectOp` down to the comb dialect, and rename it to `SliceOp` (put it right after ExtractOp since they are siblings).

The inout version should stay in SV but be named `SliceInOutOp` to align with the above.

I also believe both should drop the "decrement" attribute. Rationale:
- There is no expressive capability in the IR that this adds, it is just syntactic.
- This makes it more difficult to analyze and transform the IR, because passes will have to handle two forms of the same thing.
- There is no client for this that exists.
- It is unproven that a future verilog parser will want to use the SV dialect at all. Such a parser will probably want to maintain sugar and many other things that the SV dialect doesn't. For example, these ops store the size as a constant, but in parsed verilog it can be an expression.

If there is a client and this is the right thing to add, we can add it back later when we understand the constraints better.

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate the definitions and uses of IndexedPartSelectOp and its inout variant, then trace the comb and SV dialect organization around ExtractOp. Confirm the required moves and renames, remove the decrement attribute from both operations, and update affected references so the project builds and its existing tests pass.

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
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.