Skip to content

Properly handle const if expression when using proc-scoped channels#3745

Merged
copybara-service[bot] merged 2 commits intogoogle:mainfrom
antmicro:const_if_proc_scoped
Feb 4, 2026
Merged

Properly handle const if expression when using proc-scoped channels#3745
copybara-service[bot] merged 2 commits intogoogle:mainfrom
antmicro:const_if_proc_scoped

Conversation

@magancarz
Copy link
Contributor

This PR adds handling proper branch from const if when converting DSLX to IR with lower_to_proc_scoped_channels flag enabled. While it works on added ConstConditionalProcScoped test case, it breaks when trying to get a constexpr value from the test expression if const if is inside a parametric proc with the following error:

Error: NOT_FOUND: No constexpr value found for node `CONFIG` (NameRef) @ xls/examples/const_if.x:47:18-47:24

This issue can be reproduced by trying to build the const_if_ir example with changes from this PR.

@magancarz magancarz force-pushed the const_if_proc_scoped branch from 629d7a4 to 0a4d965 Compare February 3, 2026 11:37
@magancarz magancarz marked this pull request as ready for review February 3, 2026 11:37
@magancarz magancarz changed the title WIP: Properly handle const if expression when using proc-scoped channels Properly handle const if expression when using proc-scoped channels Feb 3, 2026
@magancarz
Copy link
Contributor Author

I've included a fix for using the correct type info when traversing parametrized proc's hierarchy in get_conversion_records.cc with proc-scoped channels enabled. It is based on deferring the traversal in HandleProc for parametric procs, so that the type info objects for config and next functions are later retrieved from spawn data and from resolved_proc_alias in case of top parametric procedures.
FYI @dplassgit

@magancarz magancarz mentioned this pull request Feb 3, 2026
7 tasks
@copybara-service copybara-service bot merged commit 1c088fc into google:main Feb 4, 2026
3 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.

2 participants