[llvm] [VPlan][NFC] Make VPValue pointer const. (PR #101334)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 31 06:57:56 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-transforms
Author: Mel Chen (Mel-Chen)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/101334.diff
2 Files Affected:
- (modified) llvm/lib/Transforms/Vectorize/VPlan.cpp (+1-1)
- (modified) llvm/lib/Transforms/Vectorize/VPlan.h (+3-3)
``````````diff
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp b/llvm/lib/Transforms/Vectorize/VPlan.cpp
index 58de6256900f0..2a9e4e12190cd 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp
@@ -1624,7 +1624,7 @@ VPValue *vputils::getOrCreateVPValueForSCEVExpr(VPlan &Plan, const SCEV *Expr,
return Expanded;
}
-bool vputils::isHeaderMask(VPValue *V, VPlan &Plan) {
+bool vputils::isHeaderMask(const VPValue *V, VPlan &Plan) {
if (isa<VPActiveLaneMaskPHIRecipe>(V))
return true;
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index c9da5e5d38a6b..e65184aba6c3f 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -3799,12 +3799,12 @@ VPValue *getOrCreateVPValueForSCEVExpr(VPlan &Plan, const SCEV *Expr,
ScalarEvolution &SE);
/// Returns true if \p VPV is uniform after vectorization.
-inline bool isUniformAfterVectorization(VPValue *VPV) {
+inline bool isUniformAfterVectorization(const VPValue *VPV) {
// A value defined outside the vector region must be uniform after
// vectorization inside a vector region.
if (VPV->isDefinedOutsideVectorRegions())
return true;
- VPRecipeBase *Def = VPV->getDefiningRecipe();
+ const VPRecipeBase *Def = VPV->getDefiningRecipe();
assert(Def && "Must have definition for value defined inside vector region");
if (auto Rep = dyn_cast<VPReplicateRecipe>(Def))
return Rep->isUniform();
@@ -3816,7 +3816,7 @@ inline bool isUniformAfterVectorization(VPValue *VPV) {
}
/// Return true if \p V is a header mask in \p Plan.
-bool isHeaderMask(VPValue *V, VPlan &Plan);
+bool isHeaderMask(const VPValue *V, VPlan &Plan);
} // end namespace vputils
} // end namespace llvm
``````````
</details>
https://github.com/llvm/llvm-project/pull/101334
More information about the llvm-commits
mailing list