mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
Use a SmallSet when we can to reduce memory allocations.
This speeds up a particular testcase from 0.0302s to 0.0222s in LiveVariables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52819 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -34,6 +34,7 @@
|
|||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
#include "llvm/ADT/DepthFirstIterator.h"
|
#include "llvm/ADT/DepthFirstIterator.h"
|
||||||
#include "llvm/ADT/SmallPtrSet.h"
|
#include "llvm/ADT/SmallPtrSet.h"
|
||||||
|
#include "llvm/ADT/SmallSet.h"
|
||||||
#include "llvm/ADT/STLExtras.h"
|
#include "llvm/ADT/STLExtras.h"
|
||||||
#include "llvm/Config/alloca.h"
|
#include "llvm/Config/alloca.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -387,7 +388,7 @@ bool LiveVariables::HandlePhysRegKill(unsigned Reg) {
|
|||||||
|
|
||||||
void LiveVariables::HandlePhysRegDef(unsigned Reg, MachineInstr *MI) {
|
void LiveVariables::HandlePhysRegDef(unsigned Reg, MachineInstr *MI) {
|
||||||
// What parts of the register are previously defined?
|
// What parts of the register are previously defined?
|
||||||
std::set<unsigned> Live;
|
SmallSet<unsigned, 32> Live;
|
||||||
if (PhysRegDef[Reg] || PhysRegUse[Reg]) {
|
if (PhysRegDef[Reg] || PhysRegUse[Reg]) {
|
||||||
Live.insert(Reg);
|
Live.insert(Reg);
|
||||||
for (const unsigned *SS = TRI->getSubRegisters(Reg); *SS; ++SS)
|
for (const unsigned *SS = TRI->getSubRegisters(Reg); *SS; ++SS)
|
||||||
|
Reference in New Issue
Block a user