Skip to content

Commit

Permalink
Copy the livein set.
Browse files Browse the repository at this point in the history
  • Loading branch information
rlavaee committed Oct 27, 2023
1 parent 35d7fff commit f8499fb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions llvm/lib/CodeGen/BasicBlockPathCloning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,9 @@ bool ApplyCloning(MachineFunction &MF,
// to that of PrevBB and CloneBB.
PrevBB->ReplaceUsesOfBlockWith(OrigBB, CloneBB);

// CloneBB has a single predecessor. Therefore, its livein is the liveout
// of the predecessor block.
for (auto &LiveOut : PrevBB->liveouts())
CloneBB->addLiveIn(LiveOut);
// Copy the livein set.
for (auto &LiveIn : OrigBB->liveins())
CloneBB->addLiveIn(LiveIn);

PrevBB = CloneBB;
}
Expand Down

0 comments on commit f8499fb

Please sign in to comment.