mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 04:24:00 +00:00
Convert more loops to range-based equivalents
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207714 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -702,12 +702,14 @@ void LiveVariables::removeVirtualRegistersKilled(MachineInstr *MI) {
|
||||
///
|
||||
void LiveVariables::analyzePHINodes(const MachineFunction& Fn) {
|
||||
for (const auto &MBB : Fn)
|
||||
for (MachineBasicBlock::const_iterator BBI = MBB.begin(), BBE = MBB.end();
|
||||
BBI != BBE && BBI->isPHI(); ++BBI)
|
||||
for (unsigned i = 1, e = BBI->getNumOperands(); i != e; i += 2)
|
||||
if (BBI->getOperand(i).readsReg())
|
||||
PHIVarInfo[BBI->getOperand(i + 1).getMBB()->getNumber()]
|
||||
.push_back(BBI->getOperand(i).getReg());
|
||||
for (const auto &BBI : MBB) {
|
||||
if (!BBI.isPHI())
|
||||
break;
|
||||
for (unsigned i = 1, e = BBI.getNumOperands(); i != e; i += 2)
|
||||
if (BBI.getOperand(i).readsReg())
|
||||
PHIVarInfo[BBI.getOperand(i + 1).getMBB()->getNumber()]
|
||||
.push_back(BBI.getOperand(i).getReg());
|
||||
}
|
||||
}
|
||||
|
||||
bool LiveVariables::VarInfo::isLiveIn(const MachineBasicBlock &MBB,
|
||||
|
Reference in New Issue
Block a user