llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.24k stars 12.07k forks source link

[VFABI] Add explicit element count information for scalable vlen. #76783

Open yetingk opened 10 months ago

yetingk commented 10 months ago

b1fba568f6d4d824554fa22f43ec0f689a265664 determines the VF from a mangling function by its scalar type size. It works for SVE, but maybe not work for RVV. Since RVV has register group concept, it makes RVV vector calls could have multiple element count options for a scalar type. I provide two ways for this.

  1. SVE uses the b1fba568f6d4d824554fa22f43ec0f689a265664 way. And another architecture still uses the old way to get the element count by the signature of vector call.
  2. Add explicit element count for scalable vlen and also preserve SVE way to get the element count by the smallest scalable element count of vector calls. Like 2x means vscale x 2, and x uses current approach.
llvmbot commented 10 months ago

@llvm/issue-subscribers-backend-risc-v

Author: Yeting Kuo (yetingk)

b1fba568f6d4d824554fa22f43ec0f689a265664 determines the VF from a mangling function by its scalar type size. It works for SVE, but not works for RVV. Since RVV has register group concept, it makes RVV vector calls could have multiple element count options for a scalar type. I provide two ways for this. 1. SVE uses the b1fba568f6d4d824554fa22f43ec0f689a265664 way. And another architecture still uses the old way to get the element count by the signature of vector call. 2. Add explicit element count for scalable vlen and also preserve SVE way to get the element count by the smallest scalable element count of vector calls. Like `2x` means `vscale x 2`, and `x` uses current approach.
yetingk commented 10 months ago

@huntergr-arm @topperc