[PATCH] D124718: [VPlan] Do not create VPWidenCall recipes for scalar vector factors.

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 2 04:50:56 PDT 2022


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

Looks good to me, adding a couple of nits.



================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:8331
 
   auto willWiden = [&](ElementCount VF) -> bool {
     Intrinsic::ID ID = getVectorIntrinsicIDForCall(CI, TLI);
----------------
Early exit here as done in tryToWidenMemory's willWiden?

```
     if (VF.isScalar())
       return false;
```

(Perhaps recipe creation for VF.isScalar() should be handled more systematically rather than individually by each try-to-widen/will-widen.)


================
Comment at: llvm/test/Transforms/LoopVectorize/interleave-with-call.ll:15
 ; CHECK-NEXT:     vp<[[IV_STEPS:%.]]>    = SCALAR-STEPS vp<[[CAN_IV]]>, ir<%start>, ir<1>
-; CHECK-NEXT:     WIDEN-CALL ir<%min> = call @llvm.smin.i32(vp<[[IV_STEPS]]>, ir<65535>)
+; CHECK-NEXT:     CLONE ir<%min> = call vp<[[IV_STEPS]]>, ir<65535>, ir<@llvm.smin.i32>
 ; CHECK-NEXT:     CLONE ir<%arrayidx> = getelementptr ir<%dst>, vp<[[IV_STEPS]]>
----------------
nit: retain dumping of callee name as in `call @llvm.smin.i32(...)` rather than as an operand `, ir<@llvm.smin.i32>`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124718



More information about the llvm-commits mailing list