summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-11-07 21:59:29 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-11-07 21:59:29 +0000
commita59ce0379134b249a3c949f7dcd6ec3566c4d7e3 (patch)
tree2ab0e32bc5973526e55801aa54d8a06cfc7b257c /lib
parent2dd5e1e64d718a0aeaaf988a54d5acc0ec70f243 (diff)
downloadllvm-a59ce0379134b249a3c949f7dcd6ec3566c4d7e3.tar.gz
llvm-a59ce0379134b249a3c949f7dcd6ec3566c4d7e3.tar.bz2
llvm-a59ce0379134b249a3c949f7dcd6ec3566c4d7e3.tar.xz
Use a reverse post order instead of a DFS order.
The enterBasicBlock() function is combining live-out values from predecessor blocks. The RPO traversal means that more predecessors have been visited when that happens, only back-edges are missing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144025 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/ExecutionDepsFix.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/CodeGen/ExecutionDepsFix.cpp b/lib/CodeGen/ExecutionDepsFix.cpp
index 8b002e7667..3d6f256dd8 100644
--- a/lib/CodeGen/ExecutionDepsFix.cpp
+++ b/lib/CodeGen/ExecutionDepsFix.cpp
@@ -26,7 +26,7 @@
#include "llvm/CodeGen/Passes.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetMachine.h"
-#include "llvm/ADT/DepthFirstIterator.h"
+#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
@@ -499,11 +499,10 @@ bool ExeDepsFix::runOnMachineFunction(MachineFunction &mf) {
}
MachineBasicBlock *Entry = MF->begin();
- SmallPtrSet<MachineBasicBlock*, 16> Visited;
- for (df_ext_iterator<MachineBasicBlock*, SmallPtrSet<MachineBasicBlock*, 16> >
- DFI = df_ext_begin(Entry, Visited), DFE = df_ext_end(Entry, Visited);
- DFI != DFE; ++DFI) {
- MachineBasicBlock *MBB = *DFI;
+ ReversePostOrderTraversal<MachineBasicBlock*> RPOT(Entry);
+ for (ReversePostOrderTraversal<MachineBasicBlock*>::rpo_iterator
+ MBBI = RPOT.begin(), MBBE = RPOT.end(); MBBI != MBBE; ++MBBI) {
+ MachineBasicBlock *MBB = *MBBI;
enterBasicBlock(MBB);
for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end(); I != E;
++I)