Add a dump method that recursively prints an instruction and all
the instructions defining its operands and so on.
This is helpful when looking at combiner issue.
NFC
 Differential  D75094  
[MachineInstr] Add a dumpr method Authored by qcolombet on Feb 24 2020, 5:36 PM. 
Details Add a dump method that recursively prints an instruction and all This is helpful when looking at combiner issue. NFC 
Diff Detail 
 Event Timeline
 Comment Actions 
 Comment Actions Here are a few examples of the dump we get: 
 (lldb) p MI.dumpr(MRI, -1)
%1:_(<4 x s16>) = G_BUILD_VECTOR %6:_(s16), %7:_(s16), %8:_(s16), %9:_(s16)
  %6:_(s16) = G_FPTRUNC %17:_(s32)
    %17:_(s32) = COPY $s0
  %7:_(s16) = G_FPTRUNC %15:_(s32)
    %15:_(s32) = COPY $s0
  %8:_(s16) = G_FPTRUNC %13:_(s32)
    %13:_(s32) = COPY $s0
  %9:_(s16) = G_FPTRUNC %11:_(s32)
    %11:_(s32) = COPY $s0
 (lldb) p MI.dumpr(MRI, 2) %1:_(<4 x s16>) = G_BUILD_VECTOR %6:_(s16), %7:_(s16), %8:_(s16), %9:_(s16) %6:_(s16) = G_FPTRUNC %17:_(s32) %7:_(s16) = G_FPTRUNC %15:_(s32) %8:_(s16) = G_FPTRUNC %13:_(s32) %9:_(s16) = G_FPTRUNC %11:_(s32)  | ||||||||||||
I think defaulting to UINT_MAX would be simpler than the optional here, especially since debuggers are really bad at calling functions with nontrivial arguments