Skip to content

Conversation

maerhart
Copy link
Member

@maerhart maerhart commented Jul 8, 2025

The pass to be run in the first compilation run to generate sideband command labels understood by the ISA simulator (e.g. Spike).

@maerhart maerhart added the RTG Involving the `rtg` dialect label Jul 8, 2025
Copy link
Contributor

@fabianschuiki fabianschuiki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@uenoku uenoku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

builder.create<rtg::LabelOp>(loc, rtg::LabelVisibility::global, lbl);
validateOp.getValue().replaceAllUsesWith(validateOp.getDefaultValue());

pruner.eraseNow(validateOp);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Strictly speaking it's not allowed to erase operations in walk other than the current operation (validateOp). Though I think it's always legal with the current implementation of walk specifically.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This call only erases the validateOp and remembers now unused operations defining the operands in the eraseNow call below.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, thanks. I misunderstood that eraseNow walks and erases operations transitively....

@maerhart maerhart merged commit 1e5ee92 into main Jul 8, 2025
7 checks passed
@maerhart maerhart deleted the maerhart-rtg-lower-validate branch July 8, 2025 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RTG Involving the `rtg` dialect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants