[PATCH] D107284: [LoopVectorize] Add support for replication of more intrinsics with scalable vectors

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 4 09:15:34 PDT 2021


sdesmalen accepted this revision.
sdesmalen added a comment.
This revision is now accepted and ready to land.

Thanks @david-arm. LGTM with nits addressed!



================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:5432-5433
+      if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(&I)) {
+        Intrinsic::ID ID = getVectorIntrinsicIDForCall(II, TLI);
+        switch (ID) {
+        case Intrinsic::sideeffect:
----------------
nit: this can be:

   switch (II->getIntrinsicID()) {

There is no need for `getVectorIntrinsicIDForCall`


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:8966-8967
+  if (!IsUniform && isa<IntrinsicInst>(I)) {
+    Intrinsic::ID ID = getVectorIntrinsicIDForCall(cast<IntrinsicInst>(I), TLI);
+    switch (ID) {
+    case Intrinsic::assume:
----------------
nit:  same comment about using `cast<IntrinsicInst>(I)->getIntrinsicID()`


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:8986
+      //      remove the call.
+      IsUniform = Range.Start.isScalable();
+    default:
----------------
nit: maybe move this condition to the if-statement, and set `IsUniform = true` directly?


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

https://reviews.llvm.org/D107284



More information about the llvm-commits mailing list