[llvm] [VFABI] Improve VFABI unit tests (PR #73907)

Maciej Gabka via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 00:46:55 PST 2023


================
@@ -61,40 +61,31 @@ class VFABIParserTest : public ::testing::Test {
   // use to create the function in the module if it differs from the
   // standard mangled name.
   //
-  // \p IRType -> FunctionType string to be used for the signature of
+  // \p STy -> FunctionType string to be used for the signature of
   // the vector function.  The correct signature is needed by the
   // parser only for scalable functions. For the sake of testing, the
   // generic fixed-length case can use as signature `void()`.
----------------
mgabka wrote:

I think you can be a bit more specific here, the tests checking the parameters are also using the FunctionType for fixed length, but it won't cause the parsing to fail.

Indeed, currently the VFABI demangler, i.e VFABI::tryDemangleForVFABI  is using the function type only for scalable vectors to pass to getScalableECFromSignature, where the check of nr of parameters happens.
So the parsing is going to fail when there is a mismatch for scalable vectors.
This should be changed in a separate PR, to move it outside the getScalableECFromSignature, and always check that number of parameters is matching.

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


More information about the llvm-commits mailing list