[llvm] r241875 - Replace index-loops by range-based loops

Eli Bendersky eliben at google.com
Thu Jul 9 16:06:03 PDT 2015


Author: eliben
Date: Thu Jul  9 18:06:03 2015
New Revision: 241875

URL: http://llvm.org/viewvc/llvm-project?rev=241875&view=rev
Log:
Replace index-loops by range-based loops

NFC

Modified:
    llvm/trunk/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp

Modified: llvm/trunk/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp?rev=241875&r1=241874&r2=241875&view=diff
==============================================================================
--- llvm/trunk/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp (original)
+++ llvm/trunk/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp Thu Jul  9 18:06:03 2015
@@ -185,8 +185,7 @@ bool NVPTXLowerAggrCopies::runOnFunction
   //
   // Do the transformation of an aggr load/copy/set to a loop
   //
-  for (unsigned i = 0, e = aggrLoads.size(); i != e; ++i) {
-    LoadInst *load = aggrLoads[i];
+  for (LoadInst *load : aggrLoads) {
     StoreInst *store = dyn_cast<StoreInst>(*load->user_begin());
     Value *srcAddr = load->getOperand(0);
     Value *dstAddr = store->getOperand(1);
@@ -200,8 +199,7 @@ bool NVPTXLowerAggrCopies::runOnFunction
     load->eraseFromParent();
   }
 
-  for (unsigned i = 0, e = aggrMemcpys.size(); i != e; ++i) {
-    MemTransferInst *cpy = aggrMemcpys[i];
+  for (MemTransferInst *cpy : aggrMemcpys) {
     Value *len = cpy->getLength();
     // llvm 2.7 version of memcpy does not have volatile
     // operand yet. So always making it non-volatile
@@ -212,8 +210,7 @@ bool NVPTXLowerAggrCopies::runOnFunction
     cpy->eraseFromParent();
   }
 
-  for (unsigned i = 0, e = aggrMemsets.size(); i != e; ++i) {
-    MemSetInst *memsetinst = aggrMemsets[i];
+  for (MemSetInst *memsetinst : aggrMemsets) {
     Value *len = memsetinst->getLength();
     Value *val = memsetinst->getValue();
     convertMemSetToLoop(memsetinst, memsetinst->getDest(), len, val, Context,





More information about the llvm-commits mailing list