[PATCH] D124718: [VPlan] Do not create VPWidenCall recipes for scalar vector factors.
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 2 11:49:02 PDT 2022
fhahn marked 2 inline comments as done.
fhahn added a comment.
Thanks Ayal!
================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:8331
auto willWiden = [&](ElementCount VF) -> bool {
Intrinsic::ID ID = getVectorIntrinsicIDForCall(CI, TLI);
----------------
Ayal wrote:
> 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.)
I added the early exit to `willWiden` to start with. We could add this as general check at the start of `tryToWiden` as follow up?
================
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]]>
----------------
Ayal wrote:
> nit: retain dumping of callee name as in `call @llvm.smin.i32(...)` rather than as an operand `, ir<@llvm.smin.i32>`?
Thanks, I'll put up a separate patch for that!
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