[llvm] [LV] Vectorize selecting last IV of min/max element. (PR #141431)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 21 08:01:07 PST 2025
================
@@ -818,13 +818,13 @@ void VPlanTransforms::addMinimumVectorEpilogueIterationCheck(
Branch->setMetadata(LLVMContext::MD_prof, BranchWeights);
}
-/// If \p RedPhiR is used by a ComputeReductionResult recipe, return it.
-/// Otherwise return nullptr.
-static VPInstruction *
-findComputeReductionResult(VPReductionPHIRecipe *RedPhiR) {
- auto It = find_if(RedPhiR->users(), [](VPUser *U) {
+/// If \p RedPhiR is used by a VPInstruction with \p Opcode, return it.
+/// Otherwise return nullptr;
+static VPInstruction *findReductionUser(VPReductionPHIRecipe *RedPhiR,
+ unsigned Opcode) {
+ auto It = find_if(RedPhiR->users(), [Opcode](VPUser *U) {
auto *VPI = dyn_cast<VPInstruction>(U);
- return VPI && VPI->getOpcode() == VPInstruction::ComputeReductionResult;
+ return VPI && VPI->getOpcode() == Opcode;
----------------
ayalz wrote:
Can this be simplified using `match`?
https://github.com/llvm/llvm-project/pull/141431
More information about the llvm-commits
mailing list