mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-28 06:32:09 +00:00
Teach LiveVariables to handle <undef> operands.
It's simple: Don't treat <undef> operands as uses, and don't assume a virtual register has a defining instruction unless a real use has been seen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159061 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ce0a5cda8a
commit
7806c0778f
@ -573,7 +573,8 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &mf) {
|
||||
unsigned MOReg = MO.getReg();
|
||||
if (MO.isUse()) {
|
||||
MO.setIsKill(false);
|
||||
UseRegs.push_back(MOReg);
|
||||
if (MO.readsReg())
|
||||
UseRegs.push_back(MOReg);
|
||||
} else /*MO.isDef()*/ {
|
||||
MO.setIsDead(false);
|
||||
DefRegs.push_back(MOReg);
|
||||
@ -729,8 +730,9 @@ void LiveVariables::analyzePHINodes(const MachineFunction& Fn) {
|
||||
for (MachineBasicBlock::const_iterator BBI = I->begin(), BBE = I->end();
|
||||
BBI != BBE && BBI->isPHI(); ++BBI)
|
||||
for (unsigned i = 1, e = BBI->getNumOperands(); i != e; i += 2)
|
||||
PHIVarInfo[BBI->getOperand(i + 1).getMBB()->getNumber()]
|
||||
.push_back(BBI->getOperand(i).getReg());
|
||||
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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user