[llvm] [VPlan] Improve code in (Call|Intrinsic)::execute (NFC) (PR #203092)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 16 12:50:27 PDT 2026


================
@@ -2157,16 +2152,13 @@ CallInst *VPWidenIntrinsicRecipe::createVectorCall(VPTransformState &State) {
     }
   }
   SmallVector<Value *, 4> Args;
-  for (const auto &I : enumerate(operands())) {
+  for (const auto &[Idx, Op] : enumerate(operands())) {
     // Some intrinsics have a scalar argument - don't replace it with a
     // vector.
-    Value *Arg;
-    if (isVectorIntrinsicWithScalarOpAtArg(VectorIntrinsicID, I.index(),
-                                           State.TTI))
-      Arg = State.get(I.value(), VPLane(0));
-    else
-      Arg = State.get(I.value(), usesFirstLaneOnly(I.value()));
-    if (isVectorIntrinsicWithOverloadTypeAtArg(VectorIntrinsicID, I.index(),
+    Value *Arg = State.get(Op, isVectorIntrinsicWithScalarOpAtArg(
----------------
fhahn wrote:

same as above, would probably be clearer to either keep the check or move out to a variable

https://github.com/llvm/llvm-project/pull/203092


More information about the llvm-commits mailing list