-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[BACKEND] Cleanup redundant broadcast combine pattern #5167
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -189,8 +189,8 @@ def make_ttir(mod, metadata, opt): | |
pm.enable_debug() | ||
passes.common.add_inliner(pm) | ||
passes.ttir.add_rewrite_tensor_pointer(pm) | ||
passes.ttir.add_combine(pm) | ||
passes.common.add_canonicalizer(pm) | ||
passes.ttir.add_combine(pm) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm swapping these passes around so that the combine pass can assume the input is canonicalized. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that makes sense. I wonder if this will prevent some canonicalization to happen as broadcast ops may be in the middle. What kind of canonicalization do you need for this pass? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think all the broadcast related things are now in canonicalize and combine is now mainly dot-related things, plus the I do wonder if it might be worthwhile to add another canonicalize pass though, since LICM and loop unrollng could potentially connect patterns that were previously separated by region boundaries. The reorder broadcast pass could also connect arith patterns that were broken up by broadcasts and/or splats. Just a hunch though, I don't have any examples in mind. |
||
passes.ttir.add_reorder_broadcast(pm) | ||
passes.common.add_cse(pm) | ||
passes.common.add_licm(pm) | ||
|
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.
Since the input is now canonicalized, we don't need to match against non-canonical forms.