[PATCH] D95373: Replace vector intrinsics with call to vector library

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 12 06:52:41 PST 2021


spatel added a subscriber: david-arm.
spatel added a comment.

In D95373#2557483 <https://reviews.llvm.org/D95373#2557483>, @LukasSommerTu wrote:

> I reproduced the cause of the failure in the build-bot locally, fixed the bug and successfully ran the tests locally, so if you do not have any additional things that I should change, you could try again. Thanks!

D96011 <https://reviews.llvm.org/D96011> changed the TLI.getVectorizedFunction() API, so we need a small adjustment to make this compile. Let me know if this looks right ( cc @david-arm ):

  diff --git a/llvm/lib/CodeGen/ReplaceWithVeclib.cpp b/llvm/lib/CodeGen/ReplaceWithVeclib.cpp
  index 943199933494..bec0fb772c3e 100644
  --- a/llvm/lib/CodeGen/ReplaceWithVeclib.cpp
  +++ b/llvm/lib/CodeGen/ReplaceWithVeclib.cpp
  @@ -104,7 +104,7 @@ static bool replaceWithCallToVeclib(const TargetLibraryInfo &TLI,
   
     // Convert vector arguments to scalar type and check that
     // all vector operands have identical vector width.
  -  unsigned VF = 0;
  +  ElementCount VF;
     SmallVector<Type *> ScalarTypes;
     for (auto Arg : enumerate(CI.arg_operands())) {
       auto *ArgType = Arg.value()->getType();
  @@ -121,17 +121,17 @@ static bool replaceWithCallToVeclib(const TargetLibraryInfo &TLI,
           // the replacement.
           return false;
         }
  -      auto NumElements = VectorArgTy->getElementCount();
  +      ElementCount NumElements = VectorArgTy->getElementCount();
         if (NumElements.isScalable()) {
           // The current implementation does not support
           // scalable vectors.
           return false;
         }
  -      if (VF && VF != NumElements.getFixedValue()) {
  +      if (VF && VF != NumElements) {
           // The different arguments differ in vector size.
           return false;
         } else {
  -        VF = NumElements.getFixedValue();
  +        VF = NumElements;
         }
         ScalarTypes.push_back(VectorArgTy->getElementType());
       }


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

https://reviews.llvm.org/D95373



More information about the llvm-commits mailing list