-
Notifications
You must be signed in to change notification settings - Fork 131
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
Move more logic from MergeCleanups into Op::fold methods #593
Comments
I may want to tackle this, but I’ll be available to get to it only later this month 🙏🏻🏝️ |
@orbiri-ns np, I leave this to you (unless someone grabs it first, perhaps unlikely tho) |
@orbiri-ns Hello, how is your progress going? If you are too busy, I can do this. Of course, if you have already started, then just ignore my message. |
Hey, I have unfortunately not found time to tackle this and can give it away. I will note that I did start doing some research unto how do similar canonicalizations look like in scf dialect, and found that they heavily rely on the trivially-unused removal. I would suggest to go a bit deeper there before blindly implementing code that should be handled by core MLIR for us. My experiments included running |
Thank you for your suggestion. I will research this issue after completing some work related to ThroughMLIR. However, I cannot guarantee that I will be able to solve this issue because I am a newcomer. If there are any updates on this issue, I will post them here promptly. If anyone else is interested in this issue, please feel free to discuss it here.:) |
@Kritoooo thanks for following up with this! My workflow suggestion:
|
Thank you for your suggestion. I have started moving RemoveRedundantBranches to BrOp::fold. So far, it is going well. However, I have encountered an issue: many original test files do not seem to apply the RemoveRedundantBranches optimization, causing the tests to fail. Do I need to modify all these test files to make them pass? Is there a better way to handle this?
move RemoveRedundantBranches to BrOp::fold
Sure, after moving the RemoveRedundantBranches logic to BrOp::fold, it can directly pass the merge-cleanups.cir test. |
You probably need to add |
Hi @bcardosolopes ! Since #868 has been merged, there are two passes to call |
We had some bugs in the past because we can't do much alterations to the IR during folds, so they have to be done elsewhere. That said, I'm not sure this issue is still valid after all those changes. Anything specific you started to look at? |
I took a look at CIR Canonicalize and CIR Simplify. Those pattern rewrite seem not so trivial to move to |
@FantasqueX I don't think so, will close. If we find anything we should create a new issue |
@seven-mile uses this for casts in #591, we should do the same for the other ops if possible.
The text was updated successfully, but these errors were encountered: