Repository navigation
Conversation
The check used a PCRE lookbehind; grep -E (ERE) has no lookbehind, so the count was always 0 and the check never failed (since c63b411). The new pipeline drops comments and quoted strings in one left-to-right perl -0 pass over the whole file (strings can span lines per LangRef, e.g. llvm-dis prints a string attribute key with a raw newline; a quote can appear in a comment such as a ModuleID), then strips a leading block label per line. perl is used because sed -z is GNU-only and the macOS lane has BSD sed. grep then extracts iN tokens not preceded by %, @, !, ., $, an identifier character or '-', and counts those whose width is not 1/8/16/32/64. Otherwise only POSIX sed -E and grep -E are used, no \b. Known gap: llvm-dis does not escape string attribute keys, so a key containing a quote prints as invalid IR and is not handled (upstream LLVM printer bug in Attribute::getAsString).
pvelesko
marked this pull request as ready for review
October 26, 2026 21:57
This branch has not been deployed
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.
The hipPromoteInt tests check that no odd-width integers survive HipPromoteInts, but the check used a PCRE lookbehind under grep -E, so it always counted 0 and never failed. This replaces it with a pipeline that strips comments, strings and block labels from the llvm-dis output and then counts iN types whose width is not 1/8/16/32/64. It sticks to perl, sed -E and grep -E so it also works with the BSD tools on the macOS lane.
A string attribute key containing a quote is not handled, because llvm-dis prints such keys unescaped (#2125).
Fixes #2122
This PR was generated using AI