Skip to content

Conversation

@uenoku
Copy link
Member

@uenoku uenoku commented Jun 11, 2025

This patch converts CatPrimOp from a binary operation to a variadic operation that can accept multiple operands. The change is mostly mechanical:

This patch converts CatPrimOp from a binary operation to a variadic operation
that can accept multiple operands. The change is mostly straight forward:

- Redefining CatPrimOp in FIRRTLExpressions.td to accept variadic inputs
- Updating the fold method to handle multiple operands
- Modifying canonicalization patterns to work with the new variadic form
(https://mlir.llvm.org/docs/DeclarativeRewrites/#supporting-variadic-ops)
- Updating the FIRRTL to HW lowering to handle variadic concatenation
- Adjusting the FIREmitter to properly handle the new operation
- Updating the FIRRTL visitor to handle CatPrimOp separately
- Adding tests for the variadic concatenation operation

This change allows for more efficient representation of multi-operand
concatenations without needing to create a chain of binary operations.
@uenoku uenoku force-pushed the dev/hidetou/concat branch from 0022090 to 8fb7354 Compare June 11, 2025 03:04
@uenoku uenoku requested a review from seldridge June 11, 2025 22:59
@uenoku uenoku force-pushed the dev/hidetou/concat branch from 60a476e to c84dd0a Compare June 17, 2025 01:07
@uenoku uenoku merged commit 5658103 into main Jun 26, 2025
5 checks passed
@uenoku uenoku deleted the dev/hidetou/concat branch June 26, 2025 21:53
@uenoku uenoku restored the dev/hidetou/concat branch June 26, 2025 22:38
TaoBi22 pushed a commit to TaoBi22/circt that referenced this pull request Jul 17, 2025
This patch converts CatPrimOp from a binary operation to a variadic operation that can accept multiple operands. The change is mostly mechanical:
- Updating the fold method to handle multiple operands
- Modifying canonicalization patterns to work with the new variadic form (https://mlir.llvm.org/docs/DeclarativeRewrites/#supporting-variadic-ops)
- Updating the FIRRTL to HW lowering to handle variadic concatenation
- Adjusting the FIREmitter FIRRTLVistior
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants