diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-04-11 01:50:01 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-04-11 01:50:01 +0000 |
commit | ceec2bdaa52186b0bf92a6efe1545d093d70eb60 (patch) | |
tree | f6b5198fc202c67406f7a74387249acf43921cb3 /llvm/lib/Target | |
parent | 5d049b9732b29b6d46abe881efccb8a04be7cdff (diff) | |
download | bcm5719-llvm-ceec2bdaa52186b0bf92a6efe1545d093d70eb60.tar.gz bcm5719-llvm-ceec2bdaa52186b0bf92a6efe1545d093d70eb60.zip |
Implement depth_first and inverse_depth_first range factory functions.
Also updated as many loops as I could find using df_begin/idf_begin -
strangely I found no uses of idf_begin. Is that just used out of tree?
Also a few places couldn't use df_begin because either they used the
member functions of the depth first iterators or had specific ordering
constraints (I added a comment in the latter case).
Based on a patch by Jim Grosbach. (Jim - you just had iterator_range<T>
where you needed iterator_range<idf_iterator<T>>)
llvm-svn: 206016
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/ARM64/ARM64ConditionalCompares.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Target/R600/AMDILCFGStructurizer.cpp | 12 |
2 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/Target/ARM64/ARM64ConditionalCompares.cpp b/llvm/lib/Target/ARM64/ARM64ConditionalCompares.cpp index cefa44ad96a..759e8b7df4f 100644 --- a/llvm/lib/Target/ARM64/ARM64ConditionalCompares.cpp +++ b/llvm/lib/Target/ARM64/ARM64ConditionalCompares.cpp @@ -908,7 +908,7 @@ bool ARM64ConditionalCompares::runOnMachineFunction(MachineFunction &MF) { // Note that updateDomTree() modifies the children of the DomTree node // currently being visited. The df_iterator supports that; it doesn't look at // child_begin() / child_end() until after a node has been visited. - for (auto *I : make_range(df_begin(DomTree), df_end(DomTree))) + for (auto *I : depth_first(DomTree)) if (tryConvert(I->getBlock())) Changed = true; diff --git a/llvm/lib/Target/R600/AMDILCFGStructurizer.cpp b/llvm/lib/Target/R600/AMDILCFGStructurizer.cpp index 21ca560dba0..1b458df294e 100644 --- a/llvm/lib/Target/R600/AMDILCFGStructurizer.cpp +++ b/llvm/lib/Target/R600/AMDILCFGStructurizer.cpp @@ -1075,13 +1075,11 @@ int AMDGPUCFGStructurizer::ifPatternMatch(MachineBasicBlock *MBB) { int AMDGPUCFGStructurizer::loopendPatternMatch() { std::vector<MachineLoop *> NestedLoops; - for (MachineLoopInfo::iterator It = MLI->begin(), E = MLI->end(); - It != E; ++It) { - df_iterator<MachineLoop *> LpIt = df_begin(*It), - LpE = df_end(*It); - for (; LpIt != LpE; ++LpIt) - NestedLoops.push_back(*LpIt); - } + for (MachineLoopInfo::iterator It = MLI->begin(), E = MLI->end(); It != E; + ++It) + for (MachineLoop *ML : depth_first(*It)) + NestedLoops.push_back(ML); + if (NestedLoops.size() == 0) return 0; |