[llvm] 69d9bb2 - [VPlan] Check recipe uses instead of type of underlying instr (NFC).

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 11 04:25:46 PDT 2022


Author: Florian Hahn
Date: 2022-09-11T12:24:44+01:00
New Revision: 69d9bb2aade39c76de9d6da9e2383377852e4d73

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

LOG: [VPlan] Check recipe uses instead of type of underlying instr (NFC).

Suggested by @Ayal post-commit, to reduce the dependence on the
underlying instruction in favor of information available directly for
the recipe.

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 a13ea90e48caf..792ae261b17a3 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -9647,7 +9647,7 @@ void VPReplicateRecipe::execute(VPTransformState &State) {
         all_of(operands(), [](VPValue *Op) { return !Op->getDef(); })) {
       State.ILV->scalarizeInstruction(UI, this, VPIteration(0, 0), IsPredicated,
                                       State);
-      if (!UI->getType()->isVoidTy()) {
+      if (user_begin() != user_end()) {
         for (unsigned Part = 1; Part < State.UF; ++Part)
           State.set(this, State.get(this, VPIteration(0, 0)),
                     VPIteration(Part, 0));


        


More information about the llvm-commits mailing list