[PATCH] D117735: [LoopPeel] Pass TripCount to computePeelCount by value instead of by reference. NFC

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 19 17:26:10 PST 2022


craig.topper created this revision.
craig.topper added reviewers: fhahn, reames.
Herald added a subscriber: hiraditya.
craig.topper requested review of this revision.
Herald added a project: LLVM.

The TripCount is not modified by the function so it doesn't need
to be passed by reference. Verified by passing it as const reference
before changing to value.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117735

Files:
  llvm/include/llvm/Transforms/Utils/LoopPeel.h
  llvm/lib/Transforms/Utils/LoopPeel.cpp


Index: llvm/lib/Transforms/Utils/LoopPeel.cpp
===================================================================
--- llvm/lib/Transforms/Utils/LoopPeel.cpp
+++ llvm/lib/Transforms/Utils/LoopPeel.cpp
@@ -359,7 +359,7 @@
 // Return the number of iterations we want to peel off.
 void llvm::computePeelCount(Loop *L, unsigned LoopSize,
                             TargetTransformInfo::PeelingPreferences &PP,
-                            unsigned &TripCount, DominatorTree &DT,
+                            unsigned TripCount, DominatorTree &DT,
                             ScalarEvolution &SE, unsigned Threshold) {
   assert(LoopSize > 0 && "Zero loop size is not allowed!");
   // Save the PP.PeelCount value set by the target in
Index: llvm/include/llvm/Transforms/Utils/LoopPeel.h
===================================================================
--- llvm/include/llvm/Transforms/Utils/LoopPeel.h
+++ llvm/include/llvm/Transforms/Utils/LoopPeel.h
@@ -32,7 +32,7 @@
 
 void computePeelCount(Loop *L, unsigned LoopSize,
                       TargetTransformInfo::PeelingPreferences &PP,
-                      unsigned &TripCount, DominatorTree &DT,
+                      unsigned TripCount, DominatorTree &DT,
                       ScalarEvolution &SE, unsigned Threshold = UINT_MAX);
 
 } // end namespace llvm


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117735.401452.patch
Type: text/x-patch
Size: 1321 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220120/cf885665/attachment.bin>


More information about the llvm-commits mailing list