[llvm] a6e70e4 - [VPlan] VPInterleaveRecipe only requires the first lane of the address.

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 17 04:56:55 PDT 2022


Author: Florian Hahn
Date: 2022-03-17T11:56:43Z
New Revision: a6e70e4056dff962ec634c5bd4f2f4105a0bef71

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

LOG: [VPlan] VPInterleaveRecipe only requires the first lane of the address.

VPInterleaveRecipe only uses the first lane of the address. Add
onlyFirstLaneUsed implementation. This is needed for a follow-up patch.

Reviewed By: Ayal

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index 432fb3161bfa0..a771346f2262b 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -1461,6 +1461,13 @@ class VPInterleaveRecipe : public VPRecipeBase {
   unsigned getNumStoreOperands() const {
     return getNumOperands() - (HasMask ? 2 : 1);
   }
+
+  /// The recipe only uses the first lane of the address.
+  bool onlyFirstLaneUsed(const VPValue *Op) const override {
+    assert(is_contained(operands(), Op) &&
+           "Op must be an operand of the recipe");
+    return Op == getAddr();
+  }
 };
 
 /// A recipe to represent inloop reduction operations, performing a reduction on


        


More information about the llvm-commits mailing list