Skip to content

Remove special override in RCA for Length, handle Length calls and Range types in Partial Eval#3286

Open
swernli wants to merge 2 commits into
mainfrom
swernli/issue3281
Open

Remove special override in RCA for Length, handle Length calls and Range types in Partial Eval#3286
swernli wants to merge 2 commits into
mainfrom
swernli/issue3281

Conversation

@swernli
Copy link
Copy Markdown
Collaborator

@swernli swernli commented Jun 2, 2026

This change removes the special override for Length that was used in RCA, processing it using the regular inferred characteristics. This means that it may show up as "Dynamic Constant" expression, so Partial Eval now needs to handle those calls to Length directly rather than assuming they will be handed off to the underlying full evaluator. Likewise, this now allows for "Dynamic Constant" Range values, which Partial Eval can handle appropriately. To fix the handling of loops based on these constant values, we now correctly emit the loop only if the loop condition is a "Dynamic Variable" value, rather than on any non-"Static" value.

Fixes #3281 Fixes #3282

…d `Range` types in Partial Eval

This change removes the special override for `Length` that was used in RCA, processing it using the regular inferred characteristics. This means that it may show up as "Dynamic Constant" expression, so Partial Eval now needs to handle those calls to `Length` directly rather than assuming they will be handed off to the underlying full evaluator. Likewise, this now allows for "Dynamic Constant" `Range` values, which Partial Eval can handle appropriately. To fix the handling of loops based on these constant values, we now correctly emit the loop only if the loop condition is a "Dynamic Variable" value, rather than on any non-"Static" value.

Fixes #3281
Fixes #3282
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.

IsEmpty function flagged as dynamic by RCA even when not needed Length override can cause failures in QIR codegen with embedded expressions

1 participant