[llvm] [SLP][REVEC] Fix CommonMask is transformed into vector form but used outside finalize. (PR #120952)
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 24 07:48:27 PST 2024
alexey-bataev wrote:
> What do you mean "actual-sized"? Determined by `unsigned VecVF = cast<FixedVectorType>(Vec->getType())->getNumElements();` If that is true, it will modify a lot of code. Especially we don't have test to make sure it is true.
>
It is not a problem. The main problem - to make the code completely correct
> A code like `unsigned VecVF = cast<FixedVectorType>(Vec->getType())->getNumElements();` should be divided by the number of elements of ScalarTy. Just like `getVF`. e.g.,
>
> ```
> unsigned ScalarTyNumElements = getNumElements(ScalarTy);
> unsigned VNumElements =
> cast<FixedVectorType>(V->getType())->getNumElements();
> assert(VNumElements > ScalarTyNumElements &&
> "the number of elements of V is not large enough");
> assert(VNumElements % ScalarTyNumElements == 0 &&
> "the number of elements of V is not a vectorized value");
> return VNumElements / ScalarTyNumElements;
> ```
No, it should not be. You should operate with the full masks from the very beginning
https://github.com/llvm/llvm-project/pull/120952
More information about the llvm-commits
mailing list