This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Don't print "pred:" and "opt:" in -debug output
ClosedPublic

Authored by thegameg on Jan 9 2018, 9:13 AM.

Details

Summary

In -debug output we print "pred:" whenever a MachineOperand is a predicate operand in the instruction descriptor, and "opt:" whenever a MachineOperand is an optional def in the instruction descriptor.

In MIR we don't print it (we don't actually need to), so I think it would be less noisy to stop printing it in -debug as well.

I wonder if we shouldn't make a more verbose version of MachineInstr::print() that is adding information like this and looks a a bit more different than MIR, but keep the default version less noisy and strip it away.

Diff Detail

Event Timeline

thegameg created this revision.Jan 9 2018, 9:13 AM
MatzeB accepted this revision.Jan 9 2018, 9:26 AM

I think this change make sense given that the pred: and opt: information is not actually part of the MachineOperand but of MCInstrDesc.

I agree that having the extra "pred:" and "opt:" would make understanding easier in debugging situations but I would consider that secondary and do it in a later/a separate commit. When we do this we should enhance the .mir parser so it can skip over these prefixes so that printing them stays legal syntax.

Anyway for now I think this patch is fine.

This revision is now accepted and ready to land.Jan 9 2018, 9:26 AM
This revision was automatically updated to reflect the committed changes.

I agree that having the extra "pred:" and "opt:" would make understanding easier in debugging situations but I would consider that secondary

There are still people that read the output (in debugging situations, no less). Now that 50% of the output after RA consists of "renamable", I hope that -print-human-readable-mir is coming up really soon...