8000 [xls][mlir} Fix bug `-array-to-bits` related to `xls.dynamic_bit_slice`. by copybara-service[bot] · Pull Request #2517 · google/xls · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[xls][mlir} Fix bug -array-to-bits related to xls.dynamic_bit_slice. #2517

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

Merged
merged 1 commit into from
Jul 1, 2025

Conversation

copybara-service[bot]
Copy link
@copybara-service copybara-service bot commented Jun 30, 2025

[xls][mlir} Fix bug -array-to-bits related to xls.dynamic_bit_slice.

This CL fixes a bug that occurred in the -array-to-bits pass during the legalization of xls.array_slice, which produced an incorrect start value for the resulting xls.dynamic_bit_slice op. The wrong computation comes from the fact that XLS uses left-to-right offsets for arrays, including the original xls.array_slice op, but right-to-left offsets for bits, including the created xls.dynamic_bit_slice. The previous legalization pattern ignored the direction change during rewriting, so the fix consists of converting the left-to-right offset into a right-to-left offset.

The CL also adds missing punctuation in an unrelated file and adds the ArithDialect to the dependencies of the -array-to-bits pass because this and other patterns may create ops from that dialect.

Copy link
google-cla bot commented Jun 30, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@copybara-service copybara-service bot force-pushed the test_776896337 branch 2 times, most recently from 9a64741 to dc21d4e Compare July 1, 2025 07:53
This CL fixes a bug that occurred in the `-array-to-bits` pass during the legalization of `xls.array_slice`, which produced an incorrect `start` value for the resulting `xls.dynamic_bit_slice` op. The wrong computation comes from the fact that XLS uses left-to-right offsets for `array`s, including the original `xls.array_slice` op, but right-to-left offsets for `bits`, including the created `xls.dynamic_bit_slice`. The previous legalization pattern ignored the direction change during rewriting, so the fix consists of converting the left-to-right offset into a right-to-left offset.

The CL also adds missing punctuation in an unrelated file and adds the `ArithDialect` to the dependencies of the `-array-to-bits` pass because this and other patterns may create ops from that dialect.

PiperOrigin-RevId: 777914087
@copybara-service copybara-service bot merged commit e507833 into main Jul 1, 2025
@copybara-service copybara-service bot deleted the test_776896337 branch July 1, 2025 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0