-
Couldn't load subscription status.
- Fork 175
[CIR][ThroughMLIR] Lower WhileOp with break. #1942
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
base: main
Are you sure you want to change the base?
Conversation
`optimizeOnCertainBreak`.
| // CHECK: memref.alloca_scope { | ||
| // CHECK: %[[IV:.+]] = memref.load %alloca[] | ||
| // CHECK: %[[HUNDRED:.+]] = arith.constant 100 | ||
| // CHECK: %[[_:.+]] = arith.cmpi slt, %[[IV]], %[[HUNDRED]] |
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.
I was looking at the generated IR and I'm not sure this works right, the loop is gone but you still need to increment i, what am I missing here?
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.
It's the 2nd i++ (operations after break) that got removed, the 1st i++ is kept.
while (i < 100) {
i++;
break;
i++;
}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.
I got that but I'm still not seeing a loop there and I'm curious what's going on
8acaf96 to
58135ea
Compare
The PR1735 contains too many conflicts with the main branch.
Got it re-patched to the current main branch.