-
Notifications
You must be signed in to change notification settings - Fork 108
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
type: add preliminiary support for singular vscale #1140
base: master
Are you sure you want to change the base?
Conversation
In an effort to support checking of programs with scalable vectors, add syntactic support for vscale and vscale_range, making the vscale an smt::expr in State. For the moment, we fail to type-check any program using scalable vectors.
Thread the vscale range information, which is an smt::expr in State to various functions in Type, cascading down to a final numElementsConst(), in preparation for the first step in supporting scalable vectors.
Change llvm_util to correctly fill aggregates and scalable vector splats, based on the vscale_range attribute on the function, and add a virtual numElementsConst() override, to operate on the maximum value in the vscale range. Not considering all possible vscale values is obviously a correctness issue, so ensure that we only pass the type-check when the vscale range has a singular value. In practice, the entire codebase needs to be taught about scalable vectors, before all programs with a singular vscale value are supported. The rem-costvscale.srctgt.ll test fails to type-check, for instance, due to ShuffleVector using a non-scalable mask. These instances are left as a todo for follow-up patches.
children.resize(elements, &elementTy); | ||
is_padding.resize(elements, false); | ||
unsigned scaleFactor = isScalableTy ? var_vector_max_vscale : 1; | ||
children.resize(elements * scaleFactor, &elementTy); |
Check failure
Code scanning / CodeQL
Multiplication result converted to larger type High
is_padding.resize(elements, false); | ||
unsigned scaleFactor = isScalableTy ? var_vector_max_vscale : 1; | ||
children.resize(elements * scaleFactor, &elementTy); | ||
is_padding.resize(elements * scaleFactor, false); |
Check failure
Code scanning / CodeQL
Multiplication result converted to larger type High
@@ -1499,24 +1551,25 @@ | |||
return 0; | |||
} | |||
|
|||
uint64_t getCommonAccessSize(const IR::Type &ty) { | |||
uint64_t getCommonAccessSize(const IR::Type &ty, expr vscaleRange) { |
Check failure
Code scanning / CodeQL
Multiplication result converted to larger type High
Change llvm_util to correctly fill aggregates and scalable vector splats, based on the vscale_range attribute on the function, and add a virtual numElementsConst() override, to operate on the maximum value in the vscale range. Not considering all possible vscale values is obviously a correctness issue, so ensure that we only pass the type-check when the vscale range has a singular value.
In practice, the entire codebase needs to be taught about scalable vectors, before all programs with a singular vscale value are supported. The rem-costvscale.srctgt.ll test fails to type-check, for instance, due to ShuffleVector using a non-scalable mask. These instances are left as a todo for follow-up patches.
-- 8< --
Based on #1139.