Skip to content

Conversation

s-perron
Copy link
Collaborator

@s-perron s-perron commented Sep 8, 2025

The instruction folder returns nullptr when it fails to create a new
instruction due to ID overflow. This is ambiguous because it also
returns nullptr when it simply cannot fold an instruction.

This change introduces an id_overflow_ flag in IRContext that is
set by TakeNextId() when it runs out of IDs.

The FoldSpecConstantOpAndCompositePass is updated to check this flag
after attempting to fold a spec constant. If the flag is set, the pass
returns Status::Failure, preventing further processing and providing a
clear error.

@s-perron s-perron requested a review from luciechoi September 8, 2025 18:16
The instruction folder returns nullptr when it fails to create a new
instruction due to ID overflow. This is ambiguous because it also
returns nullptr when it simply cannot fold an instruction.

This change introduces an `id_overflow_` flag in `IRContext` that is
set by `TakeNextId()` when it runs out of IDs.

The `FoldSpecConstantOpAndCompositePass` is updated to check this flag
after attempting to fold a spec constant. If the flag is set, the pass
returns `Status::Failure`, preventing further processing and providing a
clear error.
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