Skip to content

[DSLX] Re-enable tuple-array loop tests and prefix_scan IR lowering. - #5202

Draft
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_1007990718
Draft

copybara-service[bot] wants to merge 1 commit into
mainfrom
test_1007990718

Conversation

@copybara-service

Copy link
Copy Markdown

[DSLX] Re-enable tuple-array loop tests and prefix_scan IR lowering.

Now that tuple destructuring in for-loop array iterators is supported during IR conversion (#5125, #1289), tests and examples that worked around or disabled IR lowering for std::enumerate loops can use direct tuple destructuring and full IR conversion.

  • Re-enable IrConverterTest.LoopThroughTupleArray in xls/dslx/ir_convert/ir_converter_match_test.cc and add its golden IR file (ir_converter_test_LoopThroughTupleArray.ir).
  • Destructure (i, elem) / (i, e) directly in the for-loop header of prefix_scan_eq in xls/examples/dslx_intro/prefix_scan_equality.x, docs_src/tutorials/prefix_scan.md, and docs_src/dslx_reference.md, removing the TODO(https://github.com/google/xls/issues/5125) workarounds.
  • Enable IR conversion, optimization, and JIT comparison for prefix_scan_equality in xls/examples/dslx_intro/BUILD by adding prefix_scan_equality (xls_dslx_opt_ir) and prefix_scan_equality_test (xls_dslx_opt_ir_test) and setting dslx_test_args = {"compare": "jit"} on prefix_scan_equality_dslx_test.

Now that tuple destructuring in `for`-loop array iterators is supported during IR conversion (#5125, #1289), tests and examples that worked around or disabled IR lowering for `std::enumerate` loops can use direct tuple destructuring and full IR conversion.

- Re-enable `IrConverterTest.LoopThroughTupleArray` in `xls/dslx/ir_convert/ir_converter_match_test.cc` and add its golden IR file (`ir_converter_test_LoopThroughTupleArray.ir`).
- Destructure `(i, elem)` / `(i, e)` directly in the `for`-loop header of `prefix_scan_eq` in `xls/examples/dslx_intro/prefix_scan_equality.x`, `docs_src/tutorials/prefix_scan.md`, and `docs_src/dslx_reference.md`, removing the `TODO(https://github.com/google/xls/issues/5125)` workarounds.
- Enable IR conversion, optimization, and JIT comparison for `prefix_scan_equality` in `xls/examples/dslx_intro/BUILD` by adding `prefix_scan_equality` (`xls_dslx_opt_ir`) and `prefix_scan_equality_test` (`xls_dslx_opt_ir_test`) and setting `dslx_test_args = {"compare": "jit"}` on `prefix_scan_equality_dslx_test`.

PiperOrigin-RevId: 1007990718

This branch has not been deployed

No deployments
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