[llvm] c1ca4a5 - [VPlan] Strip redundant code in VPTransformState::get (NFC) (#166145)

via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 5 13:59:51 PST 2025


Author: Ramkumar Ramachandra
Date: 2025-11-05T21:59:47Z
New Revision: c1ca4a55d41b8edf4ce4af7a18db537bf3bf4406

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

LOG: [VPlan] Strip redundant code in VPTransformState::get (NFC) (#166145)

vputils::isSingleScalar is sufficient.

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/VPlan.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp b/llvm/lib/Transforms/Vectorize/VPlan.cpp
index 428a8f4c1348f..dd26a059d56ad 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp
@@ -304,18 +304,7 @@ Value *VPTransformState::get(const VPValue *Def, bool NeedsScalar) {
   }
 
   bool IsSingleScalar = vputils::isSingleScalar(Def);
-
   VPLane LastLane(IsSingleScalar ? 0 : VF.getFixedValue() - 1);
-  // Check if there is a scalar value for the selected lane.
-  if (!hasScalarValue(Def, LastLane)) {
-    // At the moment, VPWidenIntOrFpInductionRecipes, VPScalarIVStepsRecipes and
-    // VPExpandSCEVRecipes can also be a single scalar.
-    assert((isa<VPWidenIntOrFpInductionRecipe, VPScalarIVStepsRecipe,
-                VPExpandSCEVRecipe>(Def->getDefiningRecipe())) &&
-           "unexpected recipe found to be invariant");
-    IsSingleScalar = true;
-    LastLane = 0;
-  }
 
   // We need to construct the vector value for a single-scalar value by
   // broadcasting the scalar to all lanes.


        


More information about the llvm-commits mailing list