[llvm] 3444240 - [VPlan] Mark vputils::onlyFirstPartUsed arg as const (NFC)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 3 07:59:31 PST 2024


Author: Florian Hahn
Date: 2024-02-03T15:59:09Z
New Revision: 3444240540b0b36902dc8b9b11339b8969f7bca9

URL: https://github.com/llvm/llvm-project/commit/3444240540b0b36902dc8b9b11339b8969f7bca9
DIFF: https://github.com/llvm/llvm-project/commit/3444240540b0b36902dc8b9b11339b8969f7bca9.diff

LOG: [VPlan] Mark vputils::onlyFirstPartUsed arg as const (NFC)

Split off https://github.com/llvm/llvm-project/pull/80269 as
suggested.

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/VPlan.cpp
    llvm/lib/Transforms/Vectorize/VPlan.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp b/llvm/lib/Transforms/Vectorize/VPlan.cpp
index 06481b6955a1a..2c0daa82afa59 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp
@@ -1402,9 +1402,9 @@ bool vputils::onlyFirstLaneUsed(const VPValue *Def) {
                 [Def](const VPUser *U) { return U->onlyFirstLaneUsed(Def); });
 }
 
-bool vputils::onlyFirstPartUsed(VPValue *Def) {
+bool vputils::onlyFirstPartUsed(const VPValue *Def) {
   return all_of(Def->users(),
-                [Def](VPUser *U) { return U->onlyFirstPartUsed(Def); });
+                [Def](const VPUser *U) { return U->onlyFirstPartUsed(Def); });
 }
 
 VPValue *vputils::getOrCreateVPValueForSCEVExpr(VPlan &Plan, const SCEV *Expr,

diff  --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index 129fe4dd83ce0..ce86096f1a97b 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -3391,7 +3391,7 @@ namespace vputils {
 bool onlyFirstLaneUsed(const VPValue *Def);
 
 /// Returns true if only the first part of \p Def is used.
-bool onlyFirstPartUsed(VPValue *Def);
+bool onlyFirstPartUsed(const VPValue *Def);
 
 /// Get or create a VPValue that corresponds to the expansion of \p Expr. If \p
 /// Expr is a SCEVConstant or SCEVUnknown, return a VPValue wrapping the live-in


        


More information about the llvm-commits mailing list