Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds support for Arm Scalable Vector Extension (SVE) types in the intermediate representation generation and updates related tests.
- Renames and extends NEON tests (
arm.cpp→arm_neon.cpp) and adds a newarm_sve.cpptest. - Updates expected IR and AST outputs for both NEON and SVE patterns.
- Treats
ScalableVectorTypeas opaque (size 0) and includes it in const-propagation (isDeeplyConstBelow) rules in the QL IR definitions.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| cpp/ql/test/library-tests/ir/ir/raw_ir.expected | Updated expected raw IR for NEON and added SVE cases |
| cpp/ql/test/library-tests/ir/ir/aliased_ir.expected | Updated aliased IR expectations for NEON and SVE |
| cpp/ql/test/library-tests/ir/ir/PrintAST.expected | Updated AST print expectations for NEON and SVE |
| cpp/ql/test/library-tests/ir/ir/arm_neon.cpp | New NEON test source |
| cpp/ql/test/library-tests/ir/ir/arm_sve.cpp | New SVE test source |
| cpp/ql/lib/semmle/code/cpp/ir/internal/CppType.qll | Treat ScalableVectorType as size-0 in getTypeSizeWorkaround and isOpaqueType |
| cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/SideEffects.qll | Include ScalableVectorType in isDeeplyConstBelow |
Comments suppressed due to low confidence (2)
cpp/ql/lib/semmle/code/cpp/ir/internal/CppType.qll:34
- [nitpick] Add a QLDoc comment above this clause to explain why
ScalableVectorTypeis treated as size 0 (opaque) and when this fallback might need revisiting.
type instanceof ScalableVectorType and
cpp/ql/lib/semmle/code/cpp/ir/internal/CppType.qll:34
- Add or extend a unit test to verify that
getTypeSizeWorkaroundreturns 0 forScalableVectorType, ensuring the new fallback is exercised.
type instanceof ScalableVectorType and
Comment on lines
55
to
+58
| isDeeplyConst(t.(GNUVectorType).getBaseType()) | ||
| or | ||
| isDeeplyConst(t.(ScalableVectorType).getBaseType()) | ||
| or |
There was a problem hiding this comment.
[nitpick] Consider grouping the vector-type const checks (GNUVectorType and ScalableVectorType) into a single reusable predicate to reduce duplication.
Suggested change
| isDeeplyConst(t.(GNUVectorType).getBaseType()) | |
| or | |
| isDeeplyConst(t.(ScalableVectorType).getBaseType()) | |
| or | |
| isVectorType(t) and isDeeplyConst(t.getBaseType()) | |
| or |
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.
Observe that MS calculator is currently broken in DCA. I don't think missing out on the project is critical for this PR. I've opened microsoft/calculator#2347 to hopefully get this resolved.