forked from OSchip/llvm-project
[BranchFolding] Unique added live-ins after hoisting code.
We're not supposed to have duplicate live-ins. llvm-svn: 281224
This commit is contained in:
parent
45bfa8772f
commit
b678219aa6
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ body: |
|
|||
TCRETURNdi64 @f1, 0, csr_64, implicit %rsp, implicit %rdi, implicit %rsi
|
||||
|
||||
; CHECK: bb.2:
|
||||
; CHECK-NEXT: liveins: %rax, %rsi, %rdi, %rsi
|
||||
; CHECK-NEXT: liveins: %rax, %rdi, %rsi
|
||||
; CHECK-NEXT: {{^ $}}
|
||||
; CHECK-NEXT: TCRETURNdi64 @f2, 0, csr_64, implicit %rsp, implicit %rdi, implicit %rsi
|
||||
|
||||
|
|
Loading…
Reference in New Issue