fix(codegen): bound instruction modifier searches to the current token - #1260
Merged
Merged
Conversation
Avoid scanning the remaining LLVM module for each escaped whitespace delimiter. Preserve the first token boundary while eliminating quadratic feature detection on large generated modules. Signed-off-by: Paul Zhang <paul@studio-vaai.com>
nihalpasham
force-pushed
the
codex/bounded-feature-scan
branch
from
September 23, 2026 06:09
1f5a67f to
4953e1e
Compare
nihalpasham
approved these changes
Sep 23, 2026
nihalpasham
left a comment
Collaborator
There was a problem hiding this comment.
I rebased this and checked the token-boundary behavior independently. All 6,084 delimiter/near-match cases agreed with the old implementation, and the large-module scan now scales linearly in the measured cases.
All 1,261 codegen tests, strict Clippy and docs pass. All seven hosted workflows passed at 4953e1e1.
No issue is closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this fixes
Feature detection repeatedly searched the rest of the LLVM module for escaped whitespace. Large modules therefore spent quadratic time scanning ordinary instruction tokens.
The earliest delimiter is unchanged, including escaped and Unicode whitespace. Architecture and PTX requirements keep the same meaning.
Verification
4953e1e1.No issue is closed.