mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-28 22:24:28 +00:00
Compile time improvements to VirtRegRewriter.
This change to VirtRegRewriter::addMBBLiveIns adds live-in registers for each MachineBasicBlock's LiveIns set without isLiveIn checks as they are being added because doing so is expensive. After all live-in registers are added, the LiveIn vectors are sorted and uniqued. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238008 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -315,9 +315,18 @@ public:
|
||||
|
||||
// LiveIn management methods.
|
||||
|
||||
/// addLiveIn - Add the specified register as a live in. Note that it
|
||||
/// is an error to add the same register to the same set more than once.
|
||||
void addLiveIn(unsigned Reg) { LiveIns.push_back(Reg); }
|
||||
/// Adds the specified register as a live in. Note that it is an error to add
|
||||
/// the same register to the same set more than once unless the intention is
|
||||
/// to call sortUniqueLiveIns after all registers are added.
|
||||
void addLiveIn(unsigned Reg) { LiveIns.push_back(Reg); }
|
||||
|
||||
/// Sorts and uniques the LiveIns vector. It can be significantly faster to do
|
||||
/// this than repeatedly calling isLiveIn before calling addLiveIn for every
|
||||
/// LiveIn insertion.
|
||||
void sortUniqueLiveIns() {
|
||||
std::sort(LiveIns.begin(), LiveIns.end());
|
||||
LiveIns.erase(std::unique(LiveIns.begin(), LiveIns.end()), LiveIns.end());
|
||||
}
|
||||
|
||||
/// Add PhysReg as live in to this block, and ensure that there is a copy of
|
||||
/// PhysReg to a virtual register of class RC. Return the virtual register
|
||||
|
Reference in New Issue
Block a user