[llvm] [VPlan] Ignore incoming values with constant false mask. (PR #89384)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 21 14:07:02 PDT 2024
================
@@ -884,18 +884,19 @@ void VPlanTransforms::clearReductionWrapFlags(VPlan &Plan) {
/// Try to simplify recipe \p R.
static void simplifyRecipe(VPRecipeBase &R, VPTypeAnalysis &TypeInfo) {
+ using namespace llvm::VPlanPatternMatch;
// Try to remove redundant blend recipes.
if (auto *Blend = dyn_cast<VPBlendRecipe>(&R)) {
VPValue *Inc0 = Blend->getIncomingValue(0);
for (unsigned I = 1; I != Blend->getNumIncomingValues(); ++I)
- if (Inc0 != Blend->getIncomingValue(I))
+ if (Inc0 != Blend->getIncomingValue(I) &&
+ !match(Blend->getMask(I), m_False()))
----------------
ayalz wrote:
This is fine, but could be more general: first filter all operands having false masks by replacing the original blend with a simpler blend, then apply the existing check if all operands are the same? May deserve additional tests.
https://github.com/llvm/llvm-project/pull/89384
More information about the llvm-commits
mailing list