Skip to content

[dslx] Improve lowering of one_hot_sel and priority_sel builtins - #4176

Merged
copybara-service[bot] merged 1 commit into
google:mainfrom
xlsynth:cdleary/2026-04-28-ohs-lowering
Nov 18, 2026
Merged

copybara-service[bot] merged 1 commit into
google:mainfrom
xlsynth:cdleary/2026-04-28-ohs-lowering

Conversation

@cdleary

@cdleary cdleary commented Apr 28, 2026

Copy link
Copy Markdown
Collaborator

Inline array literals passed to one_hot_sel and priority_sel can already be scalarized directly during IR conversion. Do that before generic argument lowering so no-opt IR does not materialize a temporary array and then recover its members with constant array_index nodes.

Keep the existing array-index fallback for non-literal case expressions, and preserve ellipsis expansion for literal arrays.

@cdleary
cdleary marked this pull request as ready for review April 28, 2026 17:29
@NL02
NL02 requested a review from richmckeever May 6, 2026 17:02
@proppy
proppy requested review from dplassgit and erinzmoore May 26, 2026 07:39
@proppy

proppy commented May 26, 2026

Copy link
Copy Markdown
Member

@richmckeever @erinzmoore @dplassgit can one of you take a look?

@ericastor

Copy link
Copy Markdown
Contributor

Poking this to see why it seems stuck.

@grebe

grebe commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Can you rebase on HEAD? I didn't realize this failed to submit b/c out of date files.

Inline array literals passed to one_hot_sel and priority_sel can already be
scalarized directly during IR conversion. Do that before generic argument
lowering so no-opt IR does not materialize a temporary array and then recover
its members with constant array_index nodes.

Keep the existing array-index fallback for non-literal case expressions, and
preserve ellipsis expansion for literal arrays.
@cdleary
cdleary force-pushed the cdleary/2026-04-28-ohs-lowering branch from 870aaf1 to a163a96 Compare November 14, 2026 03:43
@cdleary

cdleary commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator Author

@grebe Rebased onto upstream main and pushed. CI passed.

@copybara-service
copybara-service Bot merged commit c49dbfa into google:main Nov 18, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants