Fix buildbot after cfc6073017

Windows buildbots were not happy with using find_if + instructionsWithoutDebug.

In cfc6073017, instructionsWithoutDebug is not technically necessary. So,
just iterate over the block directly.

http://lab.llvm.org:8011/#/builders/127/builds/4732/steps/7/logs/stdio
This commit is contained in:
Jessica Paquette 2021-01-19 10:38:04 -08:00
parent cfc6073017
commit cbf5246359
1 changed files with 4 additions and 7 deletions

View File

@ -625,13 +625,10 @@ bool CombinerHelper::isPredecessor(const MachineInstr &DefMI,
if (&DefMI == &UseMI) if (&DefMI == &UseMI)
return false; return false;
const MachineBasicBlock &MBB = *DefMI.getParent(); const MachineBasicBlock &MBB = *DefMI.getParent();
auto NonDbgInsts = auto DefOrUse = find_if(MBB, [&DefMI, &UseMI](const MachineInstr &MI) {
instructionsWithoutDebug(MBB.instr_begin(), MBB.instr_end()); return &MI == &DefMI || &MI == &UseMI;
auto DefOrUse = });
find_if(NonDbgInsts, [&DefMI, &UseMI](const MachineInstr &MI) { if (DefOrUse == MBB.end())
return &MI == &DefMI || &MI == &UseMI;
});
if (DefOrUse == NonDbgInsts.end())
llvm_unreachable("Block must contain both DefMI and UseMI!"); llvm_unreachable("Block must contain both DefMI and UseMI!");
return &*DefOrUse == &DefMI; return &*DefOrUse == &DefMI;
} }