Skip to content

Adding option to pass a vector of tops to optimizeUsingXls.#4436

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

Adding option to pass a vector of tops to optimizeUsingXls.#4436
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_934791923

Conversation

@copybara-service

Copy link
Copy Markdown

Adding option to pass a vector of tops to optimizeUsingXls.

  • Before: optimizeUsingXls took as top either the module name (when the module is named) or defaulted to _package, which triggers an error if not func inside module is named like that. This design was problematic in the context of broader code optimization when we typically want to extract multiple structures, optimize them with XLS, and inline the resulting optimization back into the original structures. Two work arounds were explored: i) wrapping all extracted funcs into the same module, but didn't work (as optimized functions couldn't be inlined back into their original structure), ii) wrapping each extracted func inside its own module, but possibly costly to run.
  • current proosal: passing a list of tops to optimizeUsingXls to call mlirXlsToXls over the entire module, and then loop over tops for OptimizeIrForTop and XlsToMlirXlsTranslate

- Before: `optimizeUsingXls` took as top either the module name (when the module is named) or defaulted to `_package`, which triggers an error if not func inside module is named like that. This design was problematic in the context of broader code optimization when we typically want to extract multiple structures, optimize them with XLS, and inline the resulting optimization back into the original structures. Two work arounds were explored: i) wrapping all extracted funcs into the same module, but didn't work (as optimized functions couldn't be inlined back into their original structure), ii) wrapping each extracted func inside its own module, but possibly costly to run.
- current proosal: passing a list of tops to `optimizeUsingXls` to call `mlirXlsToXls` over the entire module, and then loop over tops for `OptimizeIrForTop` and `XlsToMlirXlsTranslate`

PiperOrigin-RevId: 934791923
@google-cla

google-cla Bot commented Jun 19, 2026

Copy link
Copy Markdown

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.

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.

0 participants