[all-commits] [llvm/llvm-project] 623cff: [llvm][VectorUtils] Tweak VFShape for scalable vec...

Francesco Petrogalli via All-commits all-commits at lists.llvm.org
Wed Jan 29 21:55:01 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 623cff81fef3cc6fb7c619fb7366803864f63dc6
      https://github.com/llvm/llvm-project/commit/623cff81fef3cc6fb7c619fb7366803864f63dc6
  Author: Francesco Petrogalli <francesco.petrogalli at arm.com>
  Date:   2020-01-30 (Thu, 30 Jan 2020)

  Changed paths:
    M llvm/include/llvm/Analysis/VectorUtils.h
    M llvm/lib/Analysis/VFABIDemangling.cpp
    M llvm/lib/Analysis/VectorUtils.cpp
    M llvm/lib/Transforms/Utils/ModuleUtils.cpp
    M llvm/tools/vfabi-demangle-fuzzer/CMakeLists.txt
    M llvm/tools/vfabi-demangle-fuzzer/vfabi-demangler-fuzzer.cpp
    M llvm/unittests/Analysis/VectorFunctionABITest.cpp

  Log Message:
  -----------
  [llvm][VectorUtils] Tweak VFShape for scalable vector functions.

Summary:
This patch makes sure that the field VFShape.VF is greater than zero
when demangling the vector function name of scalable vector functions
encoded in the "vector-function-abi-variant" attribute.

This change is required to be able to provide instances of VFShape
that can be used to query the VFDatabase for the vectorization passes,
as such passes always require a positive value for the Vectorization Factor (VF)
needed by the vectorization process.

It is not possible to extract the value of VFShape.VF from the mangled
name of scalable vector functions, because it is encoded as
`x`. Therefore, the VFABI demangling function has been modified to
extract such information from the IR declaration of the vector
function, under the assumption that _all_ vectors in the signature of
the vector function have the same number of lanes. Such assumption is
valid because it is also assumed by the Vector Function ABI
specifications supported by the demangling function (x86, AArch64, and
LLVM internal one).

The unit tests that demangle scalable names have been modified by
adding the IR module that carries the declaration of the vector
function name being demangled.

In particular, the demangling function fails in the following cases:

1. When the declaration of the scalable vector function is not
    present in the module.

2. When the value of VFSHape.VF is not greater than 0.

Reviewers: jdoerfert, sdesmalen, andwar

Reviewed By: jdoerfert

Subscribers: mgorny, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73286




More information about the All-commits mailing list