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

[Comb] Infinite loop in OrOp folder #8022

Open
maerhart opened this issue Dec 31, 2024 · 0 comments
Open

[Comb] Infinite loop in OrOp folder #8022

maerhart opened this issue Dec 31, 2024 · 0 comments
Labels
Comb Involving the `comb` dialect

Comments

@maerhart
Copy link
Member

The following IR ends up in an infinite loop in the comb.or folder. It's a degenerate case, but the compiler should still not end up in an infinite loop. I think we can just leave the IR as is or fold it to some kind of poison value.

hw.module @infiniteFolding(out out : i1) {
  %true = hw.constant true
  %0 = comb.mux %0, %true, %0 : i1
  hw.output %0 : i1
}

With --debug-only=greedy-rewriter:

//===-------------------------------------------===//
Processing operation : 'comb.or'(0x561b88d1c530) {
  %1 = "comb.or"(%1, %1) : (i1, i1) -> i1

} -> success : operation was folded
//===-------------------------------------------===//
@maerhart maerhart added the Comb Involving the `comb` dialect label Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Comb Involving the `comb` dialect
Projects
None yet
Development

No branches or pull requests

1 participant