[PATCH] D77011: [AMDGPU] Drop const for value that is copied (NFC_.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 29 05:50:54 PDT 2020


fhahn created this revision.
fhahn added a reviewer: rampitec.
Herald added subscribers: kerbowa, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng, jvesely, kzhuravl, arsenm.
Herald added a project: LLVM.

This fixes

warning: loop variable 'Def' of type 'const llvm::Register' creates a copy from type 'const llvm::Register' [-Wrange-loop-analysis]

llvm::Register just contains a single unsigned and should be copied.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77011

Files:
  llvm/lib/Target/AMDGPU/SIPostRABundler.cpp


Index: llvm/lib/Target/AMDGPU/SIPostRABundler.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/SIPostRABundler.cpp
+++ llvm/lib/Target/AMDGPU/SIPostRABundler.cpp
@@ -76,7 +76,7 @@
     if (!Op.isReg())
       continue;
     Register Reg = Op.getReg();
-    for (const Register Def : Defs)
+    for (Register Def : Defs)
       if (TRI->regsOverlap(Reg, Def))
         return true;
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77011.253413.patch
Type: text/x-patch
Size: 436 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200329/1ffe3dba/attachment-0001.bin>


More information about the llvm-commits mailing list