[PATCH] D79867: [VectorUtils] Expose vector-function-abi-variant mangling as a utility. NFC

Francesco Petrogalli via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 13 21:15:35 PDT 2020


fpetrogalli added a comment.

> [...] but it should be orthogonal to that requirement. I think hiding the mangling behind a static function, while the demangling is exposed seems unintuitive. Any front-ends that need to attach the attribute will need this function exposed.

Yep, I fully agree, thank you for explaining!

The function you are exposing is not a generic VFABI mangling function. The VFABI mangling function would take in input the `VFShape` that we need to realize from a scalar function, and mangle it accordingly setting the correct tokens for each parameter (whether it is linear, uniform... and so on). The method you are exposing is TLI-specific: all the parameter tokens of the mangled name are rendered with `"v"`. Hence, I think that you should leave the name of the method specific to the TLI, as in `VFABI::mangleTLIVectorName`. Or alternatively, expose it as a static method of the class `TargetLibraryInfo`.

Also, given that now this is going to be exposed as method like the demangler, I think it would make sense to add some unit tests in `llvm/unittests/Analysis/VectorFunctionABITest.cpp` (or the TLI tests if you go for the static method of TLI).

Thank you!

Francesco

Francesco


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79867/new/

https://reviews.llvm.org/D79867





More information about the llvm-commits mailing list