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

via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 10 16:55:08 PDT 2024


================
@@ -273,8 +274,27 @@ VPInstruction::VPInstruction(unsigned Opcode,
   assert(isFPMathOp() && "this op can't take fast-math flags");
 }
 
-Value *VPInstruction::generateInstruction(VPTransformState &State,
-                                          unsigned Part) {
+bool VPInstruction::doesGenerateScalars() const {
+  return Opcode == VPInstruction::PtrAdd;
----------------
ayalz wrote:

This is a bit confusing: PtrAdd is (currently) the only VPInstruction that may generate multiple scalars - per lane, or a single scalar - per lane zero only, but there are other VPInstructions that generate a single scalar - per part.

Perhaps `doesGeneratePerLane()` would be more accurate, or `doesGeneratePerAllLanes()`? See below.

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


More information about the llvm-commits mailing list