mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-30 22:37:28 +00:00
80 column and whitespace cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92837 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e10920d678
commit
2973b57093
@ -1,4 +1,4 @@
|
|||||||
//===----- AggressiveAntiDepBreaker.cpp - Anti-dep breaker -------- ---------===//
|
//===----- AggressiveAntiDepBreaker.cpp - Anti-dep breaker ----------------===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
@ -235,7 +235,8 @@ void AggressiveAntiDepBreaker::Observe(MachineInstr *MI, unsigned Count,
|
|||||||
dbgs() << " " << TRI->getName(Reg) << "=g" <<
|
dbgs() << " " << TRI->getName(Reg) << "=g" <<
|
||||||
State->GetGroup(Reg) << "->g0(region live-out)");
|
State->GetGroup(Reg) << "->g0(region live-out)");
|
||||||
State->UnionGroups(Reg, 0);
|
State->UnionGroups(Reg, 0);
|
||||||
} else if ((DefIndices[Reg] < InsertPosIndex) && (DefIndices[Reg] >= Count)) {
|
} else if ((DefIndices[Reg] < InsertPosIndex)
|
||||||
|
&& (DefIndices[Reg] >= Count)) {
|
||||||
DefIndices[Reg] = Count;
|
DefIndices[Reg] = Count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -320,7 +321,8 @@ static SUnit *CriticalPathStep(SUnit *SU) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AggressiveAntiDepBreaker::HandleLastUse(unsigned Reg, unsigned KillIdx,
|
void AggressiveAntiDepBreaker::HandleLastUse(unsigned Reg, unsigned KillIdx,
|
||||||
const char *tag, const char *header,
|
const char *tag,
|
||||||
|
const char *header,
|
||||||
const char *footer) {
|
const char *footer) {
|
||||||
unsigned *KillIndices = State->GetKillIndices();
|
unsigned *KillIndices = State->GetKillIndices();
|
||||||
unsigned *DefIndices = State->GetDefIndices();
|
unsigned *DefIndices = State->GetDefIndices();
|
||||||
@ -355,8 +357,10 @@ void AggressiveAntiDepBreaker::HandleLastUse(unsigned Reg, unsigned KillIdx,
|
|||||||
DEBUG(if ((header == NULL) && (footer != NULL)) dbgs() << footer);
|
DEBUG(if ((header == NULL) && (footer != NULL)) dbgs() << footer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AggressiveAntiDepBreaker::PrescanInstruction(MachineInstr *MI, unsigned Count,
|
void AggressiveAntiDepBreaker::PrescanInstruction(MachineInstr *MI,
|
||||||
std::set<unsigned>& PassthruRegs) {
|
unsigned Count,
|
||||||
|
std::set<unsigned>& PassthruRegs)
|
||||||
|
{
|
||||||
unsigned *DefIndices = State->GetDefIndices();
|
unsigned *DefIndices = State->GetDefIndices();
|
||||||
std::multimap<unsigned, AggressiveAntiDepState::RegisterReference>&
|
std::multimap<unsigned, AggressiveAntiDepState::RegisterReference>&
|
||||||
RegRefs = State->GetRegRefs();
|
RegRefs = State->GetRegRefs();
|
||||||
@ -512,8 +516,9 @@ BitVector AggressiveAntiDepBreaker::GetRenameRegisters(unsigned Reg) {
|
|||||||
std::multimap<unsigned,
|
std::multimap<unsigned,
|
||||||
AggressiveAntiDepState::RegisterReference>::iterator>
|
AggressiveAntiDepState::RegisterReference>::iterator>
|
||||||
Range = State->GetRegRefs().equal_range(Reg);
|
Range = State->GetRegRefs().equal_range(Reg);
|
||||||
for (std::multimap<unsigned, AggressiveAntiDepState::RegisterReference>::iterator
|
for (std::multimap<unsigned,
|
||||||
Q = Range.first, QE = Range.second; Q != QE; ++Q) {
|
AggressiveAntiDepState::RegisterReference>::iterator Q = Range.first,
|
||||||
|
QE = Range.second; Q != QE; ++Q) {
|
||||||
const TargetRegisterClass *RC = Q->second.RC;
|
const TargetRegisterClass *RC = Q->second.RC;
|
||||||
if (RC == NULL) continue;
|
if (RC == NULL) continue;
|
||||||
|
|
||||||
@ -552,7 +557,8 @@ bool AggressiveAntiDepBreaker::FindSuitableFreeRegisters(
|
|||||||
// Find the "superest" register in the group. At the same time,
|
// Find the "superest" register in the group. At the same time,
|
||||||
// collect the BitVector of registers that can be used to rename
|
// collect the BitVector of registers that can be used to rename
|
||||||
// each register.
|
// each register.
|
||||||
DEBUG(dbgs() << "\tRename Candidates for Group g" << AntiDepGroupIndex << ":\n");
|
DEBUG(dbgs() << "\tRename Candidates for Group g" << AntiDepGroupIndex
|
||||||
|
<< ":\n");
|
||||||
std::map<unsigned, BitVector> RenameRegisterMap;
|
std::map<unsigned, BitVector> RenameRegisterMap;
|
||||||
unsigned SuperReg = 0;
|
unsigned SuperReg = 0;
|
||||||
for (unsigned i = 0, e = Regs.size(); i != e; ++i) {
|
for (unsigned i = 0, e = Regs.size(); i != e; ++i) {
|
||||||
@ -663,7 +669,8 @@ bool AggressiveAntiDepBreaker::FindSuitableFreeRegisters(
|
|||||||
for (const unsigned *Alias = TRI->getAliasSet(NewReg);
|
for (const unsigned *Alias = TRI->getAliasSet(NewReg);
|
||||||
*Alias; ++Alias) {
|
*Alias; ++Alias) {
|
||||||
unsigned AliasReg = *Alias;
|
unsigned AliasReg = *Alias;
|
||||||
if (State->IsLive(AliasReg) || (KillIndices[Reg] > DefIndices[AliasReg])) {
|
if (State->IsLive(AliasReg) ||
|
||||||
|
(KillIndices[Reg] > DefIndices[AliasReg])) {
|
||||||
DEBUG(dbgs() << "(alias " << TRI->getName(AliasReg) << " live)");
|
DEBUG(dbgs() << "(alias " << TRI->getName(AliasReg) << " live)");
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
@ -816,7 +823,8 @@ unsigned AggressiveAntiDepBreaker::BreakAntiDependencies(
|
|||||||
} else {
|
} else {
|
||||||
// No anti-dep breaking for implicit deps
|
// No anti-dep breaking for implicit deps
|
||||||
MachineOperand *AntiDepOp = MI->findRegisterDefOperand(AntiDepReg);
|
MachineOperand *AntiDepOp = MI->findRegisterDefOperand(AntiDepReg);
|
||||||
assert(AntiDepOp != NULL && "Can't find index for defined register operand");
|
assert(AntiDepOp != NULL &&
|
||||||
|
"Can't find index for defined register operand");
|
||||||
if ((AntiDepOp == NULL) || AntiDepOp->isImplicit()) {
|
if ((AntiDepOp == NULL) || AntiDepOp->isImplicit()) {
|
||||||
DEBUG(dbgs() << " (implicit)\n");
|
DEBUG(dbgs() << " (implicit)\n");
|
||||||
continue;
|
continue;
|
||||||
@ -890,11 +898,12 @@ unsigned AggressiveAntiDepBreaker::BreakAntiDependencies(
|
|||||||
// Update the references to the old register CurrReg to
|
// Update the references to the old register CurrReg to
|
||||||
// refer to the new register NewReg.
|
// refer to the new register NewReg.
|
||||||
std::pair<std::multimap<unsigned,
|
std::pair<std::multimap<unsigned,
|
||||||
AggressiveAntiDepState::RegisterReference>::iterator,
|
AggressiveAntiDepState::RegisterReference>::iterator,
|
||||||
std::multimap<unsigned,
|
std::multimap<unsigned,
|
||||||
AggressiveAntiDepState::RegisterReference>::iterator>
|
AggressiveAntiDepState::RegisterReference>::iterator>
|
||||||
Range = RegRefs.equal_range(CurrReg);
|
Range = RegRefs.equal_range(CurrReg);
|
||||||
for (std::multimap<unsigned, AggressiveAntiDepState::RegisterReference>::iterator
|
for (std::multimap<unsigned,
|
||||||
|
AggressiveAntiDepState::RegisterReference>::iterator
|
||||||
Q = Range.first, QE = Range.second; Q != QE; ++Q) {
|
Q = Range.first, QE = Range.second; Q != QE; ++Q) {
|
||||||
Q->second.Operand->setReg(NewReg);
|
Q->second.Operand->setReg(NewReg);
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,8 @@ namespace llvm {
|
|||||||
void GetGroupRegs(
|
void GetGroupRegs(
|
||||||
unsigned Group,
|
unsigned Group,
|
||||||
std::vector<unsigned> &Regs,
|
std::vector<unsigned> &Regs,
|
||||||
std::multimap<unsigned, AggressiveAntiDepState::RegisterReference> *RegRefs);
|
std::multimap<unsigned,
|
||||||
|
AggressiveAntiDepState::RegisterReference> *RegRefs);
|
||||||
|
|
||||||
// UnionGroups - Union Reg1's and Reg2's groups to form a new
|
// UnionGroups - Union Reg1's and Reg2's groups to form a new
|
||||||
// group. Return the index of the GroupNode representing the
|
// group. Return the index of the GroupNode representing the
|
||||||
@ -137,7 +138,8 @@ namespace llvm {
|
|||||||
/// Start - Initialize anti-dep breaking for a new basic block.
|
/// Start - Initialize anti-dep breaking for a new basic block.
|
||||||
void StartBlock(MachineBasicBlock *BB);
|
void StartBlock(MachineBasicBlock *BB);
|
||||||
|
|
||||||
/// BreakAntiDependencies - Identifiy anti-dependencies along the critical path
|
/// BreakAntiDependencies - Identifiy anti-dependencies along the critical
|
||||||
|
/// path
|
||||||
/// of the ScheduleDAG and break them by renaming registers.
|
/// of the ScheduleDAG and break them by renaming registers.
|
||||||
///
|
///
|
||||||
unsigned BreakAntiDependencies(std::vector<SUnit>& SUnits,
|
unsigned BreakAntiDependencies(std::vector<SUnit>& SUnits,
|
||||||
|
@ -290,7 +290,8 @@ void CriticalAntiDepBreaker::ScanInstruction(MachineInstr *MI,
|
|||||||
unsigned
|
unsigned
|
||||||
CriticalAntiDepBreaker::findSuitableFreeRegister(unsigned AntiDepReg,
|
CriticalAntiDepBreaker::findSuitableFreeRegister(unsigned AntiDepReg,
|
||||||
unsigned LastNewReg,
|
unsigned LastNewReg,
|
||||||
const TargetRegisterClass *RC) {
|
const TargetRegisterClass *RC)
|
||||||
|
{
|
||||||
for (TargetRegisterClass::iterator R = RC->allocation_order_begin(MF),
|
for (TargetRegisterClass::iterator R = RC->allocation_order_begin(MF),
|
||||||
RE = RC->allocation_order_end(MF); R != RE; ++R) {
|
RE = RC->allocation_order_end(MF); R != RE; ++R) {
|
||||||
unsigned NewReg = *R;
|
unsigned NewReg = *R;
|
||||||
@ -302,10 +303,10 @@ CriticalAntiDepBreaker::findSuitableFreeRegister(unsigned AntiDepReg,
|
|||||||
if (NewReg == LastNewReg) continue;
|
if (NewReg == LastNewReg) continue;
|
||||||
// If NewReg is dead and NewReg's most recent def is not before
|
// If NewReg is dead and NewReg's most recent def is not before
|
||||||
// AntiDepReg's kill, it's safe to replace AntiDepReg with NewReg.
|
// AntiDepReg's kill, it's safe to replace AntiDepReg with NewReg.
|
||||||
assert(((KillIndices[AntiDepReg] == ~0u) != (DefIndices[AntiDepReg] == ~0u)) &&
|
assert(((KillIndices[AntiDepReg] == ~0u) != (DefIndices[AntiDepReg] == ~0u))
|
||||||
"Kill and Def maps aren't consistent for AntiDepReg!");
|
&& "Kill and Def maps aren't consistent for AntiDepReg!");
|
||||||
assert(((KillIndices[NewReg] == ~0u) != (DefIndices[NewReg] == ~0u)) &&
|
assert(((KillIndices[NewReg] == ~0u) != (DefIndices[NewReg] == ~0u))
|
||||||
"Kill and Def maps aren't consistent for NewReg!");
|
&& "Kill and Def maps aren't consistent for NewReg!");
|
||||||
if (KillIndices[NewReg] != ~0u ||
|
if (KillIndices[NewReg] != ~0u ||
|
||||||
Classes[NewReg] == reinterpret_cast<TargetRegisterClass *>(-1) ||
|
Classes[NewReg] == reinterpret_cast<TargetRegisterClass *>(-1) ||
|
||||||
KillIndices[AntiDepReg] > DefIndices[NewReg])
|
KillIndices[AntiDepReg] > DefIndices[NewReg])
|
||||||
|
@ -68,7 +68,8 @@ namespace llvm {
|
|||||||
/// Start - Initialize anti-dep breaking for a new basic block.
|
/// Start - Initialize anti-dep breaking for a new basic block.
|
||||||
void StartBlock(MachineBasicBlock *BB);
|
void StartBlock(MachineBasicBlock *BB);
|
||||||
|
|
||||||
/// BreakAntiDependencies - Identifiy anti-dependencies along the critical path
|
/// BreakAntiDependencies - Identifiy anti-dependencies along the critical
|
||||||
|
/// path
|
||||||
/// of the ScheduleDAG and break them by renaming registers.
|
/// of the ScheduleDAG and break them by renaming registers.
|
||||||
///
|
///
|
||||||
unsigned BreakAntiDependencies(std::vector<SUnit>& SUnits,
|
unsigned BreakAntiDependencies(std::vector<SUnit>& SUnits,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user