[PATCH] D71815: [AMDGPU] Fixes -Wrange-loop-analysis warnings

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


This revision was automatically updated to reflect the committed changes.
Closed by commit rG2d903cc9656d: [AMDGPU] Fixes -Wrange-loop-analysis warnings (authored by Mordante).

Changed prior to commit:
  https://reviews.llvm.org/D71815?vs=235059&id=235068#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71815/new/

https://reviews.llvm.org/D71815

Files:
  llvm/lib/Target/AMDGPU/AMDGPUMachineCFGStructurizer.cpp
  llvm/lib/Target/AMDGPU/AMDGPUUnifyMetadata.cpp


Index: llvm/lib/Target/AMDGPU/AMDGPUUnifyMetadata.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/AMDGPUUnifyMetadata.cpp
+++ llvm/lib/Target/AMDGPU/AMDGPUUnifyMetadata.cpp
@@ -61,7 +61,7 @@
         return false;
       MDNode *MaxMD = nullptr;
       auto MaxVer = 0U;
-      for (const auto &VersionMD : NamedMD->operands()) {
+      for (auto VersionMD : NamedMD->operands()) {
         assert(VersionMD->getNumOperands() == 2);
         auto CMajor = mdconst::extract<ConstantInt>(VersionMD->getOperand(0));
         auto VersionMajor = CMajor->getZExtValue();
@@ -94,7 +94,7 @@
       return false;
 
     SmallVector<Metadata *, 4> All;
-    for (const auto &MD : NamedMD->operands())
+    for (auto MD : NamedMD->operands())
       for (const auto &Op : MD->operands())
         if (std::find(All.begin(), All.end(), Op.get()) == All.end())
           All.push_back(Op.get());
Index: llvm/lib/Target/AMDGPU/AMDGPUMachineCFGStructurizer.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/AMDGPUMachineCFGStructurizer.cpp
+++ llvm/lib/Target/AMDGPU/AMDGPUMachineCFGStructurizer.cpp
@@ -862,7 +862,7 @@
 void LinearizedRegion::print(raw_ostream &OS, const TargetRegisterInfo *TRI) {
   OS << "Linearized Region {";
   bool IsFirst = true;
-  for (const auto &MBB : MBBs) {
+  for (auto MBB : MBBs) {
     if (IsFirst) {
       IsFirst = false;
     } else {
@@ -996,7 +996,7 @@
 void LinearizedRegion::addMBB(MachineBasicBlock *MBB) { MBBs.insert(MBB); }
 
 void LinearizedRegion::addMBBs(LinearizedRegion *InnerRegion) {
-  for (const auto &MBB : InnerRegion->MBBs) {
+  for (auto MBB : InnerRegion->MBBs) {
     addMBB(MBB);
   }
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71815.235068.patch
Type: text/x-patch
Size: 1739 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191222/4cf41ed8/attachment.bin>


More information about the llvm-commits mailing list