This is an archive of the discontinued LLVM Phabricator instance.

[mlir:PDL] Set debug name for PDL match result patterns

Authored by shidahe on Jan 23 2023, 2:42 PM.



A PDL match result pattern doesn't have a debug name, which is what
"debug-only=greedy-rewriter" prints out during rewrite. So it's hard to find
out which PDL pattern is being applied from the debug log.

This commit names the generated rewriter in PDLInterp with the optional
attribute "sym_name" of PDL PatternOp. Then the name of a PDL pattern can be
set as debug name of its match result PDLByteCodePattern.

Diff Detail

Event Timeline

shidahe created this revision.Jan 23 2023, 2:42 PM
shidahe requested review of this revision.Jan 23 2023, 2:42 PM
shidahe updated this revision to Diff 491517.Jan 23 2023, 2:54 PM

Remove a duplicated line

shidahe updated this revision to Diff 491916.Jan 24 2023, 2:30 PM

Use prefixed accessors

sfuniak accepted this revision.Jan 25 2023, 3:44 AM

Looks good to me--a much needed improvement! However, someone with a more recent knowledge of PDL should review as well.

This revision is now accepted and ready to land.Jan 25 2023, 3:44 AM
shidahe updated this revision to Diff 492129.Jan 25 2023, 8:30 AM

Use std::optional value_or

rriddle accepted this revision.Feb 22 2023, 9:38 AM

@rriddle Thank you for the approval! Since I don't have commit access, could you please help commit this change?