Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ordering of operands in ScheduledPipelineOp::build #5585

Merged
merged 3 commits into from
Jul 14, 2023

Conversation

blakep-msft
Copy link
Contributor

This is a fix for #5584. ScheduledPipelineOp::build is changed to add operands in the same order that PipelineOps.td expects.

Copy link
Contributor

@teqdruid teqdruid left a comment

Choose a reason for hiding this comment

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

this looks right!

odsState.addOperands(go);
odsState.addOperands(clock);
odsState.addOperands(reset);

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I would prefer no newlines here.

@@ -2,7 +2,7 @@

// CHECK-LABEL: hw.module @pipeline(
// CHECK-SAME: %[[VAL_0:.*]]: i32, %[[VAL_1:.*]]: i32, %[[VAL_2:.*]]: i1, %[[VAL_3:.*]]: i1, %[[VAL_4:.*]]: i1) -> (out: i32) {
// CHECK: %[[VAL_5:.*]], %[[VAL_6:.*]] = pipeline.scheduled(%[[VAL_7:.*]] : i32 = %[[VAL_0]], %[[VAL_8:.*]] : i32 = %[[VAL_1]]) clock(%[[VAL_9:.*]] = %[[VAL_2]]) reset(%[[VAL_10:.*]] = %[[VAL_3]]) go(%[[VAL_11:.*]] = %[[VAL_4]]) -> (out : i32) {
// CHECK: %[[VAL_5:.*]], %[[VAL_6:.*]] = pipeline.scheduled(%[[VAL_7:.*]] : i32 = %[[VAL_0]], %[[VAL_8:.*]] : i32 = %[[VAL_1]]) clock(%[[VAL_9:.*]] = %[[VAL_3]]) reset(%[[VAL_10:.*]] = %[[VAL_4]]) go(%[[VAL_11:.*]] = %[[VAL_2]]) -> (out : i32) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this change necessary? This implies that this particular builder was being used by the parser.

Copy link
Contributor

Choose a reason for hiding this comment

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

The builder is used in the scheduling pass, hence when the result was being printed, operands were printed in the wrong order. If i (or the reviewers) of this had been a bit more attentive, we'd have spotted this issue there.

Copy link
Contributor

@mortbopet mortbopet left a comment

Choose a reason for hiding this comment

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

Awesome - thank you for spotting this and fixing it. I could say that it was something i intentionally put in here to get you to do your first PR, but then i'd be lying and covering up for my own negligence... 🙃.

@blakep-msft blakep-msft merged commit b31bac8 into main Jul 14, 2023
5 checks passed
@blakep-msft blakep-msft deleted the dev/blakep/pipeline-argument-order branch July 14, 2023 15:36
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.

Argument order mismatch between ScheduledPipelineOp::build and PipelineBase (PipelineOps.td)
3 participants