[PATCH] D156439: [TLI][AArch64] Extend ReplaceWithVeclib to replace vector FREM instructions for scalable vectors

Jolanta Jensen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 2 08:23:59 PDT 2023


jolanta.jensen added inline comments.


================
Comment at: llvm/lib/CodeGen/ReplaceWithVeclib.cpp:59
+             "Must be a FRem instruction.");
+      assert((NumElements != nullptr && ElementType != nullptr) &&
+             "Vectorization factor or element type missing.");
----------------
jolanta.jensen wrote:
> mgabka wrote:
> > the NumElements and ElementType you can obtain from the Frem instruction return tyoe, so you do not need to pass it as arguments to this function and you can remove this assert as well.
> I would need to do a cast similar way as I do in replaceFremWithCallToVeclib, i.e. something like (dyn_cast<ScalableVectorType>(I.getType()))->getElementCount() and I would need a variable for it in the whole function scope even if only frem is using it. I think it's less fuss to send it as argument. But if you think it's better to obtain it from Frem instruction anyway, I'll change.  
> I realized I do not use ElementType and I removed it.
Fixed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156439



More information about the llvm-commits mailing list