Skip to content

Conversation

@zhengyang92
Copy link
Contributor

@zhengyang92 zhengyang92 commented Oct 7, 2025

This patch adds the support for scalable vectors.

In this patch,

  • Alive2 generates SMT terms for scalable vectors based on a global vscale factor declared in util/config.h. For example, a scalable vector of type <vscale x 2 x i2> creates eight i2 integers when vscale=4.
  • The default vscale factor is set 2 and it can be adjusted by the command line arguments inalive and alive-tv.
  • The elements of VectorType is set to vscale * min_elements at the time when the VectorType is created. The min_elements field in VectorType serves solely for IR printer.
  • The llvm2alive is able to take scalable vector types.
  • The parser of scalable vector types for alive is implemented, check the test cases.
  • The llvm.vscale() returns the vscale factor.
  • For the mask vectors of shufflevectors, replicate by vscale when the arguments are scalable vectors.

With this patch, Alive2 can validate non-trivial cases with loops as shown in tests/alive-tv/vector/scalable/insert-loop*.ll.

@nunoplopes please let me know what you think.

CC @regehr

@nunoplopes
Copy link
Member

vscale needs to be an SMT variable.
If this can be set at run time (I don't know), then it goes to State. If the program can't change it, it goes to the type system.

@zhengyang92
Copy link
Contributor Author

zhengyang92 commented Oct 7, 2025 via email

@zhengyang92 zhengyang92 marked this pull request as draft October 7, 2025 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants