-
Notifications
You must be signed in to change notification settings - Fork 83
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
dialects: (memref_stream) remove unused operands in canonicalization #2851
Conversation
…eaved' into sasha/memref_stream/lower-interleaved
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2851 +/- ##
=======================================
Coverage ? 89.86%
=======================================
Files ? 396
Lines ? 49796
Branches ? 7679
=======================================
Hits ? 44749
Misses ? 3837
Partials ? 1210 ☔ View full report in Codecov by Sentry. |
Co-authored-by: Markus Böck <markus.boeck02@gmail.com>
Co-authored-by: Markus Böck <markus.boeck02@gmail.com>
…m/unused-operands
…eam/unused-operands
…eam/unused-operands
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a minor nit: It seems that you have some left-over bits of also dropping results, but most of it seems removed...
// CHECK-NEXT: ], | ||
// CHECK-NEXT: iterator_types = ["parallel", "parallel", "reduction"] | ||
// CHECK-NEXT: } ins(%{{.*}} : memref<4x2xf64>) outs(%{{.*}}, %{{.*}} : memref<4x3xf64>, memref<4x3xf64>) inits(%H : f64, None) { | ||
// CHECK-NEXT: ^{{.*}}(%{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// CHECK-NEXT: ^{{.*}}(%{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64): | |
// CHECK-NEXT: ^{{\S*}}(%{{\S*}} : f64, %{{\S*}} : f64, %{{\S*}} : f64): |
Otherwise this will still pass for blocks with 15 arguments.
// CHECK-NEXT: ], | ||
// CHECK-NEXT: iterator_types = ["parallel", "parallel", "reduction", "interleaved"] | ||
// CHECK-NEXT: } ins(%{{.*}}, %{{.*}} : memref<3x5xf64>, memref<5x8xf64>) outs(%{{.*}} : memref<3x8xf64>) { | ||
// CHECK-NEXT: ^{{.*}}(%{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// CHECK-NEXT: ^{{.*}}(%{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64): | |
// CHECK-NEXT: ^{{\S*}}(%{{\S*}} : f64, %{{\S*}} : f64, %{{\S*}} : f64, %{{\S*}} : f64, %{{\S*}} : f64, %{{\S*}} : f64, %{{\S*}} : f64, %{{\S*}} : f64, %{{\S*}} : f64, %{{\S*}} : f64, %{{\S*}} : f64, %{{\S*}} : f64): |
num_outputs_dropped = 0 | ||
for index, arg in enumerate(block_args[:num_inputs]): | ||
drop_operand = index in unused_input_indices | ||
is_input = index < num_inputs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this always the case, as you are only iterating over the first num_inputs
block args?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed, this is from a previous version of the code, I'll remove it
- remove it
This happens in pooling, where a tensor with a shape and no contents is created to specify the iteration space.