[llvm] [VPlan] Explicitly handle scalar pointer inductions. (PR #83068)

Kolya Panchenko via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 13 11:26:29 PDT 2024


================
@@ -511,17 +550,32 @@ void VPInstruction::execute(VPTransformState &State) {
          "Recipe not a FPMathOp but has fast-math flags?");
   if (hasFastMathFlags())
     State.Builder.setFastMathFlags(getFastMathFlags());
+  State.Builder.SetCurrentDebugLocation(getDebugLoc());
+  bool OnlyGenerateFirstLane =
+      canGenerateScalarForFirstLane() &&
+      (vputils::onlyFirstLaneUsed(this) ||
+       getOpcode() == VPInstruction::ComputeReductionResult);
   for (unsigned Part = 0; Part < State.UF; ++Part) {
-    Value *GeneratedValue = generateInstruction(State, Part);
+    if (doesGeneratePerAllLanes()) {
----------------
nikolaypanchenko wrote:

even though it's not expensive check, but is worth to hoist it out

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


More information about the llvm-commits mailing list