mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
Fix PR6300.
A virtual register can be used before it is defined in the same MBB if the MBB is part of a loop. Teach the implicit-def pass about this case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96279 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -205,10 +205,9 @@ bool ProcessImplicitDefs::runOnMachineFunction(MachineFunction &fn) {
|
||||
// Process each use instruction once.
|
||||
for (MachineRegisterInfo::use_iterator UI = mri_->use_begin(Reg),
|
||||
UE = mri_->use_end(); UI != UE; ++UI) {
|
||||
MachineInstr *RMI = &*UI;
|
||||
MachineBasicBlock *RMBB = RMI->getParent();
|
||||
if (RMBB == MBB)
|
||||
if (UI.getOperand().isUndef())
|
||||
continue;
|
||||
MachineInstr *RMI = &*UI;
|
||||
if (ModInsts.insert(RMI))
|
||||
RUses.push_back(RMI);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user