[llvm] [VPlan] Simplify pow-of-2 (mul|udiv) -> (shl|lshr) (PR #172477)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 5 04:12:49 PST 2026


================
@@ -290,12 +290,8 @@ struct Recipe_match {
     if ((!matchRecipeAndOpcode<RecipeTys>(R) && ...))
       return false;
 
-    if (R->getNumOperands() != std::tuple_size<Ops_t>::value) {
-      assert(Opcode == Instruction::PHI &&
-             "non-variadic recipe with matched opcode does not have the "
-             "expected number of operands");
+    if (R->getNumOperands() != std::tuple_size<Ops_t>::value)
       return false;
-    }
----------------
fhahn wrote:

It should be fine to match predicated instructions here as well, but would be good to make sure we still have the expected number of ops, by checking if the recipe is predicated?

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


More information about the llvm-commits mailing list