1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

[StructurizeCFG] Use a for-each loop instead of iterators in runOnRegion.

Summary:

Reviewers: arsenm

Subscribers: wdng, llvm-commits

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

llvm-svn: 287717
This commit is contained in:
Justin Lebar 2016-11-22 23:13:37 +00:00
parent c229bf7dc3
commit 025800b1ba

View File

@ -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);
}