[llvm] [RISCV] Change vector tuple type's TypeSize to scalable (PR #114329)

Brandon Wu via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 30 17:11:04 PDT 2024


================
@@ -63,6 +63,7 @@ class VTVecTup<int size, int nf, ValueType dummy_elt, int value>
   let NF = nf;
   let ElementType = dummy_elt;
   let isRISCVVecTuple = true;
+  let isScalable = true;
----------------
4vtomat wrote:

> What I don't want is for this to return true for a tuples.
> 
> ```
>     bool isScalableVector() const {                                              
>       return (SimpleTy >= MVT::FIRST_SCALABLE_VECTOR_VALUETYPE &&                
>               SimpleTy <= MVT::LAST_SCALABLE_VECTOR_VALUETYPE);                  
>     }  
> ```
> 
I see

> I think you just need to change `Sc || Ty == aarch64svcount` in this to `Sc || Tup || Ty == aarch64svcount`
> 
> ```
>     TypeSize getSizeInBits() const {
>       static constexpr TypeSize SizeTable[] = {
> #define GET_VT_ATTR(Ty, N, Sz, Any, Int, FP, Vec, Sc, Tup, NF, NElem, EltTy) \
>     TypeSize(Sz, Sc || Ty == aarch64svcount /* FIXME: Not in the td. */),
> #include "llvm/CodeGen/GenVT.inc"                                                
> #undef GET_VT_ATTR
> ```
Yeah, it's easier lol~


https://github.com/llvm/llvm-project/pull/114329


More information about the llvm-commits mailing list