diff options
author | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2016-09-12 16:05:31 +0000 |
---|---|---|
committer | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2016-09-12 16:05:31 +0000 |
commit | b678219aa6263c88064cb1035d8f03b782c5885c (patch) | |
tree | 70c150a3b934f81fa929b5996331ed655a790859 /llvm/lib | |
parent | 45bfa8772f47ac9bc6d738cf3b87e4b2b19813a4 (diff) | |
download | bcm5719-llvm-b678219aa6263c88064cb1035d8f03b782c5885c.tar.gz bcm5719-llvm-b678219aa6263c88064cb1035d8f03b782c5885c.zip |
[BranchFolding] Unique added live-ins after hoisting code.
We're not supposed to have duplicate live-ins.
llvm-svn: 281224
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/BranchFolding.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp index 06a82220875..0d4a0715a9e 100644 --- a/llvm/lib/CodeGen/BranchFolding.cpp +++ b/llvm/lib/CodeGen/BranchFolding.cpp @@ -1972,14 +1972,21 @@ bool BranchFolder::HoistCommonCodeInSuccs(MachineBasicBlock *MBB) { FBB->erase(FBB->begin(), FIB); // Update livein's. + bool AddedLiveIns = false; for (unsigned i = 0, e = LocalDefs.size(); i != e; ++i) { unsigned Def = LocalDefs[i]; if (LocalDefsSet.count(Def)) { TBB->addLiveIn(Def); FBB->addLiveIn(Def); + AddedLiveIns = true; } } + if (AddedLiveIns) { + TBB->sortUniqueLiveIns(); + FBB->sortUniqueLiveIns(); + } + ++NumHoist; return true; } |