Skip to content

Commit

Permalink
[StructurizeCFG] Use a for-each loop instead of iterators in runOnReg…
Browse files Browse the repository at this point in the history
…ion.

Summary:

Reviewers: arsenm

Subscribers: wdng, llvm-commits

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

llvm-svn: 287717
  • Loading branch information
Justin Lebar committed Nov 22, 2016
1 parent c7445d5 commit 1b60d70
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions llvm/lib/Transforms/Scalar/StructurizeCFG.cpp
Expand Up @@ -939,12 +939,11 @@ bool StructurizeCFG::runOnRegion(Region *R, RGPassManager &RGM) {
// 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);
}

Expand Down

0 comments on commit 1b60d70

Please sign in to comment.