-
Notifications
You must be signed in to change notification settings - Fork 1.7k
C++: Add Arm scalable vector type QL classes #19792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
7f9dd16
to
850779c
Compare
8cd78be
to
f579099
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for Arm scalable vector extensions by extending the database schema, introducing new QL classes, and updating tests to recognize the new types.
- Define new built-in type kind for
__SVCount_t
and derived type kind for scalable vectors - Add
tupleelements
table and implementScalableVectorCount
/ScalableVectorType
in QL - Update library-tests to include
__SVCount_t
in various expected outputs
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
cpp/ql/test/library-tests/variables/variables/types.expected | Add expected entry for __SVCount_t as ScalableVectorCount |
cpp/ql/test/library-tests/unspecified_type/types/unspecified_type.expected | Include __SVCount_t in unspecified-type tests |
cpp/ql/test/library-tests/type_sizes/type_sizes.expected | Record size (0 ) for __SVCount_t |
cpp/ql/test/library-tests/templates/type_instantiations/types.expected | Add __SVCount_t to template instantiation tests |
cpp/ql/lib/upgrades/9baef67d1ffc1551429dbe1c1130815693e28218/upgrade.properties | Declare Arm scalable vector support upgrade |
cpp/ql/lib/semmlecode.cpp.dbscheme | Introduce kinds @scalable_vector_count (63) and @scalable_vector (11) |
cpp/ql/lib/semmle/code/cpp/ir/internal/CppType.qll | Treat ScalableVectorCount as opaque in size queries |
cpp/ql/lib/semmle/code/cpp/Type.qll | Add ScalableVectorCount and ScalableVectorType classes; exclude count type from arithmetic |
cpp/downgrades/e38346051783182ea75822e4adf8d4c6a949bc37/upgrade.properties | Define downgrade for scalable vector support |
cpp/downgrades/e38346051783182ea75822e4adf8d4c6a949bc37/derivedtypes.ql | Map scalable vector kind back to GNU vector on downgrade |
cpp/downgrades/e38346051783182ea75822e4adf8d4c6a949bc37/builtintypes.ql | Map __SVCount_t kind to error on downgrade |
cpp/ql/lib/upgrades/9baef67d1ffc1551429dbe1c1130815693e28218/upgrade.properties
Show resolved
Hide resolved
@@ -134,6 +134,8 @@ private predicate isOpaqueType(Type type) { | |||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, but shouldn't we treat ScalableVectorType
similarly to , e.g., GNUVectorType
?
) | |
type instanceof ScalableVectorType | |
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably. Writing IR tests is on the to-do list as a follow-up. The below was just need to make sure the tests don't fall over, because ScalableVectorCount
has no size. So fixing or adapting this I would like to postpone once I have some time to write some tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Update the database scheme to support Arm scalable vector extensions. Also introduce relevant QL classes for the scalable vector type.
I would like to omit a change note here, as users cannot extract these types at the moment. It seems more appropriate to write a single change note once that is possible.