Skip to content

Commit 5e49ce5

Browse files
committed
Unify getStoredValues()
1 parent 426977a commit 5e49ce5

File tree

1 file changed

+5
-15
lines changed
  • llvm/lib/Transforms/Vectorize

1 file changed

+5
-15
lines changed

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2482,7 +2482,11 @@ class LLVM_ABI_FOR_TEST VPInterleaveBase : public VPRecipeBase {
24822482

24832483
/// Return the VPValues stored by this interleave group. If it is a load
24842484
/// interleave group, return an empty ArrayRef.
2485-
virtual ArrayRef<VPValue *> getStoredValues() const = 0;
2485+
ArrayRef<VPValue *> getStoredValues() const {
2486+
return ArrayRef<VPValue *>(op_end() -
2487+
(getNumStoreOperands() + (HasMask ? 1 : 0)),
2488+
getNumStoreOperands());
2489+
}
24862490
};
24872491

24882492
/// VPInterleaveRecipe is a recipe for transforming an interleave group of load
@@ -2524,13 +2528,6 @@ class LLVM_ABI_FOR_TEST VPInterleaveRecipe final : public VPInterleaveBase {
25242528
unsigned getNumStoreOperands() const override {
25252529
return getNumOperands() - (HasMask ? 2 : 1);
25262530
}
2527-
2528-
ArrayRef<VPValue *> getStoredValues() const override {
2529-
// The first operand is the address, followed by the stored values, followed
2530-
// by an optional mask.
2531-
return ArrayRef<VPValue *>(op_begin(), getNumOperands())
2532-
.slice(1, getNumStoreOperands());
2533-
}
25342531
};
25352532

25362533
/// A recipe for interleaved access operations with vector-predication
@@ -2580,13 +2577,6 @@ class LLVM_ABI_FOR_TEST VPInterleaveEVLRecipe final : public VPInterleaveBase {
25802577
unsigned getNumStoreOperands() const override {
25812578
return getNumOperands() - (HasMask ? 3 : 2);
25822579
}
2583-
2584-
ArrayRef<VPValue *> getStoredValues() const override {
2585-
// The first operand is the address, and the second operand is EVL, followed
2586-
// by the stored values, followe by an optional mask.
2587-
return ArrayRef<VPValue *>(op_begin(), getNumOperands())
2588-
.slice(2, getNumStoreOperands());
2589-
}
25902580
};
25912581

25922582
/// A recipe to represent inloop reduction operations, performing a reduction on

0 commit comments

Comments
 (0)