[llvm] [VPlan] Remove non-reductions after simplifications. (PR #176795)

via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 12 05:43:49 PST 2026


================
@@ -1510,6 +1510,11 @@ static void simplifyRecipe(VPSingleDefRecipe *Def, VPTypeAnalysis &TypeInfo) {
     return;
   }
 
+  VPIRValue *IRV;
+  if (Def->getNumOperands() == 1 &&
+      match(Def, m_ComputeReductionResult(m_VPIRValue(IRV))))
+    return Def->replaceAllUsesWith(IRV);
----------------
ayalz wrote:

Worth a comment, essentially checking if the operand of ComputeReductionResult is scalar, and relying on the underlying assumption that all IRValues are scalar.

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


More information about the llvm-commits mailing list