[PATCH] D26993: [StructurizeCFG] Use a for-each loop instead of iterators in runOnRegion.
Justin Lebar via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 22 15:23:39 PST 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL287717: [StructurizeCFG] Use a for-each loop instead of iterators in runOnRegion. (authored by jlebar).
Changed prior to commit:
https://reviews.llvm.org/D26993?vs=78937&id=78959#toc
Repository:
rL LLVM
https://reviews.llvm.org/D26993
Files:
llvm/trunk/lib/Transforms/Scalar/StructurizeCFG.cpp
Index: llvm/trunk/lib/Transforms/Scalar/StructurizeCFG.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Scalar/StructurizeCFG.cpp
+++ llvm/trunk/lib/Transforms/Scalar/StructurizeCFG.cpp
@@ -939,12 +939,11 @@
// sub-regions are treated more cleverly, indirect children are not
// marked as uniform.
MDNode *MD = MDNode::get(R->getEntry()->getParent()->getContext(), {});
- Region::element_iterator E = R->element_end();
- for (Region::element_iterator I = R->element_begin(); I != E; ++I) {
- if (I->isSubRegion())
+ for (RegionNode *E : R->elements()) {
+ if (E->isSubRegion())
continue;
- if (Instruction *Term = I->getEntry()->getTerminator())
+ if (Instruction *Term = E->getEntry()->getTerminator())
Term->setMetadata("structurizecfg.uniform", MD);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26993.78959.patch
Type: text/x-patch
Size: 905 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161122/9a70a854/attachment.bin>
More information about the llvm-commits
mailing list