[llvm] [VPlan] Simplify VPBlendRecipes to select instructions (PR #133993)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 8 03:05:00 PDT 2025


================
@@ -7047,6 +7047,13 @@ static bool planContainsAdditionalSimplifications(VPlan &Plan,
       if (isa<VPPartialReductionRecipe>(&R))
         return true;
 
+      // VPBlendRecipes are converted to selects and may have been simplified.
+      using namespace VPlanPatternMatch;
+      if (match(&R, m_VPInstruction<Instruction::Select>(
+                        m_VPValue(), m_VPValue(), m_VPValue())) &&
+          isa_and_nonnull<PHINode>(R.getVPSingleValue()->getUnderlyingValue()))
----------------
lukel97 wrote:

I pushed 4911b73a3262ba31b9c868c53ce021b4af3e936f to do this but then it turns out getUnderlyingInstr calls cast<> which asserts on null, so I had to revert it in 78c3a086c64c974519847a53ba83a27eb253360d

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


More information about the llvm-commits mailing list