[llvm] [VPlan] Model FOR extract of exit value in VPlan. (PR #93395)

via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 2 14:16:29 PDT 2024


================
@@ -558,6 +560,29 @@ Value *VPInstruction::generatePerPart(VPTransformState &State, unsigned Part) {
 
     return ReducedPartRdx;
   }
+  case VPInstruction::ExtractFromEnd: {
+    if (Part != 0)
+      return State.get(this, 0, /*IsScalar*/ true);
+
+    auto *CI = cast<ConstantInt>(getOperand(1)->getLiveInIRValue());
----------------
ayalz wrote:

Document somewhere that 2nd operand of ExtractFromEnd must be a constant, either 1 or 2.

This patch exercises Offset = 2 and follow-up https://github.com/llvm/llvm-project/pull/93396 exercises Offset = 1.

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


More information about the llvm-commits mailing list