[llvm] 541ca12 - [LV] Use VPReplicateRecipe::isUniform instead isUniformAfterVec (NFCI).

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 6 08:40:52 PST 2022


Author: Florian Hahn
Date: 2022-02-06T16:37:20Z
New Revision: 541ca12dcd7c4aaefdeab810f7a82dfd60c682c2

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

LOG: [LV] Use VPReplicateRecipe::isUniform instead isUniformAfterVec (NFCI).

In scalarizeInstruction(), isUniformAfterVectorization is used to detect
cases where it is sufficient to always access the first lane. This
should map directly checking whether the operand is a uniform replicate
recipe.

Differential Revision: https://reviews.llvm.org/D116654

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 21c16f07e2377..bfe08d42c8832 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -2945,7 +2945,8 @@ void InnerLoopVectorizer::scalarizeInstruction(Instruction *Instr,
   for (auto &I : enumerate(RepRecipe->operands())) {
     auto InputInstance = Instance;
     VPValue *Operand = I.value();
-    if (State.Plan->isUniformAfterVectorization(Operand))
+    VPReplicateRecipe *OperandR = dyn_cast<VPReplicateRecipe>(Operand);
+    if (OperandR && OperandR->isUniform())
       InputInstance.Lane = VPLane::getFirstLane();
     Cloned->setOperand(I.index(), State.get(Operand, InputInstance));
   }


        


More information about the llvm-commits mailing list