mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Don't require a BB to look-up live variables, unless they may need to
be recomputed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7388 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ceb7d2f4f8
commit
7a81a0fd13
@ -180,28 +180,29 @@ void FunctionLiveVarInfo::releaseMemory() {
|
||||
const ValueSet &
|
||||
FunctionLiveVarInfo::getLiveVarSetBeforeMInst(const MachineInstr *MInst,
|
||||
const BasicBlock *BB) {
|
||||
if (const ValueSet *LVSet = MInst2LVSetBI[MInst]) {
|
||||
return *LVSet; // if found, just return the set
|
||||
} else {
|
||||
calcLiveVarSetsForBB(BB); // else, calc for all instrs in BB
|
||||
return *MInst2LVSetBI[MInst];
|
||||
const ValueSet *LVSet = MInst2LVSetBI[MInst];
|
||||
if (LVSet == NULL && BB != NULL) { // if not found and BB provided
|
||||
calcLiveVarSetsForBB(BB); // calc LVSet for all instrs in BB
|
||||
LVSet = MInst2LVSetBI[MInst];
|
||||
}
|
||||
return *LVSet;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Gives live variable information after a machine instruction
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
const ValueSet &
|
||||
FunctionLiveVarInfo::getLiveVarSetAfterMInst(const MachineInstr *MI,
|
||||
const BasicBlock *BB) {
|
||||
|
||||
if (const ValueSet *LVSet = MInst2LVSetAI[MI]) {
|
||||
return *LVSet; // if found, just return the set
|
||||
} else {
|
||||
calcLiveVarSetsForBB(BB); // else, calc for all instrs in BB
|
||||
const ValueSet *LVSet = MInst2LVSetAI[MI];
|
||||
if (LVSet == NULL && BB != NULL) { // if not found and BB provided
|
||||
calcLiveVarSetsForBB(BB); // calc LVSet for all instrs in BB
|
||||
return *MInst2LVSetAI[MI];
|
||||
}
|
||||
return *LVSet;
|
||||
}
|
||||
|
||||
// This function applies a machine instr to a live var set (accepts OutSet) and
|
||||
|
@ -180,28 +180,29 @@ void FunctionLiveVarInfo::releaseMemory() {
|
||||
const ValueSet &
|
||||
FunctionLiveVarInfo::getLiveVarSetBeforeMInst(const MachineInstr *MInst,
|
||||
const BasicBlock *BB) {
|
||||
if (const ValueSet *LVSet = MInst2LVSetBI[MInst]) {
|
||||
return *LVSet; // if found, just return the set
|
||||
} else {
|
||||
calcLiveVarSetsForBB(BB); // else, calc for all instrs in BB
|
||||
return *MInst2LVSetBI[MInst];
|
||||
const ValueSet *LVSet = MInst2LVSetBI[MInst];
|
||||
if (LVSet == NULL && BB != NULL) { // if not found and BB provided
|
||||
calcLiveVarSetsForBB(BB); // calc LVSet for all instrs in BB
|
||||
LVSet = MInst2LVSetBI[MInst];
|
||||
}
|
||||
return *LVSet;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Gives live variable information after a machine instruction
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
const ValueSet &
|
||||
FunctionLiveVarInfo::getLiveVarSetAfterMInst(const MachineInstr *MI,
|
||||
const BasicBlock *BB) {
|
||||
|
||||
if (const ValueSet *LVSet = MInst2LVSetAI[MI]) {
|
||||
return *LVSet; // if found, just return the set
|
||||
} else {
|
||||
calcLiveVarSetsForBB(BB); // else, calc for all instrs in BB
|
||||
const ValueSet *LVSet = MInst2LVSetAI[MI];
|
||||
if (LVSet == NULL && BB != NULL) { // if not found and BB provided
|
||||
calcLiveVarSetsForBB(BB); // calc LVSet for all instrs in BB
|
||||
return *MInst2LVSetAI[MI];
|
||||
}
|
||||
return *LVSet;
|
||||
}
|
||||
|
||||
// This function applies a machine instr to a live var set (accepts OutSet) and
|
||||
|
Loading…
Reference in New Issue
Block a user