[llvm] 1b344e7 - [PowerPC] Fixes -Wrange-loop-analysis warnings

Mark de Wever via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 22 10:24:25 PST 2019


Author: Mark de Wever
Date: 2019-12-22T19:23:57+01:00
New Revision: 1b344e7967a7bb6ebcd71977eb5f8c47b8a92448

URL: https://github.com/llvm/llvm-project/commit/1b344e7967a7bb6ebcd71977eb5f8c47b8a92448
DIFF: https://github.com/llvm/llvm-project/commit/1b344e7967a7bb6ebcd71977eb5f8c47b8a92448.diff

LOG: [PowerPC] Fixes -Wrange-loop-analysis warnings

This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.

Differential Revision: https://reviews.llvm.org/D71811

Added: 
    

Modified: 
    llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp b/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
index 467a119f1f61..b761f337533b 100644
--- a/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
+++ b/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
@@ -550,7 +550,7 @@ bool PPCLoopInstrFormPrep::rewriteLoadStores(Loop *L, Bucket &BucketChain,
 
   // Note that LoopPredecessor might occur in the predecessor list multiple
   // times, and we need to add it the right number of times.
-  for (const auto &PI : predecessors(Header)) {
+  for (auto PI : predecessors(Header)) {
     if (PI != LoopPredecessor)
       continue;
 
@@ -565,7 +565,7 @@ bool PPCLoopInstrFormPrep::rewriteLoadStores(Loop *L, Bucket &BucketChain,
         I8Ty, NewPHI, BasePtrIncSCEV->getValue(),
         getInstrName(MemI, GEPNodeIncNameSuffix), InsPoint);
     cast<GetElementPtrInst>(PtrInc)->setIsInBounds(IsPtrInBounds(BasePtr));
-    for (const auto &PI : predecessors(Header)) {
+    for (auto PI : predecessors(Header)) {
       if (PI == LoopPredecessor)
         continue;
 
@@ -580,7 +580,7 @@ bool PPCLoopInstrFormPrep::rewriteLoadStores(Loop *L, Bucket &BucketChain,
   } else {
     // Note that LoopPredecessor might occur in the predecessor list multiple
     // times, and we need to make sure no more incoming value for them in PHI.
-    for (const auto &PI : predecessors(Header)) {
+    for (auto PI : predecessors(Header)) {
       if (PI == LoopPredecessor)
         continue;
 


        


More information about the llvm-commits mailing list