mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 04:32:44 +01:00
[LiveVariables] Replace std::vector with SmallVector.
Replace std::vector with SmallVector to reduce the number of mallocs. This method is frequently executed, and the number of elements in the vector is typically small. https://reviews.llvm.org/D83920
This commit is contained in:
parent
9ac94b78c6
commit
875d6beaad
@ -276,7 +276,8 @@ public:
|
||||
MachineBasicBlock *BB);
|
||||
void MarkVirtRegAliveInBlock(VarInfo &VRInfo, MachineBasicBlock *DefBlock,
|
||||
MachineBasicBlock *BB,
|
||||
std::vector<MachineBasicBlock*> &WorkList);
|
||||
SmallVectorImpl<MachineBasicBlock *> &WorkList);
|
||||
|
||||
void HandleVirtRegDef(unsigned reg, MachineInstr &MI);
|
||||
void HandleVirtRegUse(unsigned reg, MachineBasicBlock *MBB, MachineInstr &MI);
|
||||
|
||||
|
@ -89,10 +89,9 @@ LiveVariables::VarInfo &LiveVariables::getVarInfo(unsigned RegIdx) {
|
||||
return VirtRegInfo[RegIdx];
|
||||
}
|
||||
|
||||
void LiveVariables::MarkVirtRegAliveInBlock(VarInfo& VRInfo,
|
||||
MachineBasicBlock *DefBlock,
|
||||
MachineBasicBlock *MBB,
|
||||
std::vector<MachineBasicBlock*> &WorkList) {
|
||||
void LiveVariables::MarkVirtRegAliveInBlock(
|
||||
VarInfo &VRInfo, MachineBasicBlock *DefBlock, MachineBasicBlock *MBB,
|
||||
SmallVectorImpl<MachineBasicBlock *> &WorkList) {
|
||||
unsigned BBNum = MBB->getNumber();
|
||||
|
||||
// Check to see if this basic block is one of the killing blocks. If so,
|
||||
@ -118,7 +117,7 @@ void LiveVariables::MarkVirtRegAliveInBlock(VarInfo& VRInfo,
|
||||
void LiveVariables::MarkVirtRegAliveInBlock(VarInfo &VRInfo,
|
||||
MachineBasicBlock *DefBlock,
|
||||
MachineBasicBlock *MBB) {
|
||||
std::vector<MachineBasicBlock*> WorkList;
|
||||
SmallVector<MachineBasicBlock *, 16> WorkList;
|
||||
MarkVirtRegAliveInBlock(VRInfo, DefBlock, MBB, WorkList);
|
||||
|
||||
while (!WorkList.empty()) {
|
||||
|
Loading…
Reference in New Issue
Block a user