Consolidate duplicate numeric-vector type predicates into TypeSemantics#34
Merged
Merged
Conversation
Three identical numeric-vector predicates (HIR.cpp isNumericVectorTypeName,
HIRPassManager isHIRNumericVectorTypeName, Intrinsics isNumericVectorType) each
enumerated the vec/ivec/uvec types. Replace them with a single canonical
TypeSemantics::isNumericVectorTypeName, defined as isVectorType(name) &&
!name.starts_with("bvec") so the numeric-vector set tracks the canonical vector
set automatically. Continues the predicate consolidation from #33.
NripeshN
added a commit
that referenced
this pull request
Jun 21, 2026
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.
Summary
Round 2 of the type-predicate consolidation started in #33. Three files each carried their own copy of the "numeric vector" predicate:
HIR.cpp::isNumericVectorTypeNameHIRPassManager.cpp::isHIRNumericVectorTypeNameIntrinsics.cpp::isNumericVectorTypeAll three enumerated the same set (
vec/ivec/uvec× {2,3,4}, excluding the booleanbvecN). They are replaced by a single canonicalcrossgl::isNumericVectorTypeNameinTypeSemantics, defined in terms of the existing canonicalisVectorTypeso the numeric-vector set stays in lock-step with the vector set:This removes the last of the hand-maintained vector-type literal lists outside
TypeSemantics, eliminating a class of drift bug (the three copies could silently disagree if a new vector type were ever added).Verification
Full suite green:
100% tests passed, 0 tests failed out of 2452.