On 11/9/2021 4:15 AM, Aldy Hernandez wrote:
The goal with these sets of patches is to improve the detailed dumps for the threader, as I hope we eventually reach the point when I'm not the only one looking at these dumps ;-). This patch adds candidate paths to the detailed threading dumps to make it easier to see the decisions the threader makes. With it we can now grep for the discovery logic in action: $ grep ^path: a.ii.*thread* a.ii.034t.ethread:path: 4->5->xx REJECTED a.ii.034t.ethread:path: 3->5->8 SUCCESS a.ii.034t.ethread:path: 4->5->6 SUCCESS a.ii.034t.ethread:path: 0->2->xx REJECTED a.ii.034t.ethread:path: 0->2->xx REJECTED ... ... a.ii.111t.threadfull1:path: 14->22->23->xx REJECTED (unreachable) a.ii.111t.threadfull1:path: 15->22->23->xx REJECTED (unreachable) a.ii.111t.threadfull1:path: 16->22->23->xx REJECTED (unreachable) In addition to this, if --param=threader-debug=all is used, one can see the entire chain of events leading up to the ultimate threading decision: ============================================== path_range_query: compute_ranges for path: 2->5 Registering killing_def (path_oracle) _3 Registering killing_def (path_oracle) _1 range_defined_in_block (BB2) for _1 is _Bool VARYING Registering killing_def (path_oracle) _2 range_defined_in_block (BB2) for _2 is _Bool VARYING range_defined_in_block (BB2) for _3 is _Bool VARYING outgoing_edge_range_p for b_10(D) on edge 2->5 is int VARYING ... ... [BBs and gimple along path] ... path: 2->5->xx REJECTED Tested on x86-64 Linux. OK? gcc/ChangeLog: * tree-ssa-threadbackward.c (back_threader::maybe_register_path_dump): New. (back_threader::maybe_register_path): Call maybe_register_path_dump.
OK jeff