[llvm] 4fa3b2a - [VPlan] Use TypeAnalysis instead of underlying instr in VPPredInst (NFC)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 12 12:56:16 PDT 2025


Author: Florian Hahn
Date: 2025-04-12T20:54:27+01:00
New Revision: 4fa3b2a1843c42f333d7332b373ae99428883974

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

LOG: [VPlan] Use TypeAnalysis instead of underlying instr in VPPredInst (NFC)

Removes another unnecessary use of the underlying instructions during
VPlan execution.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
index 981765a995a03..2cff343d915cf 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
@@ -2642,7 +2642,7 @@ void VPPredInstPHIRecipe::execute(VPTransformState &State) {
     if (vputils::onlyFirstLaneUsed(this) && !State.Lane->isFirstLane())
       return;
 
-    Type *PredInstType = getOperand(0)->getUnderlyingValue()->getType();
+    Type *PredInstType = State.TypeAnalysis.inferScalarType(getOperand(0));
     PHINode *Phi = State.Builder.CreatePHI(PredInstType, 2);
     Phi->addIncoming(PoisonValue::get(ScalarPredInst->getType()),
                      PredicatingBB);


        


More information about the llvm-commits mailing list