summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAhmed Bougacha <ahmed.bougacha@gmail.com>2016-09-12 16:05:31 +0000
committerAhmed Bougacha <ahmed.bougacha@gmail.com>2016-09-12 16:05:31 +0000
commitb678219aa6263c88064cb1035d8f03b782c5885c (patch)
tree70c150a3b934f81fa929b5996331ed655a790859 /llvm/lib
parent45bfa8772f47ac9bc6d738cf3b87e4b2b19813a4 (diff)
downloadbcm5719-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.cpp7
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;
}
OpenPOWER on IntegriCloud