[FIRRTL][OM] Add {firrtl,om}.string.concat#9986
Merged
Conversation
Add a new `firrtl.string.concat` operation to the FIRRTL dialect for concatenating two string property values. AI-assisted-by: Augment (Sonnet 4.5) Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
8792217 to
0a58bfd
Compare
Add support for `string_concat` parsing and emission. AI-assisted-by: Augment (Claude Sonnet 4.5) Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
Add a new `string.concat` operation to the OM dialect. This operation concatenates two string values. AI-assisted-by: Augment (Sonnet 4.5) Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
Add a conversion pattern to lower FIRRTL `StringConcatOp` to OM `StringConcatOp` in the LowerClasses pass. AI-assisted-by: Augment (Sonnet 4.5) Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
0a58bfd to
7a6a324
Compare
fabianschuiki
approved these changes
Mar 20, 2026
Comment on lines
+189
to
+194
| %0 = om.constant "Hello, " : !om.string | ||
| %1 = om.constant "World" : !om.string | ||
| %2 = om.constant "!" : !om.string | ||
|
|
||
| // CHECK: om.string.concat %0, %1, %2 : !om.string | ||
| %3 = om.string.concat %0, %1, %2 : !om.string |
Contributor
There was a problem hiding this comment.
This makes me wonder if we'll want some constant folding for these ops at a later point 🤔
Contributor
There was a problem hiding this comment.
Yeah we've done some for the arithmetic ops!
Member
Author
There was a problem hiding this comment.
I have been thinking the same thing. I can add this in a follow-up.
uenoku
reviewed
Mar 20, 2026
uenoku
reviewed
Mar 20, 2026
mikeurbach
approved these changes
Mar 20, 2026
Contributor
mikeurbach
left a comment
There was a problem hiding this comment.
Looks good to me, thanks for adding this!
Comment on lines
+189
to
+194
| %0 = om.constant "Hello, " : !om.string | ||
| %1 = om.constant "World" : !om.string | ||
| %2 = om.constant "!" : !om.string | ||
|
|
||
| // CHECK: om.string.concat %0, %1, %2 : !om.string | ||
| %3 = om.string.concat %0, %1, %2 : !om.string |
Contributor
There was a problem hiding this comment.
Yeah we've done some for the arithmetic ops!
Implement string concatenation evaluation in the OM evaluator. The evaluator extracts string attributes from both operands and concatenates them to produce a new string attribute. This enables runtime evaluation of string concatenation operations in the OM dialect. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
7a6a324 to
73c1e1b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add FIRRTL and OM string concatenation operations. Implement lowering and OM
evaluation.
This PR is structured as a logical series of multiple commits that I am
intending to land via rebase. Please review individually for less overload.
AI-assisted-by: Augment (Sonnet 4.5)