This is an archive of the discontinued LLVM Phabricator instance.

[mlir:PDLL] Rework the C++ generation of native Constraint/Rewrite arguments and results
ClosedPublic

Authored by rriddle on May 2 2022, 7:42 PM.

Details

Summary

The current translation uses the old "ugly"/"raw" form which used PDLValue for the arguments
and results. This commit updates the C++ generation to use the recently added sugar that
allows for directly using the desired types for the arguments and result of PDL functions.
In addition, this commit also properly imports the C++ class for ODS operations, constraints,
and interfaces. This allows for a much more convienent C++ API than previously granted
with the raw/low-level types.

Diff Detail

Event Timeline

rriddle created this revision.May 2 2022, 7:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 2 2022, 7:42 PM
rriddle requested review of this revision.May 2 2022, 7:42 PM
rriddle updated this revision to Diff 429573.May 15 2022, 3:24 PM
rriddle updated this revision to Diff 430290.May 18 2022, 2:19 AM
rriddle updated this revision to Diff 430850.May 19 2022, 4:38 PM
rriddle updated this revision to Diff 431754.May 24 2022, 12:22 PM
jpienaar accepted this revision.May 28 2022, 11:44 AM

Nice clean-up

mlir/docs/PDLL.md
1168

able allowed? (Guessing s/able//)

mlir/lib/Tools/PDLL/CodeGen/CPPGen.cpp
172

Why 0?

This revision is now accepted and ready to land.May 28 2022, 11:44 AM
rriddle marked 2 inline comments as done.May 30 2022, 4:27 PM
rriddle added inline comments.
mlir/lib/Tools/PDLL/CodeGen/CPPGen.cpp
172

This is called for constraints on VariableDecls, which have only one input. I merged this function into the VariableDecl overload so that the single input expectation is more obvious.

This revision was automatically updated to reflect the committed changes.
rriddle marked an inline comment as done.