[llvm] f1ba44f - [VPlan] Strip dead code in cst live-in match (NFC) (#159589)

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 18 11:28:45 PDT 2025


Author: Ramkumar Ramachandra
Date: 2025-09-18T19:28:42+01:00
New Revision: f1ba44f50a07fbc559e3c40308623dd6b6ab2c47

URL: https://github.com/llvm/llvm-project/commit/f1ba44f50a07fbc559e3c40308623dd6b6ab2c47
DIFF: https://github.com/llvm/llvm-project/commit/f1ba44f50a07fbc559e3c40308623dd6b6ab2c47.diff

LOG: [VPlan] Strip dead code in cst live-in match (NFC) (#159589)

A live-in constant can never be of vector type.

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/VPlanPatternMatch.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VPlanPatternMatch.h b/llvm/lib/Transforms/Vectorize/VPlanPatternMatch.h
index fcab11b1917e0..2a6191e1d7ed4 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanPatternMatch.h
+++ b/llvm/lib/Transforms/Vectorize/VPlanPatternMatch.h
@@ -108,11 +108,8 @@ template <typename Pred, unsigned BitWidth = 0> struct int_pred_ty {
     Value *V = VPV->getLiveInIRValue();
     if (!V)
       return false;
+    assert(!V->getType()->isVectorTy() && "Unexpected vector live-in");
     const auto *CI = dyn_cast<ConstantInt>(V);
-    if (!CI && V->getType()->isVectorTy())
-      if (const auto *C = dyn_cast<Constant>(V))
-        CI = dyn_cast_or_null<ConstantInt>(
-            C->getSplatValue(/*AllowPoison=*/false));
     if (!CI)
       return false;
 


        


More information about the llvm-commits mailing list