[PATCH] D143578: [VP] Add vp.powi and a pass for expanding vp.powi before DAG.

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 15 14:52:18 PDT 2023


reames added a comment.

In D143578#4142322 <https://reviews.llvm.org/D143578#4142322>, @craig.topper wrote:

> How would we expand the other math functions? Many of them are large and probably difficult to keep in vector form. We could scalarize them with a loop and use scalar libcalls.

I want to second this point.  I think doing the fancy expansion here is a bad idea at this time.  We can come back to that, but an initial implementation should scalarize via a loop.  The lowering works for all of the lane-wise math routines.  Only once we have correct lowering for the majority of the routines should we bother optimizing any of them.

Even then, I'm not convinced that inlining this loop is profitable over generating a runtime call to a new routine.



================
Comment at: llvm/lib/CodeGen/ExpandPowi.cpp:35
+  IRBuilder<> Builder(I);
+  Type *Int32Ty = Type::getInt32Ty(I->getContext());
+  Value *VScale = Builder.CreateIntrinsic(Int32Ty, Intrinsic::vscale, {});
----------------
This appears to correspond to the recently introduced IRBuilder::CreateElementCount.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143578



More information about the llvm-commits mailing list