Page MenuHomePhabricator

SelectionDAGDumper: Print simple operands inline.

Authored by MatzeB on Sep 2 2015, 10:55 AM.



Print simple operands inline instead of their pointer/value number.
Simple operands are things like Constant(FP)?, Register and undef,


  0x7fb6cb8ab800: v4f32 = Register %vreg0
0x7fb6cb8ab928: v4f32,ch = CopyFromReg 0x7fb6cb413770, 0x7fb6cb8ab800
0x7fb6cb8abb78: i64 = Constant<0>

0x7fb6cb8abca0: f32 = extract_vector_elt 0x7fb6cb8ab928, 0x7fb6cb8abb78


0x7fb6cb8ab928 = CopyFromReg:v4f32,ch 0x7fb6cb413770, Register:v4f32  %vreg0
0x7fb6cb8abca0 = extract_vector_elt:f32 0x7fb6cb8ab928, Constant:i64 <0>

Diff Detail


Event Timeline

MatzeB updated this revision to Diff 33831.Sep 2 2015, 10:55 AM
MatzeB retitled this revision from to SelectionDAGDumper: Print simple operands inline..
MatzeB updated this object.
MatzeB added a reviewer: resistor.
MatzeB set the repository for this revision to rL LLVM.
MatzeB added a subscriber: llvm-commits.
arsenm added a subscriber: arsenm.Sep 2 2015, 1:00 PM
arsenm added inline comments.
591 ↗(On Diff #33831)

VALUETYPE would another good one to handle

725 ↗(On Diff #33831)

single quotes

MatzeB updated this revision to Diff 33861.Sep 2 2015, 2:57 PM

Implement suggestions.

MatzeB updated this revision to Diff 33862.Sep 2 2015, 2:59 PM

Actually added VALUETYPE this time.

MatzeB updated this revision to Diff 33895.Sep 2 2015, 6:05 PM

New version: Use printOperand() in DumpNodesr() as well; simplify the definition of a simple operand as one that has no predecessors (with the exception of EntryToken which looks nicer separate).

resistor accepted this revision.Sep 18 2015, 10:48 AM
resistor edited edge metadata.
This revision is now accepted and ready to land.Sep 18 2015, 10:48 AM
MatzeB updated this revision to Diff 35283.Sep 21 2015, 11:28 AM
MatzeB edited edge metadata.

New version which does not depend on anymore.

For inlined operations this will still print the type behind the operation ("Constant:i32<42>") for toplevel operations the type is still printed on the lhs as before ("tXX: type = operation").

Note that this commit now moves the node details behind the node (like dumpr() already did). The previous behaviour of printing the details behind the operands would be confusing in combination with inlined operations (confusing example: "load t0, t2, undef:i64<LD1[%tmp81]>" as the <LD1...> is part of the load not the undef). We now print: "load<LD1[%tmp81]> t0, t2, undef:i64".

Longer example, before:

t0: ch = EntryToken
  t1: i64 = Register %vreg0
t2: i64,ch = CopyFromReg t0, t1
  t3: i64 = Constant<1>
t4: i64 = add t2, t3
  t5: i64 = Constant<2>
t6: i64 = add t2, t5
t10: i64 = undef
t11: i8,ch = load t0, t2, t10<LD1[%tmp81]>
t12: i8,ch = load t0, t4, t10<LD1[%tmp10]>
t13: i8,ch = load t0, t6, t10<LD1[%tmp12]>


t0: ch = EntryToken
t2: i64,ch = CopyFromReg t0, Register:i64 %vreg0
t4: i64 = add t2, Constant:i64<1>
t6: i64 = add t2, Constant:i64<2>
t11: i8,ch = load<LD1[%tmp81]> t0, t2, undef:i64
t12: i8,ch = load<LD1[%tmp10]> t0, t4, undef:i64
t13: i8,ch = load<LD1[%tmp12]> t0, t6, undef:i64

Is this still good to go even in the reworked form from monday?

Fine with me.

This revision was automatically updated to reflect the committed changes.