[LLVMdev] Nice nodes dumping patch
atrick at apple.com
Fri Sep 14 18:07:00 PDT 2012
On Sep 12, 2012, at 6:36 AM, Stepan Dyatkovskiy <STPWORLD at narod.ru> wrote:
> Hi all. Currently if you launch some tool with "-debug" option, you got pretty detailed dump. Though the SelectionDAG nodes will dumped as its pointer values:
> 0xa1d7258: i32 = GlobalAddress<void (i32, ...)* @f> 0
> 0xa1d7368: i32 = undef [ORD=1]
> 0xa1d73f0: i32 = TargetConstant<12> [ORD=1]
> It is good if you want to look at memory contents by its address then. But if you just want to understand how the DAG looks 0xABRACADABRA annoying sometimes.
> This patch allows to see the DAG in more readable form:
> Node0: i32 = GlobalAddress<void (i32, ...)* @f> 0
> Node1: i32 = undef [ORD=1]
> Node2: i32 = TargetConstant<12> [ORD=1]
> Just invoke tools with "-debug -dump-node-ids" options. Note if you omit the second option it will dump nodes as its pointer values.
> This feature also allows to compare two debug logs with diff tool, since node ids depends on its dump order only.
> Note sure that it should gone to the main branch. But absolutely sure that it may be helpful ;-)
Great. But I would also like to debug based on the dump... e.g. break at node N. It would be much simpler to use the existing NodeID instead of assigning new IDs, which I think is confusing.
Can someone who understands SD explain why we can't always set NodeID, e.g. after ISEL? Seems like an easy thing.
More information about the llvm-dev