This is an archive of the discontinued LLVM Phabricator instance.

[AArch64CondBrTuning] Ignore debug insts when scanning for NZCV clobbers [9/10]
ClosedPublic

Authored by vsk on Apr 15 2020, 6:33 PM.

Details

Summary

This fixes several instances in which condbr optimization was missed
due to a debug instruction appearing as a bogus NZCV clobber.

Diff Detail

Event Timeline

vsk created this revision.Apr 15 2020, 6:33 PM
fhahn accepted this revision.Apr 16 2020, 3:05 AM
fhahn added a subscriber: fhahn.

LGTM, thanks

llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
3179

nit: could be something like

return any_of(instructionsWithoutDebug( std::next(DefMI.getIterator()), UseMI.getIterator()), [TRI](MachineInstr &I) {
  return I.modifiesRegister(AArch64::NZCV, TRI) || I.readsRegister(AArch64::NZCV, TRI);
});
This revision is now accepted and ready to land.Apr 16 2020, 3:05 AM
vsk marked 2 inline comments as done.Apr 16 2020, 1:08 PM
vsk added inline comments.
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
3179

Thanks, I'll fold this into the change prior to landing it.

This revision was automatically updated to reflect the committed changes.
vsk marked an inline comment as done.