aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Hahn <flo@fhahn.com>2025-07-25 10:49:33 +0100
committerFlorian Hahn <flo@fhahn.com>2025-07-25 10:49:33 +0100
commit1640d51bf876685783b89f91668ca5b91ede22f4 (patch)
tree1d154c05d3dc771a2e04545c7232bba810d1907e
parent574fbdc19f77b4a4294978adfb153a850503c582 (diff)
downloadllvm-1640d51bf876685783b89f91668ca5b91ede22f4.zip
llvm-1640d51bf876685783b89f91668ca5b91ede22f4.tar.gz
llvm-1640d51bf876685783b89f91668ca5b91ede22f4.tar.bz2
[VPlan] Mark getUnrollPart argument as const (NFC).
-rw-r--r--llvm/lib/Transforms/Vectorize/VPlan.h6
-rw-r--r--llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp4
2 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index 9b67b7d..6655149 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -906,10 +906,10 @@ template <unsigned PartOpIdx> class LLVM_ABI_FOR_TEST VPUnrollPartAccessor {
protected:
/// Return the VPValue operand containing the unroll part or null if there is
/// no such operand.
- VPValue *getUnrollPartOperand(VPUser &U) const;
+ VPValue *getUnrollPartOperand(const VPUser &U) const;
/// Return the unroll part.
- unsigned getUnrollPart(VPUser &U) const;
+ unsigned getUnrollPart(const VPUser &U) const;
};
/// Helper to manage IR metadata for recipes. It filters out metadata that
@@ -3486,7 +3486,7 @@ public:
/// Return true if this VPScalarIVStepsRecipe corresponds to part 0. Note that
/// this is only accurate after the VPlan has been unrolled.
- bool isPart0() { return getUnrollPart(*this) == 0; }
+ bool isPart0() const { return getUnrollPart(*this) == 0; }
VP_CLASSOF_IMPL(VPDef::VPScalarIVStepsSC)
diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
index b2066ce..0d6152b 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
@@ -413,14 +413,14 @@ void VPSingleDefRecipe::dump() const { VPDef::dump(); }
template <unsigned PartOpIdx>
VPValue *
-VPUnrollPartAccessor<PartOpIdx>::getUnrollPartOperand(VPUser &U) const {
+VPUnrollPartAccessor<PartOpIdx>::getUnrollPartOperand(const VPUser &U) const {
if (U.getNumOperands() == PartOpIdx + 1)
return U.getOperand(PartOpIdx);
return nullptr;
}
template <unsigned PartOpIdx>
-unsigned VPUnrollPartAccessor<PartOpIdx>::getUnrollPart(VPUser &U) const {
+unsigned VPUnrollPartAccessor<PartOpIdx>::getUnrollPart(const VPUser &U) const {
if (auto *UnrollPartOp = getUnrollPartOperand(U))
return cast<ConstantInt>(UnrollPartOp->getLiveInIRValue())->getZExtValue();
return 0;