Skip to content

Commit 9f448ad

Browse files
committed
Unify getStoredValues()
1 parent 324ea8b commit 9f448ad

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
@@ -2481,7 +2481,11 @@ class LLVM_ABI_FOR_TEST VPInterleaveBase : public VPRecipeBase {
24812481

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

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

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

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

0 commit comments

Comments
 (0)