Skip to content

Commit 1640d51

Browse files
committed
[VPlan] Mark getUnrollPart argument as const (NFC).
1 parent 574fbdc commit 1640d51

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -906,10 +906,10 @@ template <unsigned PartOpIdx> class LLVM_ABI_FOR_TEST VPUnrollPartAccessor {
906906
protected:
907907
/// Return the VPValue operand containing the unroll part or null if there is
908908
/// no such operand.
909-
VPValue *getUnrollPartOperand(VPUser &U) const;
909+
VPValue *getUnrollPartOperand(const VPUser &U) const;
910910

911911
/// Return the unroll part.
912-
unsigned getUnrollPart(VPUser &U) const;
912+
unsigned getUnrollPart(const VPUser &U) const;
913913
};
914914

915915
/// Helper to manage IR metadata for recipes. It filters out metadata that
@@ -3486,7 +3486,7 @@ class LLVM_ABI_FOR_TEST VPScalarIVStepsRecipe : public VPRecipeWithIRFlags,
34863486

34873487
/// Return true if this VPScalarIVStepsRecipe corresponds to part 0. Note that
34883488
/// this is only accurate after the VPlan has been unrolled.
3489-
bool isPart0() { return getUnrollPart(*this) == 0; }
3489+
bool isPart0() const { return getUnrollPart(*this) == 0; }
34903490

34913491
VP_CLASSOF_IMPL(VPDef::VPScalarIVStepsSC)
34923492

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,14 +413,14 @@ void VPSingleDefRecipe::dump() const { VPDef::dump(); }
413413

414414
template <unsigned PartOpIdx>
415415
VPValue *
416-
VPUnrollPartAccessor<PartOpIdx>::getUnrollPartOperand(VPUser &U) const {
416+
VPUnrollPartAccessor<PartOpIdx>::getUnrollPartOperand(const VPUser &U) const {
417417
if (U.getNumOperands() == PartOpIdx + 1)
418418
return U.getOperand(PartOpIdx);
419419
return nullptr;
420420
}
421421

422422
template <unsigned PartOpIdx>
423-
unsigned VPUnrollPartAccessor<PartOpIdx>::getUnrollPart(VPUser &U) const {
423+
unsigned VPUnrollPartAccessor<PartOpIdx>::getUnrollPart(const VPUser &U) const {
424424
if (auto *UnrollPartOp = getUnrollPartOperand(U))
425425
return cast<ConstantInt>(UnrollPartOp->getLiveInIRValue())->getZExtValue();
426426
return 0;

0 commit comments

Comments
 (0)