forked from OSchip/llvm-project
[MachineCombiner][NFC] Prevent dereferencing past-the-end object in an MRI container
llvm-svn: 350896
This commit is contained in:
parent
e41f4b39e5
commit
cb7d968f73
|
@ -231,6 +231,8 @@ unsigned MachineCombiner::getLatency(MachineInstr *Root, MachineInstr *NewRoot,
|
|||
// Get the first instruction that uses MO
|
||||
MachineRegisterInfo::reg_iterator RI = MRI->reg_begin(MO.getReg());
|
||||
RI++;
|
||||
if (RI == MRI->reg_end())
|
||||
continue;
|
||||
MachineInstr *UseMO = RI->getParent();
|
||||
unsigned LatencyOp = 0;
|
||||
if (UseMO && BlockTrace.isDepInTrace(*Root, *UseMO)) {
|
||||
|
|
Loading…
Reference in New Issue