[llvm] [VPlan] Optimize FindLast of (binop %IV, live-in) by sinking. (PR #183911)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 29 12:16:48 PDT 2026
================
@@ -5692,6 +5672,39 @@ void VPlanTransforms::addExitUsersForFirstOrderRecurrences(VPlan &Plan,
}
}
+/// Check if \p V is a binary expression of a widened IV and a loop-invariant
+/// value. Returns the widened IV if found, nullptr otherwise.
+static VPWidenIntOrFpInductionRecipe *getExpressionIV(VPValue *V) {
+ auto *BinOp = dyn_cast<VPWidenRecipe>(V);
+ if (!BinOp || !Instruction::isBinaryOp(BinOp->getOpcode()))
+ return nullptr;
+
+ VPValue *Op0 = BinOp->getOperand(0);
+ VPValue *Op1 = BinOp->getOperand(1);
----------------
fhahn wrote:
updated thanks!
https://github.com/llvm/llvm-project/pull/183911
More information about the llvm-commits
mailing list